{ // 获取包含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 };\n }","initializeRoutes()\n {\n // Dynamic pages\n this.express.get(\"/\", function(_request, _response){\n _response.render(\"index/index.njk\");\n });\n\n // Static paths\n this.express.use(\"/css\", express.static(__dirname + \"/../frontend/css\"));\n this.express.use(\"/javascript\", express.static(__dirname + \"/../frontend/javascript\"));\n\n // External libraries\n this.express.use(\"/bootstrap\", express.static(__dirname + \"/../../node_modules/bootstrap/dist\"));\n this.express.use(\"/bootstrap-table\", express.static(__dirname + \"/../../node_modules/bootstrap-table/dist\"));\n this.express.use(\"/deep-eql\", express.static(__dirname + \"/../../node_modules/deep-eql\"));\n this.express.use(\"/flatpickr\", express.static(__dirname + \"/../../node_modules/flatpickr/dist\"));\n this.express.use(\"/font-awesome\", express.static(__dirname + \"/../../node_modules/@fortawesome/fontawesome-free\"));\n this.express.use(\"/jspdf\", express.static(__dirname + \"/../../node_modules/jspdf/dist\"));\n this.express.use(\"/jspdf-autotable\", express.static(__dirname + \"/../../node_modules/jspdf-autotable/dist\"));\n this.express.use(\"/native-toast\", express.static(__dirname + \"/../../node_modules/native-toast/dist\"));\n this.express.use(\"/jquery\", express.static(__dirname + \"/../../node_modules/jquery/dist\"));\n this.express.use(\"/jquery-ui\", express.static(__dirname + \"/../../node_modules/jquery-ui-dist\"));\n this.express.use(\"/popper-js\", express.static(__dirname + \"/../../node_modules/popper.js/dist/umd\"));\n this.express.use(\"/select2\", express.static(__dirname + \"/../../node_modules/select2/dist\"));\n\n this.initializeQueryResponses();\n this.express.post(\"/createOrder\", this.createOrderResponse.bind(this));\n }","function setupRoutes(app){\n const APP_DIR = `${__dirname}/app`\n const features = fs.readdirSync(APP_DIR).filter(\n file => fs.statSync(`${APP_DIR}/${file}`).isDirectory()\n )\n\n features.forEach(feature => {\n const router = express.Router()\n const routes = require(`${APP_DIR}/${feature}/routes.js`)\n\n routes.setup(router)\n app.use(`/${feature}`, router)\n })\n}","function route(endpoint){\n app.get(`/${endpoint}`, (req, res)=>{\n if (endpoint !== \"\") {\n sqlDB.connect(config, ()=>{\n const request = new sqlDB.Request();\n request.query(`SELECT * FROM ${endpoint}`, (err, result)=>{\n if (err) console.log(err);\n res.send(result.recordset);\n });\n })\n }\n else res.send(\"Hello, you have reached contacts-api. Please navigate to /contacts, /categories, or /companies to continue.\");\n })\n}","function router(app) {\n const path = require('path')\n public = path.join(__dirname, \"../public\")\n\n // Get index\n app.get(\"/\", async function (req, res) {\n console.log('[GET /] Getting index')\n res.sendFile('./index.html', { root: public })\n })\n\n // Get exercise\n app.get(\"/exercise\", async function (req, res) {\n console.log('[GET /exercise] Getting exercise')\n res.sendFile('./exercise.html', { root: public })\n })\n\n // Get stats\n app.get(\"/stats\", async function (req, res) {\n console.log('[GET /stats] Getting stats')\n res.sendFile('./stats.html', { root: public })\n })\n\n // *** API routes ***\n // Get workouts\n app.get(\"/api/workouts\", async function (req, res) {\n console.log('[GET /api/workouts] Getting workouts')\n Workout.find({})\n .sort({ date: -1 })\n .then(dbWorkout => { res.json(dbWorkout) })\n .catch(err => { res.status(400).json(err) })\n })\n\n // Post workouts\n app.post(\"/api/workouts\", async function ({ body }, res) {\n console.log('POST api/workouts: ', body)\n Workout.create(body)\n .then(data => {\n console.log(`Adding workout`)\n res.json(data)\n })\n .catch(err => {\n console.log(\"Error occured during insert: \", err)\n res.json(err)\n })\n })\n\n // Put workout\n app.put(\"/api/workouts/:id\", async function ({ body, params }, res) {\n console.log(`[PUT /api/workouts/${params.id}] Adding exercise`)\n Workout.findByIdAndUpdate(\n params.id,\n // push the body to exercises and set the totalDuration\n { $push: { exercises: body }, $inc: { totalDuration: body.duration } },\n { new: true, runValidators: true }\n )\n .then(data => {\n res.json(data)\n console.log(`Adding ${params.id} ${data}`)\n })\n .catch(err => {\n console.log(\"Error occured during insert: \", err)\n res.json(err)\n })\n })\n\n app.get(\"/api/workouts/range\", async function (req, res) {\n console.log('[GET /api/workouts/range]')\n Workout.find({})\n .then(dbWorkout => { res.json(dbWorkout) })\n .catch(err => { res.status(400).json(err) })\n })\n\n}","function createRoutes (router) {\n router\n .get('/', (_, response) => {\n response.end('')\n })\n .get('/user/:id', (request, response) => {\n response.end(request.params.id)\n })\n .post('/user', (request, response) => {\n response.end('')\n })\n}","function router(nav) {\n authRoutes.route('/signin')\n .post(passport.authenticate('local', {\n successRedirect: '/auth/profile',\n failureRedirect: '/auth/signin'\n }))\n .get((req, res) => {\n // al hacer el render hay que decirle la carpeta porque en index solo le decimos que los archivos estáticos están en views, pero ahora hemos creado una carpeta dentro auth\n res.render('auth/signin', { nav }) // res.send('GET signup works') --> solo para que pinte sin mandar a un ejs // { nav } para que en el ejs salga pintada la importación del header - enviamos el arrary de los links del nav, que lo hemos pasado por le index invocado, para que llegue como parámetro a la función. A render le pasamos un obj con la propiedad nav (del array de los links). render() como segundo argumento siempre recibe un onjeto.\n })\n\n // .post((req, res) => {\n // res.send('hi')\n // }\n // );\n\n // res.json(req.body); // para ver el contenido del body, que será un objeto con los datos introducidos\n \n\n authRoutes\n .route('/signup')\n .get((req, res) => {\n res.render('auth/signup', { nav }) \n })\n .post((req, res) => {\n const newUser = { ...req.body, user: req.body.user.toLowerCase() }; // lo metemos en una const con nombre sin destructurar { user, email, password } - de esta manera nos da mucha más información porque no le decimos que queremos el user, etc.\n // res.json(req.body); // queremos obtener el objeto que nos devuelve - Hay una propiedad ops\n // metemos destructuring assignment para añadir esa propiedad y que no distinga entre un email escrito en mayúsculas o minúsculas ----> email: req.body.email.toLowerCase()\n \n (async function mongo(){\n try {\n client = await MongoClient.connect(dbUrl)\n const db = client.db(dbName);\n const collection = db.collection(collectionName);\n\n // buscar si el usuario existe en la db\n // para el findOne necesitamos un filtro y un callback para ese filtro\n // el email del objeto es el nombre que tiene el input en el ejs\n const user = await collection.findOne({ user: newUser.user }); // buscamos en la db\n\n if(user) { // user o email\n // Si el email de usuario existe, redirecciono a signin\n res.redirect('/auth/signin'); // si aquí meto un render() pintará en esa misma dirección el signin \n } else {\n const result = await collection.insertOne(newUser); // si no está te envío al profile\n req.login(result.ops[0], () => {\n res.redirect('/auth/profile')\n })\n }\n\n } catch (error) {\n debug(error.stack);\n }\n \n client.close(); \n }());\n });\n\n\n authRoutes\n .route('/profile')\n .all((req, res, next) => {\n // si no es ni 0, ni falso, ni undefined, ni null, ni cadena vacía\n // hay usuario, continúo, next()\n if(req.user) {\n next();\n } else {\n res.redirect('/auth/signin');\n }\n })\n .get((req, res) => {\n res.render('/auth/profile', { nav, user: req.user });\n })\n .post((req, res) => {\n res.send('POST profile')\n })\n\n \n \n return authRoutes;\n}","function userMoviesApi(app) {\n \n /** Crea el router */\n const router = express.Router();\n /** Crea la ruta y adjunta el router que vamos a terminar de declarar */\n app.use('/api/user-movies', router);\n /** Crea una instancia de los servicios, que contiene los metodos de mongo */\n const userMovieService = new UserMovieService();\n\n /** Get all from this user */\n router.get(\n '/',\n validationHandler({ userId: userIdSchema }, 'query'),\n async (req, res, next) => {\n const { userId } = req.query;\n try {\n const userMovies = await userMovieService.getUserMovies({ \n userId, \n });\n res.status(200).json({\n data: userMovies,\n message: 'user movies list',\n })\n } catch (error) {\n next(error);\n }\n }\n )\n\n /** Create one for this user */\n router.post(\n '/',\n validationHandler(createUserMovieSchema),\n async (req, res, next) => {\n const { body: userMovie } = req;\n\n try {\n const createUserMovieId = await userMovieService.createUserMovie({\n userMovie,\n })\n res.status(200).json({\n data: createUserMovieId,\n message: 'user-movie',\n })\n } catch (error) {\n next(error);\n }\n }\n )\n\n /** Delete one for this user */\n\n router.delete(\n '/:userMovieId',\n validationHandler({ userMovieId: movieIdSchema}, 'params'),\n async (req, res, next) => {\n const { userMovieId } = req.params;\n\n try {\n const deleteUserMovieId = await userMovieService.deleteUserMovie({\n userMovieId\n });\n res.status(200).json({\n data: deleteUserMovieId,\n message: 'user-movie deleted'\n })\n } catch (error) {\n next(error)\n }\n }\n )\n\n}","function setupServer() {\r\n //\r\n // Middleware's\r\n //\r\n\r\n // Use HTTP sessions\r\n let session = require('express-session')({\r\n secret: 'session_secret_key',\r\n resave: true,\r\n saveUninitialized: false\r\n });\r\n app.use(session);\r\n\r\n // Use Socket IO sessions\r\n let sharedSession = require(\"express-socket.io-session\")(session, {autoSave: true});\r\n io.use(sharedSession);\r\n\r\n // Parse the body of the incoming requests\r\n let bodyParser = require('body-parser');\r\n app.use(bodyParser.json());\r\n app.use(bodyParser.urlencoded({extended: false}));\r\n\r\n // Set static path to provide required assets\r\n let path = require('path');\r\n app.use(express.static(path.resolve('../client/')));\r\n\r\n //\r\n // Routes\r\n //\r\n\r\n // Authentication view endpoint\r\n app.get('/', function (req, res) {\r\n if (req.session.user) {\r\n res.sendFile(path.resolve('../client/views/profile.html'));\r\n }\r\n else {\r\n res.sendFile(path.resolve('../client/views/auth.html'));\r\n }\r\n });\r\n\r\n // Main game screen\r\n app.get('/play', function (req, res) {\r\n req.session.name = req.session.name || \"\";\r\n\r\n res.sendFile(path.resolve('../client/views/index.html'));\r\n });\r\n\r\n // Join endpoint\r\n app.post('/join', function (req, res) {\r\n req.session.name = (req.session.user ? req.session.user.username : req.body.name) || \"\";\r\n res.json({status: 0});\r\n });\r\n\r\n // Register endpoint\r\n app.post('/register', function (req, res) {\r\n let username = req.body.username;\r\n let password = req.body.password;\r\n\r\n if (!username || !password) {\r\n return res.json({status: 1, error_msg: \"Invalid register request\"});\r\n }\r\n\r\n let userData = {\r\n username: username,\r\n password: password,\r\n highScore: 10\r\n };\r\n\r\n // Try registering the user\r\n User.create(userData, function (error, user) {\r\n if (error || !user) {\r\n res.json({status: 1, error_msg: \"The username already exists\"});\r\n console.log(\"error in registering\", error);\r\n }\r\n else {\r\n req.session.user = user;\r\n req.session.name = user.username;\r\n res.json({status: 0});\r\n console.log(user.username, \"has registered...\");\r\n }\r\n });\r\n });\r\n\r\n // Log in post request endpoint\r\n app.post('/login', function (req, res) {\r\n let username = req.body.username;\r\n let password = req.body.password;\r\n\r\n if (!username || !password) {\r\n return res.json({status: 1, error_msg: \"Invalid login request\"});\r\n }\r\n\r\n // Authenticate user's credentials\r\n User.authenticate(username, password, function (error, user) {\r\n if (error) {\r\n res.json({status: 1, error_msg: error.message});\r\n console.log(\"error in logging in\", error);\r\n }\r\n else {\r\n req.session.user = user;\r\n req.session.name = user.username;\r\n res.json({status: 0});\r\n console.log(user.username, \"has logged in...\");\r\n }\r\n });\r\n });\r\n\r\n // Log out endpoint\r\n app.get('/logout', function (req, res) {\r\n // Destroy session object\r\n if (req.session) {\r\n let username = req.session.user;\r\n\r\n req.session.destroy(function (err) {\r\n if (err) {\r\n res.json({status: 1, error_msg: \"Please try again later!\"});\r\n console.log(\"error in logging out\", error);\r\n }\r\n else {\r\n res.json({status: 0});\r\n console.log(username, \"has logged out...\");\r\n }\r\n });\r\n }\r\n });\r\n}","function createUsers(req, res) {\n\n}","async function index(req, res) {}","function movieApi(app){\n const router = express.Router();\n app.use('/api/movies', router);\n\n const moviesService = new MoviesService()\n\n router.get('/', async function(req,res,next){\n const { tags } = req.query;\n try{\n const movie = await moviesService.getMovies({tags});\n\n res.status(200).json({\n data: movie,\n menssage: 'movie listed'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.get('/:movieId', async function(req,res,next){\n const { movieId } = req.params;\n try{\n const movie = await moviesService.getMovie({movieId});\n\n res.status(200).json({\n data: movie,\n menssage: 'movie retrieved'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.post('/', async function(req,res,next){\n const { body: movie } = req;\n try{\n const createdMovieId = moviesService.createMovie({movie});\n\n res.status(201).json({\n data: createdMovieId,\n menssage: 'movie created'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.put('/:movieId', async function(req,res,next){\n const { movieId } = req.params;\n const { body: movie } = req;\n try{\n const updateMovieId = await moviesService.updateMovie({ movieId, movie });\n\n res.status(200).json({\n data: updateMovieId,\n menssage: 'movie update'\n });\n }catch(err){\n next(err);\n }\n });\n\n router.delete('/:movieId', async function(req,res,next){\n const { movieId } = req.params;\n try{\n const deleteMovie = await moviesService.deleteMovie({ movieId });\n\n res.status(200).json({\n data: deleteMovie,\n menssage: 'movie deleted'\n });\n }catch(err){\n next(err);\n }\n });\n}","async function dbOps() {\n let testing = false;\n\n //If in dev, set fake Ip and testing status to true\n if (process.env.NODE_ENV === \"development\") {\n testing = true;\n }\n\n MongoClient.connect(\n process.env.DB,\n { useNewUrlParser: true },\n async function(err, client) {\n //Error\n if (err) {\n next(err);\n }\n //Connection\n else {\n const db = client.db(\"trivia-actually\"); // Database\n const scoreCollection = db.collection(\"scores\"); // Scores collection\n const ipCollection = db.collection(\"ips\"); // IPs collection\n\n //Get score stats\n const scoreData = await statsHandler.getScores(testing, scoreCollection).catch(err => {\n next(err);\n });\n\n //Get ip Stats\n const ipData = await statsHandler.getIps(testing, ipCollection).catch(err => {\n next(err);\n });\n\n //Get unique locations\n const locations = await statsHandler.reduceLocations(ipData.locations).catch(err => {\n next(err);\n });\n\n //JSON request for testing\n if (req.body.format === \"json\") {\n try {\n res.json({\n triviaData: {\n easyCount: easyTrivia.length,\n medCount: medTrivia.length,\n hardCount: hardTrivia.length,\n totalTriviaCount: triviaData.length\n },\n scoreStats: scoreData,\n ipStats: { ipCount: ipData.ipCount, locations: locations }\n });\n } catch (err) {\n next(err);\n }\n } // end of if format json\n //Otherwise render Jade page\n else {\n try {\n res.render(\"admin_stats\", {\n totalCount: scoreData.totalCount,\n ipCount: ipData.ipCount,\n average: scoreData.average,\n median: scoreData.median,\n zeroCount: scoreData.zeroCount,\n tenCount: scoreData.tenCount,\n twentyCount: scoreData.twentyCount,\n thirtyCount: scoreData.thirtyCount,\n fortyCount: scoreData.fortyCount,\n fiftyCount: scoreData.fiftyCount,\n sixtyCount: scoreData.sixtyCount,\n seventyCount: scoreData.seventyCount,\n eightyCount: scoreData.eightyCount,\n ninetyCount: scoreData.ninetyCount,\n hundredCount: scoreData.hundredCount,\n easyCount: easyTrivia.length,\n medCount: medTrivia.length,\n hardCount: hardTrivia.length,\n totalTriviaCount: triviaData.length,\n locations: locations\n });\n } catch (err) {\n next(err);\n }\n } // end of else render Jade\n\n client.close();\n } // end of else for successful connection\n } // end of connection function\n ); // end of MongoClient.connect\n }","function htmlRoutes(app) {\n app.get('/survey', function (req, res) {\n res.sendFile(path.join(__dirname + '/../public/survey.html'));\n });\n\n // A default USE route that leads to home.html which displays the home page.\n app.use(function (req, res) {\n res.sendFile(path.join(__dirname + '/../public/home.html'));\n });\n\n}","function authroute(navbar,login){\r\n //Authot Array\r\n var authors = [\r\n { \r\n id:1,\r\n name:'William Shakespeare',\r\n img:'shakespeare.jfif',\r\n description:\"William Shakespeare was an English poet, playwright, and actor, widely regarded as the greatest writer in the English language\"\r\n },\r\n { \r\n id:2,\r\n name:'Joseph Barbera',\r\n img:'joseph.jpg',\r\n description:\"Joseph Roland Barbera was an American animator, director, producer, storyboard artist, and cartoon artist, whose film and television cartoon characters entertained millions of fans worldwide\"\r\n },\r\n { \r\n id:3,\r\n name:\"Jonathan Swift\",\r\n img:'jonathan.jpg',\r\n description:\"Jonathan Swift was an Anglo-Irish satirist, essayist, political pamphleteer poet and Anglican cleric who became Dean of St Patrick's Cathedral, Dublin, hence his common sobriquet, 'Dean Swift'\"\r\n }\r\n ]\r\n authorRouter.get('/',function(req,res){\r\n res.render(\"authors\",{\r\n navbar,\r\n login,\r\n title:\"Authors\",\r\n authors\r\n });\r\n });\r\n authorRouter.get('/:id',function(req,res){\r\n const id = req.params.id;\r\n res.render('author',{\r\n navbar,\r\n login,\r\n title:\"Author\",\r\n authors:authors[id]\r\n });\r\n })\r\n return authorRouter;\r\n}","function main () {\n app.use(bodyParser.json());\n // Routes & Handlers\n app.get('/list',cacheMiddleware(10), function (req, res) {\n connection.query('select * from list', function (error, results, fields) {\n if (error) throw error;\n memCache.put(req.mCacheKey, results,1200000);\n incrementApiHitCount(req.mCacheKey);\n res.json(results);\n });\n});\n\napp.get('/emplist',cacheMiddleware(10), function (req, res) {\n connection.query('select * from list', function (error, results, fields) {\n if (error) throw error;\n memCache.put(req.mCacheKey, results,1200000);\n incrementApiHitCount(req.mCacheKey);\n res.json(results);\n });\n});\n \napp.get('/apilist/:key',cacheMiddleware(10), function (req, res) {\n let apikey=req.params.key;\n connection.query('select word from filter_words where siteid in (select siteid from keyinfo where api_key=?)',apikey, function (error, results, fields) {\n if (error) throw error;\n if(results.length>0) {\n memCache.put(req.mCacheKey, results,1200000);\n incrementApiHitCount(req.mCacheKey);\n res.json(results);\n }\n else{\n let emptyResponse='Invalid Key';\n res.json(emptyResponse);\n }\n });\n\n \n});\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\n\n}","_declareExpressUses(express) {\n this.expApp.use('/', express.static(__dirname + '/../web'));\n this.expApp.use('/materialize', express.static('./node_modules/materialize-css/dist'));\n this.expApp.use('/blockui', express.static('./node_modules/blockui-npm'));\n this.expApp.use('/materialize-autocomplete', express.static('./node_modules/materialize-autocomplete'));\n this.expApp.use('/jquery', express.static('./node_modules/jquery/dist'));\n }","setUpRoutes () {\n\n /*\n * Hotels Query\n * GET /hotels\n * params: stringify query\n * - ?name=**&stars=[2, 5]\n * - ?_id=**\n */\n this.app.get('/hotels', async (req, res) => {\n const query = parse(req.url, true).query\n\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\n\n console.log(query)\n const results = this.filterData(query, data)\n res.status(200).json(results)\n })\n\n /*\n * Hotels Create\n * POST /\n * body: Hotel fields (see validator)\n */\n this.app.post('/', db(async (req, res) => {\n const {Model} = req\n const data = req.body\n let result = {}\n try {\n result = await new Model(data).save()\n } catch (err) {\n console.log('error', err)\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: save hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotel Update\n * PUT /:id\n * params: @id\n * body: Dataset to update\n */\n this.app.put('/:id', db(async (req, res) => {\n const {Model} = req\n const data = req.body\n const {id} = req.params\n delete data._id\n let result = {}\n try {\n result = await Model.findByIdAndUpdate(id, { $set: data }, { new: true })\n } catch (err) {\n console.log('error', err)\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: update hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotel Delete\n * DELETE /:id\n * params: @id\n */\n this.app.delete('/:id', db(async (req, res) => {\n const {Model} = req\n const {id} = req.params\n let result = {}\n try {\n result = await Model.findByIdAndRemove(id)\n if (!result) {\n return res.status(404).send({message: 'hotel not found'})\n }\n } catch (err) {\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: delete hotel'})\n }\n return res.status(200).send({message: 'delete ok', data: result})\n }))\n\n /*\n * Hotels find by id\n * GET /:id\n * params: @id\n */\n this.app.get('/:id', db(async (req, res) => {\n const {Model} = req\n const {id} = req.params\n let result = {}\n try {\n result = await Model.findById(id)\n if (!result) {\n return res.status(404).send({message: 'hotel not found'})\n }\n } catch (err) {\n if (err.name && err.name === 'ValidationError') {\n return res.status(400).send({message: err.message})\n }\n return res.status(500).send({message: 'Error: find by id hotel'})\n }\n return res.status(200).send(result)\n }))\n\n /*\n * Hotels Query\n * GET /hotels\n * params: stringify query\n * - ?name=**&stars=[2, 5]\n * - ?_id=**\n */\n this.app.get('/', db(async (req, res) => {\n const {Model} = req\n const query = parse(req.url, true).query\n\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\n let results = []\n try {\n results = await Model.find(query)\n } catch (err) {\n return res.status(500).send({message: 'Error: find all hotels'})\n }\n return res.status(200).send(results)\n }))\n }","setup() {\n this.app.use(express.json());\n\n this.app.get('/', (req, res) => {\n res.send(\"Hello World!\")\n });\n }","middlewares() {\n //directorio publico\n this.app.use(express.static('public'));\n\n //convertir los datos que llegan en json\n this.app.use(express.json());\n }","index(req, res) {\n User.find({}, (err, users) => {\n if (err) {\n console.log(`Error: ${err} `);\n }\n let context = {\n users: users\n };\n return res.render('index', context);\n })\n }","function randomRest(req, res, next){\n var id = req.params.id;\n Wishlist.find({_id: id}, function(err, wishlist) {\n var taurs = wishlist.restaurants;\n var taur = shuffleList(taurs);\n res.json(taur);\n })\n}","function route(...etc)\n{\n etc.unshift(stockAPI);\n let sOut = etc.reduce((acc, curr)=>acc+=curr+'/');\n return sOut;\n}","function main () {\n let app = express(); // Export app for other routes to use\n let handlers = new HandlerGenerator();\n const port = process.env.PORT || 8000;\n app.use(bodyParser.urlencoded({ // Middleware\n extended: true\n }));\n app.use(bodyParser.json());\n // Routes & Handlers\n app.post('/login', handlers.login);\n app.get('/', middleware.checkToken, handlers.index);\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\n}","function bootApplication(app, config, passport) {\n app.set('showStackError', true)\n app.use(express.static(__dirname + '/../public'))\n app.use(express.logger(':method :url :status'))\n\n // set views path, template engine and default layout\n console.log(__dirname + '/../app/views');\n app.set('views', __dirname + '/../app/views')\n app.set('view engine', 'jade')\n\n app.configure(function () {\n // dynamic helpers\n app.use(function (req, res, next) {\n res.locals.appName = 'XbeeCordinator'\n res.locals.title = 'Xbee Cordiator'\n res.locals.showStack = app.showStackError\n res.locals.req = req\n next()\n })\n\n\n // bodyParser should be above methodOverride\n app.use(express.bodyParser())\n app.use(express.methodOverride())\n\n // cookieParser should be above session\n app.use(express.cookieParser());\n app.use(express.session({\n secret: 'sessionstore',\n store: new MemoryStore(),\n key: 'blah'\n })\n );\n\n app.use(passport.initialize())\n app.use(passport.session())\n\n app.use(express.favicon())\n app.use(express.errorHandler({showStack: true, dumpExceptions: true}));\n // routes should be at the last\n app.use(app.router)\n\n // assume \"not found\" in the error msgs\n // is a 404. this is somewhat silly, but\n // valid, you can do whatever you like, set\n // properties, use instanceof etc.\n app.use(function(err, req, res, next){\n // treat as 404\n if (~err.message.indexOf('not found')) return next()\n\n // log it\n console.error(err.stack)\n\n // error page\n res.status(500).render('500')\n })\n\n // assume 404 since no middleware responded\n app.use(function(req, res, next){\n res.status(404).render('404', { url: req.originalUrl })\n })\n\n })\n\n app.set('showStackError', true)\n\n}","route() {\n this.router\n .route('/:id/accounts')\n .get(validateToken, verifyIsClient, this.userController.getAccounts)\n .post(\n validateToken,\n verifyIsClient,\n createAccountValidator,\n validate,\n this.userController.createAccount,\n );\n\n this.router\n .route('/:id/accounts/:accountNumber/transactions')\n .get(validateToken, verifyIsClient, this.userController.accountHistory);\n\n this.router\n .route('/:id/transactions/:transId')\n .get(validateToken, verifyIsClient, this.userController.specificTranHist);\n\n this.router\n .route('/:id/accounts/:accountNumber')\n .get(validateToken, verifyIsClient, this.userController.specAcctDetails);\n\n this.router\n .route('/:id/confirmEmail/:token')\n .get(\n setHeadersparams2,\n validateToken,\n verifyIsClient,\n this.userController.confirmEmail,\n );\n\n this.router\n .route('/:id/changePassword')\n .patch(\n validateToken,\n verifyIsClient,\n changePasswordValidator,\n validate,\n this.userController.changePassword,\n );\n\n this.router\n .route('/:id/transactions/:accountNumber/transfer')\n .post(\n validateToken,\n verifyIsClient,\n transferFundValidator,\n validate,\n this.userController.transferFunds,\n );\n\n this.router\n .route('/:id/transactions/:accountNumber/airtime')\n .post(\n validateToken,\n verifyIsClient,\n airtimeValidator,\n validate,\n this.userController.buyAirtime,\n this.staffController.debitAccount,\n );\n\n this.router\n .route('/:id/upload')\n .post(upload.single('passport'), this.userController.uploadPassport);\n\n return this.router;\n }","function htmlRoutes(app) {\n // Route to the homepage\n app.get(\"/\", function (req, res) {\n res.sendFile(path.join(__dirname, \"../public/home.html\"));\n });\n\n // Route to the survey page\n app.get(\"/survey\", function (req, res) {\n res.sendFile(path.join(__dirname, \"../public/survey.html\"));\n });\n}","function route(req,res,module,app,next,counter) { \n \n // Wait for the dependencies to be met \n if(!calipso.socket) {\n \n counter = (counter ? counter : 0) + 1; \n \n if(counter < 1000) {\n process.nextTick(function() { route(req,res,module,app,next,counter); }); \n return;\n } else {\n calipso.error(\"Tweetstream couldn't route as dependencies not met.\")\n next();\n return;\n } \n }\n \n res.menu.primary.push({name:'Tweets',url:'/tweets',regexp:/tweets/});\n \n /**\n * Routes\n */ \n module.router.route(req,res,next);\n \n}","run (req, res, next) {}","function failRandomlyMiddleware(req, res, next) {\n if (Math.random() * 2 >= 1) {\n next();\n } else {\n res.status(500).end();\n }\n}","function AboutRoute(db) {\n //var ctrl = new AboutCtrl(db);\n \n return [\n {\n method: 'GET',\n path: '/',\n handler: (request, h) => {\n \n return 'Hello, world!';\n }\n },\n {\n method: 'GET',\n path: '/{name}',\n handler: (request, h) => {\n \n return 'Hello, ' + encodeURIComponent(request.params.name) + '!';\n }\n }\n ];\n}","async index(req, res) {\n // checando se o usuario logado é um provider\n const checkUserProvider = await User.findOne({\n where: { id: req.Id, provider: true },\n });\n // caso nao seja cai aqui\n if (!checkUserProvider) {\n return res.status(401).json({ error: 'User is not a provider' });\n }\n\n // pega a data passada\n const { date } = req.query;\n // variavel que retorna a data\n const parsedDate = parseISO(date);\n // checa todos os Appointments do dia atraves do usuario logado\n const Appointments = await Appointment.findAll({\n where: {\n provider_id: req.Id,\n canceled_at: null,\n date: {\n [Op.between]: [startOfDay(parsedDate), endOfDay(parsedDate)], // operador between, com o inicio do dia e o fim do dia\n },\n },\n order: ['date'], // ordenado pela data\n });\n\n return res.json(Appointments);\n }","start() {\n const app = express_1.default();\n let query = new user_serv_1.default();\n // route for GET /\n // returns items\n app.get('/', (request, response) => __awaiter(this, void 0, void 0, function* () {\n let data = yield query.find({});\n response.send(data);\n }));\n app.get('/register', (request, response) => __awaiter(this, void 0, void 0, function* () {\n let user = new user_1.default();\n let answer = yield query.register(user);\n if (answer.result)\n response.send();\n else\n response.status(500).send(answer);\n }));\n // Server is listening to port defined when Server was initiated\n app.listen(this.port, () => {\n console.log(\"Server is running on port \" + this.port);\n });\n }","constructor() {\n this.express = express(); //THE APP\n this.middleware();\n this.routes();\n }","constructor() {\n this.express = express(); //THE APP\n this.middleware();\n this.routes();\n }","function createExpressApp() {\n var app = express();\n\n // returns an empty response and sends a chosen HTTP status\n app.get('/return-status/:status', function(req, res) {\n res.status(parseInt(req.params.status)).send(\"\");\n });\n\n // returns a chosen body with HTTP status 200\n app.get('/return-body/:body', function(req, res) {\n res.status(200).send(req.params.body);\n });\n\n // returns a chosen header with HTTP status 200\n app.get('/return-header/:name/:value', function(req, res) {\n res.status(200).set(req.params.name, req.params.value).send(\"Ok!\");\n });\n\n // responds \"Ok!\" after a delay of :ms milliseconds\n app.get('/delay-for-ms/:ms', function(req, res) {\n setTimeout(function() {\n res.status(200).send(\"Ok!\");\n }, parseInt(req.params.ms));\n });\n\n // responds with a body of the chosen size\n app.get('/response-size/:bytes', function(req, res) {\n var size = parseInt(req.params.bytes);\n res.set({'content-type': 'application/octet-stream'});\n res.status(200).send(new Buffer(size)).end();\n });\n\n // for each ID - fails 2 times with 500, then returns \"Ok!\"\n var fttsCounts = {};\n app.all('/fail-twice-then-succeed/:id', function(req, res) {\n var count = fttsCounts[req.params.id] || 0;\n fttsCounts[req.params.id] = count + 1;\n if (count >= 2)\n res.status(200).send(\"Ok!\");\n else\n res.status(500).send(\"Oh my!\");\n });\n\n // for each ID - returns an incrementing counter after a small delay, starting at 1 for the first request\n var icCounts = {};\n app.all('/incrementing-counter/:id', function(req, res) {\n var count = icCounts[req.params.id] || 1;\n icCounts[req.params.id] = count + 1;\n setTimeout(function() {\n res.status(200).send(count.toString());\n }, 50);\n });\n\n // incrementing counter with a configurable cache-control setting\n app.all('/counter/:id/cache-control/:cache', function(req, res) {\n var count = icCounts[req.params.id] || 1;\n icCounts[req.params.id] = count + 1;\n\n res.status(200)\n .set('Cache-Control', req.params.cache)\n .send(count.toString());\n });\n\n // for each ID - return success response with cache, then fail\n var stfCounts = {};\n app.all('/succeed-then-fail/:id/cache-control/:cache', function(req, res) {\n var count = stfCounts[req.params.id] || 1;\n stfCounts[req.params.id] = count + 1;\n\n if(count < 2)\n res.status(200)\n .set('Cache-Control', req.params.cache)\n .send('Ok!');\n else\n res.status(500).send(\"Oh my!\");\n });\n\n // register a route for each HTTP method returning the method that was used in a header (to test HEAD properly)\n app.all('/return-method-used/:method', function(req, res) {\n res.status(200).set('X-Method', req.method).send('');\n });\n\n // this route returns a 404 once, then 200 to test 4xx caching\n var first404then200Ids = {};\n app.get('/first-404-then-200/:id', function(req, res) {\n if (first404then200Ids[req.params.id]) {\n res.status(200).send('Ok.');\n } else {\n first404then200Ids[req.params.id] = true;\n res.status(404).send('Not found.');\n }\n });\n\n return app;\n}","function setupApp () {\n const app = express()\n app.use(errorHandler);\n app.get(\"/test\",(req, res)=>{\n //res.send(\"Is is working!\");\n var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];\n let sorted=_.sortBy(stooges, 'age');\n res.send(sorted);\n });//end get(/error)\n\n\n app.get(\"/load-practitioners\", (req, res)=>{\n\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\"/practitioner\",result:typeResult.iniate,\n message:`Start the import CSV file content`});\n\n let filePath = mappingConfig.app.dataFilePath;\n\n let server = mappingConfig.app.server;\n\n customLibrairy.createPractitionerFromCSV(filePath,function(records){\n\n let fhirs = records.entry\n\n for(let fhir of fhirs)\n {\n \n //fhir = fhir.resource\n\n if ( fhir.resourceType === \"Bundle\" &&\n ( fhir.type === \"transaction\" || fhir.type === \"batch\" ) ) {\n console.log( \"Saving \" + fhir.type )\n let dest = URI(server).toString()\n axios.post( dest, fhir ).then( ( res ) => {\n console.log( dest+\": \"+ res.status )\n console.log( JSON.stringify( res.data, null, 2 ) )\n } ).catch( (err) => {\n console.error(err)\n } )\n } else {\n console.log( \"Saving \" + fhir.resourceType +\" - \"+fhir.id )\n let dest = URI(server).segment(fhir.resourceType).segment(fhir.id).toString()\n axios.put( dest, fhir ).then( ( res ) => {\n console.log( dest+\": \"+ res.status )\n console.log( res.headers['content-location'] )\n } ).catch( (err) => {\n console.error(err)\n console.error(JSON.stringify(err.response.data,null,2))\n } )\n }\n \n }\n });\n\n });//end \n\n app.get(\"/load-roles\", (req, res)=>{\n\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\"/practitionerRole\",result:typeResult.iniate,\n message:`Start the import CSV file content`});\n\n let filePath = mappingConfig.app.dataFilePath;\n\n let server = mappingConfig.app.server;\n\n\n customLibrairy.createPractitionerRoleFromCSV(filePath,function(records){\n\n let fhirs = records.entry\n\n\n for(let fhir of fhirs)\n {\n\n if ( fhir.resourceType === \"Bundle\" &&\n ( fhir.type === \"transaction\" || fhir.type === \"batch\" ) ) {\n\n console.log( \"Saving \" + fhir.type )\n let dest = URI(server).toString()\n axios.post( dest, fhir ).then( ( res ) => {\n console.log( dest+\": \"+ res.status )\n console.log( JSON.stringify( res.data, null, 2 ) )\n } ).catch( (err) => {\n console.error(err)\n } )\n } else {\n console.log( \"Saving \" + fhir.resourceType +\" - \"+fhir.id )\n let dest = URI(server).segment(fhir.resourceType).segment(fhir.id).toString()\n axios.put( dest, fhir ).then( ( res ) => {\n console.log( dest+\": \"+ res.status )\n console.log( res.headers['content-location'] )\n } ).catch( (err) => {\n console.error(err)\n console.error(JSON.stringify(err.response.data,null,2))\n } )\n }\n \n }\n });\n });//end \n\n app.get(\"/Practitioner\",(req, res)=>{\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\"/practitioner\",result:typeResult.iniate,\n message:`Start the import CSV file content`});\n let filePath=mappingConfig.app.dataFilePath;\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\n\n //console.log(recordPractitioners);\n\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\"readCSVData\",\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\n let listExtractedPractitioner=[];\n listExtractedPractitioner=customLibrairy.buildPractitioner(recordPractitioners);\n\n //console.log(listExtractedPractitioner.entry)\n \n res.send(listExtractedPractitioner);\n \n });\n });//end \n\n app.get(\"/PractitionerRole\",(req, res)=>{\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\"/practitioner\",result:typeResult.iniate,\n message:`Start the import CSV file content`});\n let filePath=mappingConfig.app.dataFilePath;\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\n //console.log(patientData);\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\"readCSVData\",\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\n let listExtractedPractitionerRole=[];\n listExtractedPractitionerRole=customLibrairy.buildPractitionerRole(recordPractitioners);\n res.send(listExtractedPractitionerRole);\n \n });\n });//end\n app.get(\"/Location\",(req, res)=>{\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\"/location\",result:typeResult.iniate,\n message:`Start the import CSV file content`});\n let filePath=mappingConfig.app.dataFilePath;\n console.log(filePath)\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\n //console.log(patientData);\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\"readCSVData\",\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\n let listExtractedLocation=[];\n listExtractedLocation=customLibrairy.buildLocation(recordPractitioners);\n res.send(listExtractedLocation);\n \n });\n });//end\n app.get(\"/ValueSet\",(req, res)=>{\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\"/Job-ValueSet\",result:typeResult.iniate,\n message:`Start the import CSV file content`});\n let filePath=mappingConfig.app.dataFilePath;\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\n //console.log(patientData);\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\"readCSVData\",\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\n let listExtractedJob=[];\n listExtractedJob=customLibrairy.buildJob(recordPractitioners);\n res.send(listExtractedJob);\n \n });\n });//end\n \n return app\n}","function moviesApi(app) {\n const router = express.Router();\n app.use('/api/movies', router);\n\n //Instanciando un nuevo servicio\n const moviesServices = new MoviesServices();\n\n //----------------- Aqui definimos las rutas -----------------------------\n\n //Aqui passport actua como un middleware y en este caso no requiere de un custom callback, de esta forma protegemos nuestros endpoint con passport. Cn lo que la unica manera de obtener acceso es si tenemos un jwt valido.\n router.get(\n '/',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['read:movies']),\n async function(req, res, next) {\n cacheResponse(res, FIVE_MINUTES_IN_SECONDS);\n //los tags probiene del query de la url recuerda response.object y request.object la lectura del curso\n const { tags } = req.query;\n try {\n //getMovies probiene del la capa de servicios\n const movies = await moviesServices.getMovies({ tags });\n //Hardcode Error para ver un error\n //throw new Error('error for testing propuses');\n res.status(200).json({\n data: movies,\n massage: 'movies Listed'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //NOTA:La diferencia principal entre parametros y query es que: los parametros estan establecidos en l url y query es cuando se le pone ?-nombreQuery- y ademas se puede concatenar.\n\n //Implementando metodos CRUD\n //Buscado por medio del ID\n //NOTA: Los middleware van entre la ruta y la definicion de la ruta tantos como se quiera\n router.get(\n '/:movieId',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['read:movies']),\n validationHandler({ movieId: movieIdSchema }, 'params'),\n async function(req, res, next) {\n cacheResponse(res, SIXTY_MINUTES_IN_SECONDS);\n //en este caso el id biene como parametro en la url\n const { movieId } = req.params;\n try {\n const movies = await moviesServices.getMovie({ movieId });\n res.status(200).json({\n data: movies,\n massage: 'Movie retrive'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //Creando y recibiendo la pelicula\n router.post(\n '/',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['create:movies']),\n validationHandler(createMovieSchema),\n async function(req, res, next) {\n //en este caso biene es del cuerpo el body con un alias para ser mas especifioc en este caso boyd: movie(alias)\n const { body: movie } = req;\n try {\n const createMovieId = await moviesServices.createMovie({ movie });\n //cuando creamos el codigo es 201\n res.status(201).json({\n data: createMovieId,\n massage: 'Movies created'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //Actualizando las peliculas\n router.put(\n '/:movieId',\n passport.authenticate('jwt', { session: false }),\n scopesValidationHandler(['update:movies']),\n validationHandler({ movieId: movieIdSchema }, 'params'),\n validationHandler(updateMovieSchema),\n async function(req, res, next) {\n const { movieId } = req.params;\n const { body: movie } = req;\n try {\n const updatedMovieId = await moviesServices.updateMovie({\n movieId,\n movie\n });\n res.status(200).json({\n data: updatedMovieId,\n massage: 'Movie updated'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n\n //Reto:\n //NOTA: PATCH como PUT se usa para actualizaciones pero con la diferencia de que este es usado para hacer cambios en una parte del recurso en una locacion y no el recurso completo es descrito como una minorUpdate y fallara si el recurso no existe. Mas info https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods\n router.patch('/:movieId', async (req, res, next) => {\n const { movieId } = req.params;\n const { body: movie } = req;\n\n try {\n const partiallyUpdatedMovieId = await moviesServices.partialUpdateMovie({\n movieId,\n movie\n });\n\n res.status(200).json({\n data: partiallyUpdatedMovieId,\n massage: 'partially updated movie'\n });\n } catch (err) {\n next(err);\n }\n });\n\n //Borrar las Peliculas\n router.delete(\n '/:movieId',\n passport.authenticate('jwt', { session: false }), //Validar Autenticacion\n scopesValidationHandler(['delete:movies']), //Validar Permisos Necesarios\n validationHandler({ movieId: movieIdSchema }, 'params'), //Validar que los Datos esten Correctos\n async function(req, res, next) {\n const { movieId } = req.params;\n try {\n const movies = await moviesServices.deleteMovie({ movieId });\n res.status(200).json({\n data: movies,\n massage: 'Movies deleted'\n });\n } catch (err) {\n next(err);\n }\n }\n );\n}","_createApp () {\n return new Promise(resolve => {\n this.app = Express()\n\n if (datadog.key === 'none') this.app.use((req, res) => res.json({ success: true }))\n else LoadRoutes(this, this.app, __dirname, './routes')\n\n this.app.listen(statsPort, () => {\n resolve()\n })\n })\n }","constructor(apiName, config, totoEventPublisher, totoEventConsumer) {\n\n this.app = express();\n this.apiName = apiName;\n this.totoEventPublisher = totoEventPublisher;\n this.totoEventConsumer = totoEventConsumer;\n this.logger = new Logger(apiName)\n\n // Init the paths\n this.paths = [];\n\n config.load().then(() => {\n let authorizedClientIDs = config.getAuthorizedClientIDs ? config.getAuthorizedClientIDs() : null;\n\n if (config.getCustomAuthVerifier) console.log('[' + this.apiName + '] - A custom Auth Provider was provided');\n\n this.validator = new Validator(config.getProps ? config.getProps() : null, authorizedClientIDs, this.logger, config.getCustomAuthVerifier ? config.getCustomAuthVerifier() : null);\n\n });\n\n // Initialize the basic Express functionalities\n this.app.use(function (req, res, next) {\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n res.header(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Authorization, x-correlation-id, x-msg-id, auth-provider, x-app-version, x-client\");\n res.header(\"Access-Control-Allow-Methods\", \"OPTIONS, GET, PUT, POST, DELETE\");\n next();\n });\n\n this.app.use(bodyParser.json());\n this.app.use(busboy());\n this.app.use(express.static(path.join(__dirname, 'public')));\n\n // Add the standard Toto paths\n // Add the basic SMOKE api\n this.path('GET', '/', {\n do: (req) => {\n\n return new Promise((s, f) => {\n\n return s({ api: apiName, status: 'running' })\n });\n }\n });\n\n // Add the /publishes path\n this.path('GET', '/produces', {\n do: (req) => {\n\n return new Promise((s, f) => {\n\n if (this.totoEventPublisher != null) s({ topics: totoEventPublisher.getRegisteredTopics() });\n else s({ topics: [] });\n });\n }\n })\n\n // Add the /consumes path\n this.path('GET', '/consumes', {\n do: (req) => {\n\n return new Promise((s, f) => {\n\n if (this.totoEventConsumer != null) s({ topics: totoEventConsumer.getRegisteredTopics() });\n else s({ topics: [] });\n })\n }\n })\n\n // Bindings\n this.staticContent = this.staticContent.bind(this);\n this.fileUploadPath = this.fileUploadPath.bind(this);\n this.path = this.path.bind(this);\n }","function main() {\n getRoutes();\n}","config() {\n this.app.set(\"PORT\", process.env.PORT || 3000);\n this.app.use(morgan_1.default(\"dev\")); //Miraremos las peticiones en modo desarrollador.\n this.app.use(cors_1.default()); //Permitira que clientes haga peticiones\n this.app.use(express_1.default.json()); //La app entendera json gracias a esto\n this.app.use(express_1.default.urlencoded({ extended: false })); //Permite peticiones por HTML\n }","function discoverHikes(req, res, next) {\n \tconsole.log(req.user);\n\tres.render('main', req.user);\n}","use (middleware) {\n this.app.use(middleware)\n }","function Router(nav1){\n\n \nvisitorauthorsRouter.get('/', function(req,res){\n Authorsdata.find()\n .then(function(authors){\n\n res.render(\"visitorauthors\",{\n nav1,\n title:'Library',\n authors\n })\n })\n \n})\n\nvisitorauthorsRouter.get('/:id',function(req,res){\n const id=req.params.id;\n Authorsdata.findOne({_id:id})\n .then(function(author){\n res.render('visitorauthor',{\n nav1,\n title:'Library App',\n author\n })\n })\n \n})\n \n \n \n return visitorauthorsRouter;\n }","function call(req, res) {\n // estatutos...\n}","function indexTripRoute(req, res, next){\n Trip.find()\n .populate('user') //had to populate user data in order to get access to trip.user._id\n .then(trips => {\n trips = trips.filter(trip => trip.user._id.equals(req.currentUser._id)); // req.currentUser is from secureRoute\n res.status(200).json(trips);\n })\n .catch(next);\n}","index(req, res){\r\n User.find({}, (err, users) => {\r\n if(err){\r\n console.log(err);\r\n }\r\n res.render('index', { users: users})\r\n })\r\n }","function init(app) {\n app.get('/', (request, response) => { \n //throw 44\n response.render('home', {\n name: 'John' + request.chance\n })\n })\n}"],"string":"[\n \"function set_routes() {\\n\\n // Check your current user and roles\\n app.get( '/status/:id', function( request, response ) {\\n acl.userRoles( request.params.id || false, function( error, roles ){\\n response.json( {'User': request.user ,\\\"Roles\\\": roles });\\n });\\n });\\n\\n // Only for users and higher\\n app.all( '/secret', [ acl.middleware( 1, get_user_id) ],function( request, response ) {\\n\\n response.send( 'Welcome Sir!' +request.params.id);\\n }\\n );\\n\\tapp.use('/user',require('./routers/userR.js'));\\n app.use('/event',require('./routers/eventR.js'));\\n //accept error\\n app.use(acl.middleware.errorHandler('json')); \\n \\n}\",\n \"routes() {\\n this.app.use('/images', express.static('uploads'));\\n this.app.use('/users/', userRoutes);\\n this.app.use('/tokens/', tokenRoutes);\\n this.app.use('/shop/', shopRoutes);\\n this.app.use('/products/', productRoutes);\\n this.app.use('/order/', orderRoutes);\\n this.app.use('/address/', addressRoutes);\\n this.app.use(\\\"/creditCard/\\\", creditCardRoutes)\\n }\",\n \"async function main() {\\n const mysql = require('mysql2/promise');\\n const pool = mysql.createPool({\\n host: process.env.MYSQL_HOST || 'localhost', \\n database: process.env.MYSQL_DB || 'test',\\n user: process.env.MYSQL_USER || 'root', \\n password: process.env.MYSQL_PASSWORD\\n });\\n\\n app.use('/api/user/', require('./routes/user')(pool))\\n app.use('/api/sessions', require('./routes/sessions')(pool))\\n app.use('/api/campaigns', require('./routes/campaigns')(pool))\\n app.use('/api/top', require('./routes/top')(pool))\\n app.use('/api/', require('./routes/misc')(pool))\\n \\n app.get('*',(req,res) => {\\n res.status(404).json({error:'PageNotFound'})\\n })\\n}\",\n \"routes() {\\n this.app.use(index_routes_1.default);\\n this.app.use('/api/photos', photos_routes_1.default);\\n this.app.use('/api/users', users_routes_1.default);\\n }\",\n \"function setupRoutes(app, passport) {\\n var loginWithLinkedIn = require('./routes/login/login-linkedin');\\n var loginWithLGoogle = require('./routes/login/login-google');\\n var loginWithLMicrosoft = require('./routes/login/login-microsoft');\\n var loginWithPassword = require('./routes/login/login-with-password');\\n var getCurrentUser = require('./routes/get-current-user');\\n app.use('/login/linkedin', loginWithLinkedIn);\\n app.use('/login/google', loginWithLGoogle);\\n app.use('/login/microsoft', loginWithLMicrosoft);\\n app.use('/technician/login', loginWithPassword);\\n app.use('/getCurrentUser', getCurrentUser);\\n /* router.get('/', function(req, res, next) {\\n res.send('respond with a resource');\\n }); */\\n\\n\\n}\",\n \"routes() {\\n this.app.use('/api/usuarios', require('../routes/usuarios'));\\n }\",\n \"routes() {\\n this.app.use('/api/usuarios', require('../routes/usuarios'));\\n }\",\n \"setupRoutes() {\\n this.app.use(this.express.static(__dirname + '/www'));\\n this.app.use(this.express.static(__dirname + '/module1/www'));\\n this.app.use(this.express.static(__dirname + '/module2/www'));\\n this.app.use(this.express.static(__dirname + '/module3/www'));\\n this.app.use(this.express.static(__dirname + '/module4/www'));\\n this.app.use(this.express.static(__dirname + '/module5/www'));\\n this.app.use(this.express.static(__dirname + '/projects/www'));\\n this.app.use(this.express.static(__dirname + '/module1/frontend'));\\n this.app.use(this.express.static(__dirname + '/module2/frontend'));\\n this.app.use(this.express.static(__dirname + '/module3/frontend'));\\n this.app.use(this.express.static(__dirname + '/module4/frontend'));\\n this.app.use(this.express.static(__dirname + '/module5/frontend'));\\n \\n this.app.all('/meta/*', function(req, res, next) {\\n var path = req.path.substr('/meta/'.length);\\n var dirname = require('path').dirname(path);\\n var filename = require('path').basename(path);\\n if (require('fs').existsSync(dirname + '/meta.json')) {\\n res.send(require('fs').readFileSync(dirname + '/meta.json', \\n 'utf8'));\\n }\\n else {\\n res.send('{}');\\n }\\n });\\n\\n this.app.all('/readings/*', function(req, res, next) {\\n var path = req.path.substr('/readings/'.length);\\n var dirname = require('path').dirname(path);\\n var filename = require('path').basename(path);\\n filename = filename.split('.');\\n filename.splice(-1, 0, 'modified');\\n filename = filename.join('.');\\n try {\\n if (require('fs').existsSync(dirname + '/' + \\n filename)) {\\n res.send(require('fs').readFileSync(dirname + '/' + \\n filename, 'utf8'));\\n } else {\\n res.send(require('fs').readFileSync(__dirname + '/' + \\n path, 'utf8'));\\n }\\n } catch(e) {\\n res.send('');\\n }\\n });\\n \\n this.app.all('/reset/*', function(req, res, next) {\\n var path = req.path.substr('/reset/'.length);\\n var dirname = require('path').dirname(path);\\n var filename = require('path').basename(path);\\n filename = filename.split('.');\\n filename.splice(-1, 0, 'modified');\\n filename = filename.join('.');\\n try {\\n if (require('fs').existsSync(__dirname + '/' + dirname + '/' + \\n filename)) {\\n require('fs').unlinkSync(__dirname + '/' + dirname + \\n '/' + filename);\\n } else {\\n console.info('An error: file not found?');\\n }\\n res.send();\\n } catch(e) {\\n res.send('');\\n }\\n });\\n \\n this.app.all('/run/*', function(req, res, next) {\\n res.send('Node runner is being worked on. Check back soon.');\\n return;\\n // TODO:\\n var status = '';\\n var file = req.path.substr('/run/'.length);\\n // open the log file for writing\\n var log = __dirname + '/' + file.replace(/\\\\\\\\/g, '/')\\n .replace(/\\\\//g, '_') + '.log';\\n require('fs').writeFileSync(log, '');\\n var ws = require('fs').createWriteStream(log);\\n let original = process.stdout.write;\\n process.stdout.write = process.stderr.write = ws.write.bind(ws);\\n\\n // run the file now\\n require(__dirname + '/' + file);\\n \\n // begin the read\\n let sent = false;\\n var rs = require('fs').createReadStream(log);\\n res.set('etag', (new Date()).getTime());\\n rs.on('data', function(data) {\\n res.write(data);\\n });\\n rs.on('end', function() {\\n res.end();\\n try {require('fs').unlinkSync(log);} catch(e) {console.log(e);}\\n try {ws.end();} catch(e) {console.log(e);}\\n process.stdout.write = process.stderr.write = original;\\n sent = true;\\n });\\n setTimeout(() => {\\n if (!sent) {\\n rs.pause();\\n ws.end();\\n res.send();\\n try {require('fs').unlinkSync(log);} catch(e) {}\\n }\\n }, 60000);\\n });\\n \\n this.app.post('/save/*', function(req, res, next) {\\n var path = req.path.substr('/save/'.length);\\n var dirname = require('path').dirname(path);\\n var filename = require('path').basename(path);\\n let data = '';\\n req.on('data', function(datum) {\\n data += datum;\\n });\\n req.on('end', function() {\\n filename = filename.split('.');\\n filename.splice(-1, 0, 'modified');\\n filename = filename.join('.');\\n require('fs').writeFileSync(dirname + '/' + filename, data);\\n res.send();\\n });\\n });\\n }\",\n \"function makeRouter(app) {\\n\\n app.get('/', (req, res, next) => {\\n // console.log(models.model('hotel').findAll.toString());\\n var hotels = Hotel.findAll();\\n var restaurants = Restaurant.findAll();\\n var activities = Activity.findAll();\\n Promise.all([hotels, restaurants, activities]).then( result => {\\n res.render('index',{\\n hotels: result[0],\\n restaurants: result[1],\\n activities: result[2]\\n })\\n } ).catch( err => console.trace( err ) )\\n })\\n\\n app.get('/map', (req, res, next) => {\\n var hotels = Hotel.findAll();\\n var restaurants = Restaurant.findAll();\\n var activities = Activity.findAll();\\n Promise.all([hotels, restaurants, activities]).then( result => {\\n res.render('index',{\\n hotels: result[0],\\n restaurants: result[1],\\n activities: result[2],\\n mapKey: config.mapKey\\n })\\n } ).catch( err => console.trace( err ) )\\n })\\n}\",\n \"routes() {\\n this.app.use('/', indexRoutes_1.default);\\n this.app.use('/api/games', gamesRoutes_1.default);\\n }\",\n \"function addRoutes(app) {\\n\\n app.all('*', (req, res, next) => {\\n console.log(req.method + ' ' + req.url);\\n next();\\n });\\n\\n //register users\\n /*\\n param 1: api endpong\\n param 2: middleware that uses a controller function \\n */\\n app.post('/api/register', authController.register);\\n\\n //login users\\n /*\\n param 1: api endpoint\\n param 2: middleware that uses a controller function \\n */\\n app.post('/api/login', authController.login);\\n\\n app.post('/api/account-activate', authController.accountActivate);\\n app.post('/api/resend-activation-link', authController.resendActivationLink);\\n app.post('/api/reset-password-link', authController.resetPasswordLink);\\n app.post('/api/reset-password', authController.resetPassword);\\n\\n //authorize your user - check that the user sending requests to server is authorized to view this route\\n\\n /*\\n summary of this route:\\n 1. call route\\n 2. run first middleware, checkAuth \\n - checkAuth uses the jwtAuth strategy defined in lib/passport.js\\n - remember that this jwt auth strategy compares the JWT token saved to the client, \\n either stored in a cookie or sent via an Authorization Header, \\n with the JWT token that was created when the user logged in.\\n - checkAuth, if successful, returns the user object from the DB\\n 3. run second middleware, authController.testAuth\\n - returns a {isLoggedIn: true/false} based on whether or not previous middleware\\n successfully returned a user object\\n */\\n app.get('/api/test-auth', checkAuth, authController.testAuth);\\n //if you ahve other protected routes, you can use the same middleware,\\n //e.g: app.get('/api/protected-route', checkAuth, authController.testAuth);\\n //e.g: app.get('/api/another-protected-route', checkAuth, authController.testAuth);\\n\\n}\",\n \"getRandom(req,res){\\n console.log(\\\"getRandom method executed\\\");\\n\\n // Get the count of all users\\n Joke.count().exec((err, count) => {\\n\\n // Get a random entry\\n var random = Math.floor(Math.random() * count)\\n \\n // Again query all users but only fetch one offset by our random #\\n //findOne() is built-in to Mongoose\\n Joke.findOne().skip(random).exec((err, result) => {\\n if(err){\\n return res.json(err)\\n }\\n \\n // Tada! random user\\n return res.json(result);\\n })\\n \\n \\n })\\n }\",\n \"function routeSetup(app){\\n\\tapp.get('/users/:id', getUser(app));\\n\\tapp.delete('/users/:id', deleteUser(app));\\n\\tapp.use('/users/:id', bodyParser.json());\\n\\tapp.post('/users/:id', postUser(app));\\n\\tapp.put('/users/:id', putUser(app));\\n}\",\n \"routes() {\\n let router = express.Router();\\n //palceholder route handler\\n router.get('/', (req, res, next) => {\\n res.json({\\n message: 'Hello World!'\\n });\\n });\\n this.express.use('/', router);\\n }\",\n \"routes() {\\n this.app.use(indexRoutes_1.default);\\n this.app.use(\\\"/api/games\\\", gamesRoutes_1.default); //Le decimos la ruta de la cual tiene acceso a esa peticion\\n //Defecto es '/'\\n }\",\n \"function routerInit(app, dbFull) {\\n var db = dbFull.DA_HR\\n\\n app.get('/attendance', /*isAuthenticated,*/ function(req, res) {\\n attendance_list(db, req.query, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.get('/getEmployeeDetails', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n // QUERY.id = 4017;\\n QUERY.status = 4;\\n // QUERY.date = new Date('2016-11-01');\\n getEmployeeDetails(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.get('/user_attendance', /*isAuthenticated,*/ function(req, res) {\\n user_attendance_list(db, req.query, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.get('/getAttendance', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n QUERY.employee = 96;\\n // QUERY.date = new Date('2016-08-06');\\n getAttendance(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.get('/getEmployeeDayAttendance', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n QUERY.id = 3209;\\n QUERY.employee = 3209;\\n QUERY.date = new Date('2017-01-13');\\n getEmployeeDayAttendance(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send([d]);\\n })\\n });\\n\\n app.get('/getEmployeeMonthAttendance/:EID', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n QUERY.id = req.params.EID;\\n QUERY.employee = req.params.EID;\\n QUERY.date = new Date('2017-01-01');\\n getEmployeeMonthAttendance(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n });\\n });\\n\\n app.get('/getEmployeeMonthAttendance2', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n //QUERY.id = 4017;\\n //QUERY.employee = 4017;\\n QUERY.section = 1;\\n QUERY.date = new Date('2016-11-01');\\n getEmployeeMonthAttendance2(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.get('/getEmployeeMonthAttendance', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n QUERY.id = 117;\\n QUERY.employee = 117;\\n QUERY.date = new Date('2017-06-05');\\n getEmployeeMonthAttendance(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.post('/CreateArchiveAttendance', function(req, res) {\\n var files = req.files.archive_file;\\n var file_path = [];\\n if (files.length) {\\n for (var i = 0; i < files.length; i++) {\\n file_path.push(files[i].path)\\n };\\n } else {\\n file_path.push(files.path)\\n }\\n CreateArchiveAttendance(db, file_path, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n });\\n });\\n\\n app.get('/getEmployeeMonthAttendanceV2', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = {};\\n QUERY.id = 3004;\\n QUERY.employee = 3004;\\n QUERY.date = new Date('2017-10-10');\\n getEmployeeMonthAttendanceV2(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n\\n app.get('/getDailyAttendanceSummary', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = req.query;\\n QUERY.date = (req.query.date) ? new Date(req.query.date) : new Date('2017-10-22');\\n QUERY.status = [1, 2];\\n database.sequelize.query(\\n \\\"SELECT `section`.`id`, `section`.`name`, COUNT(`employee`.`id`) AS `emp_count` \\\" +\\n \\\"FROM `section` \\\" +\\n \\\"LEFT JOIN `employee`\\\" +\\n \\\" ON `employee`.`section` = `section`.`id` \\\" +\\n \\\"WHERE `employee`.`status` IN (1, 2) \\\" +\\n \\\"GROUP BY `section`. `id`;\\\"\\n ).complete(function(err, secData) {\\n getDailyAttendanceSummary(db, QUERY, secData, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n });\\n\\n app.post('/CreatePunchDatAttendance', function(req, res) {\\n var rawFile = req.files.user_file.path;\\n var password = createHash('ffljcl1234');\\n fs.readFile(rawFile, 'utf8', function(err, data) {\\n if (err) throw err;\\n var d = data.split(/[\\\\n]+/);\\n CreatePunchDatAttendance(db, d, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n });\\n });\\n });\\n\\n app.post('/CreateCSVAttendance', function(req, res) {\\n var rawFile = req.files.user_file.path;\\n var password = createHash('ffljcl1234');\\n fs.readFile(rawFile, 'utf8', function(err, data) {\\n if (err) throw err;\\n var d = data.split(/[\\\\n\\\\r]+/);\\n //var d = data.split(\\\"\\\\n\\\");\\n CreateCSVAttendance(db, d, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n });\\n });\\n });\\n\\n app.get('/getEmployeeDailyAttendance', /*isAuthenticated,*/ function(req, res) {\\n var QUERY = req.query;\\n QUERY.section = 1;\\n QUERY.date = new Date(Date.UTC(2017, 9, 22));\\n QUERY.status = [1, 2];\\n getEmployeeDailyAttendance(db, QUERY, function(d) {\\n res.setHeader('Content-Type', 'application/json');\\n res.send(d);\\n })\\n });\\n}\",\n \"static init(app) {\\n /* Initialize DB */\\n\\n MongoClient.connect(url, { useUnifiedTopology: true }, function (err, database) {\\n if (err) throw err;\\n console.log(\\\"Database created!\\\");\\n db = database.db('mydb')\\n });\\n\\n const router = express.Router();\\n\\n // Install bodyParser parameters\\n router.use(bodyParser.urlencoded({\\n extended: true\\n }));\\n router.use(bodyParser.json());\\n\\n app.use(bodyParser.urlencoded({ extended: true }))\\n app.use(bodyParser.json())\\n app.use(express.static('public'))\\n app.use('/user', router);\\n\\n // LIST All REST Endpoints \\n router.get('/getUsers', UserController.getAllUsers);\\n router.post('/user', UserController.addNewUser);\\n router.put('/user', UserController.updateUser);\\n router.delete('/user', UserController.deleteUser);\\n }\",\n \"initRoutes() {\\n this.app.get(\\n `${this.apiBasePath}/person/:personId/appearances`,\\n (req, res, next) => {\\n personController.getAppearances(req, res, next);\\n },\\n );\\n\\n this.app.get(\\n `${this.apiBasePath}/person/:personId/movies`,\\n (req, res, next) => {\\n personController.getMovieAppearances(req, res, next);\\n },\\n );\\n\\n this.app.get(\\n `${this.apiBasePath}/person/:personId/tv`,\\n (req, res, next) => {\\n personController.getTvAppearances(req, res, next);\\n },\\n );\\n }\",\n \"function route(app){\\n app.use('/data',dataRoute);\\n app.use('/', mainRoute);\\n}\",\n \"llamarRutasAPI(){\\n this.app.use('/', rutas);\\n }\",\n \"function randomNumber(req, res, next) {\\n req.randomNumber = Math.random();\\n next();\\n}\",\n \"routes() {\\n const publicPath = path.join(__dirname, '..', 'tmp', 'frontend', 'build');\\n this.server.use('/v1/api', routes);\\n this.server.use('/', express.static(publicPath));\\n this.server.use('/users/*', express.static(publicPath));\\n }\",\n \"function setup(app) {\\n app.get('/', function(req, res) {\\n res.render('index.html');\\n });\\n\\n app.post('/account', function(req, res) {\\n res.redirect('/success');\\n });\\n\\n app.get('/success', function(req, res) {\\n res.render('created.html');\\n });\\n\\n app.post('/join_alpha', function(req, res) {\\n if (req.body.email) {\\n db.storeAlphaEmail(req.body.email, function(err) {\\n res.render('joined.html');\\n });\\n } else {\\n res.redirect('/');\\n }\\n });\\n\\n app.get('/download', function(req, res) {\\n res.locals({\\n agent: 'chrome',\\n agentName: 'Chrome',\\n installUrl: 'https://chrome.google.com/webstore/detail/gombot-alpha/maeopofifamhhcdbejkfolecghncglll'\\n });\\n res.render('download.html');\\n });\\n\\n app.get('/downloads/latest', function(req, res) {\\n latest(function(err, sha) {\\n if (err) console.log(err);\\n res.redirect('/downloads/gombot-' + sha + '.crx');\\n });\\n });\\n\\n app.get('/downloads/updates.xml', function(req, res) {\\n latest(function(err, sha, ver) {\\n if (err) console.log(err);\\n res.locals({\\n sha: sha,\\n version: ver,\\n appid: appid\\n });\\n res.render('updates.xml');\\n });\\n });\\n}\",\n \"function index(req, res) {\\n \\n}\",\n \"function adminRoutes(){\\n\\t\\n\\t// url map to POST login details\\n\\tapp.post('/api/login/' ,passport.authenticate('local-login'),\\n\\t\\t function (req, res) {\\n\\t\\t res.json( {message: 'OK'} );\\n\\t\\t });\\n\\t\\n\\t// logging-out\\n\\tapp.get('/api/logout/', isLoggedIn,\\n\\t\\tfunction (req, res){\\n\\t\\t req.logout();\\n\\t\\t res.json({message : 'OK'});\\n\\t\\t});\\n\\t\\n\\t// url map to GET admin page(list of admins)\\n\\tapp.get('/api/admin/', isLoggedIn,\\n\\t\\tfunction (req, res) {\\n\\t\\t User.find(\\n\\t\\t\\tfunction (err, admins) {\\n\\t\\t\\t if (err)\\n\\t\\t\\t\\tres.send(err);\\n\\t\\t\\t\\t \\n\\t\\t\\t var adminList = {};\\n\\t\\t\\t for (var i in admins)\\n\\t\\t\\t\\tadminList[admins[i][\\\"id\\\"]] = admins[i][\\\"local\\\"][\\\"email\\\"]; \\n\\t\\t\\t\\t \\n\\t\\t\\t res.json(adminList);\\n\\t\\t\\t});\\t\\t \\n\\t\\t});\\n\\t// url map to add a new admin\\n\\tapp.post('/api/admin/',isLoggedIn,\\n\\t\\t passport.authenticate('local-signup'),\\n\\t\\t function (req, res) {\\n\\t\\t res.json( {message: 'OK'} );\\n\\t\\t });\\n\\t \\t\\t\\n\\t// url map to DELETE a admin\\n\\tapp.delete('/api/admin/:user_id', isLoggedIn,\\n\\t\\t function (req, res) {\\n\\t\\t User.remove({_id : req.params.user_id},\\n\\t\\t\\t\\t function (err, user) {\\n\\t\\t\\t\\t if (err)\\n\\t\\t\\t\\t\\t res.send(err);\\n\\t\\t\\t\\t res.json({message : 'OK'});\\n\\t\\t\\t\\t });\\n\\t\\t });\\n\\t\\n }\",\n \"initRoutes(app, ctx) {\\n app.get(\\\"/register\\\", async (req, res, ctx) => {\\n res.send(\\n await ctx.call(\\\"webhooks.register\\\", {\\n targetUrl: ctx.params.targetUrl,\\n })\\n );\\n });\\n app.get(\\\"/list\\\", async (req, res, ctx) => {\\n res.send(await ctx.call(\\\"webhooks.list\\\"));\\n });\\n app.get(\\\"/update\\\", async (req, res, ctx) => {\\n res.send(await ctx.call(\\\"webhooks.update\\\", { id: ctx.params.id }));\\n });\\n app.get(\\\"/delete\\\", async (req, res, ctx) => {\\n res.send(\\n await ctx.call(\\\"webhooks.delete\\\", {\\n id: ctx.params.id,\\n targetUrl: ctx.params.targetUrl,\\n })\\n );\\n });\\n app.get(\\\"/ip\\\", async (req, res, ctx) => {\\n res.send(\\n await ctx.call(\\\"webhooks.trigger\\\", {\\n ip:\\n req.headers[\\\"x-forwarded-for\\\"] ||\\n req.socket.remoteAddress ||\\n null,\\n })\\n );\\n });\\n // debug\\n app.get(\\\"/helloTest\\\", async (req, res, ctx) => {\\n res.send(await ctx.call(\\\"webhooks.hello\\\"));\\n });\\n app.get(\\\"/exptest\\\", (req, res) => {\\n res.send(\\\"express routing\\\");\\n });\\n }\",\n \"routing () {\\n const notConnected = this.app.session.notConnected.bind(this.app.session)\\n const connected = this.app.session.connected.bind(this.app.session)\\n const connectedOrBuilder = this.app.session.connectedOrBuilder.bind(this.app.session)\\n const admin = this.app.session.admin.bind(this.app.session)\\n\\n this.app.express.use('/api', express.Router()\\n .post('/auth/login', notConnected, this.app.action.auth.login.routes)\\n .post('/auth/forgot', notConnected, this.app.action.auth.forgotPassword.routes)\\n .put('/auth/reset', notConnected, this.app.action.auth.resetPassword.routes)\\n\\n .delete('/auth/logout', connected, this.app.action.auth.logout.routes)\\n\\n .use('/invite', express.Router()\\n .post('/', connected, admin, this.app.action.invitation.create.routes)\\n )\\n .use('/user', express.Router()\\n .post('/', notConnected, this.app.action.user.create.routes)\\n .get('/:id', connected, this.app.action.user.get.routes)\\n .get('/', connected, this.app.action.user.list.routes)\\n )\\n .use('/manifest', express.Router()\\n .post('/', connected, this.app.action.manifest.create.routes)\\n .put('/:id', connected, this.app.action.manifest.update.routes)\\n .put('/:id/maintainer', connected, admin, this.app.action.manifest.updateMaintainer.routes)\\n .get('/:id', connectedOrBuilder, this.app.action.manifest.get.routes)\\n .get('/', connected, this.app.action.manifest.list.routes)\\n )\\n .use('/build', express.Router()\\n .post('/', connected, this.app.action.build.create.routes)\\n .use('/:id', express.Router({ mergeParams: true })\\n .get('/', connected, this.app.action.build.get.routes)\\n\\n // Middleware to authorize only builder\\n .use('/', this.app.action.build.authorization.routes)\\n // Empty endpoint for a client to verify his access\\n .put('/', (req, res, next) => { res.json({}) })\\n .put('/start', this.app.action.build.start.routes)\\n .put('/stdout', this.app.action.build.stdout.routes)\\n .put('/stderr', this.app.action.build.stderr.routes)\\n .put('/end', this.app.action.build.end.routes)\\n .put('/packages', this.app.action.build.packages.routes)\\n )\\n .get('/', connected, this.app.action.build.list.routes)\\n )\\n )\\n\\n this.app.express.use(this.errorHandler.bind(this))\\n }\",\n \"_registerRoutes() {\\n this.app.get('/:guild/metrics', (req, res) => {\\n let guild = this.guilds.guilds[req.params.guild];\\n if (typeof guild !== 'undefined') {\\n guild.getMetrics((contentType, metrics) => {\\n res.set('Content-Type', contentType);\\n res.end(metrics);\\n });\\n } else {\\n res.send('Guild not found');\\n }\\n });\\n }\",\n \"function apps() { \\n\\t\\n\\tlet eapp1 = app.get('/', (req, res) => {\\n\\tfs.readFile('index.html', function(err, data) {\\n\\t\\tres.statusCode = 200\\n\\t\\tres.setHeader('Content-Type','text/html')\\n res.write(data);\\n\\t return res.end();\\n\\t});\\n});\\n\\n\\tlet eapp2 = app.get('/about', (req, res) => {\\n\\tfs.readFile('about.html', function(err, data) {\\n\\t\\tres.statusCode = 200\\n\\t\\tres.setHeader('Content-Type','text/html')\\n res.write(data);\\n\\t return res.end();\\n\\t});\\n});\\n\\n\\tlet eapp3 = app.get('/contact-me', (req, res) => {\\n\\tfs.readFile('contact-me.html', function(err, data) {\\n\\t\\tres.statusCode = 200\\n\\t\\tres.setHeader('Content-Type','text/html')\\n res.write(data);\\n\\t return res.end();\\n\\t});\\n};\\n\\n}\",\n \"viewRoute() {\\n\\n this.router.use(auth.isLoggedIn());\\n \\n this.router.get('/signup', signup);\\n this.router.get('/login', login);\\n this.router.get('/forgot-password', forgotPassword);\\n this.router.get('/reset-password', resetPassword);\\n this.router.get('/forgot-password/success', forgotPasswordSuccess);\\n this.router.get('/team', team);\\n this.router.get('/volunteer', volunteer);\\n this.router.get('/', home);\\n this.router.get('/about-us', about);\\n this.router.post('/', (req, res, next) => (req.page='home', next()), home);\\n\\n \\n this.router.get(\\n '/donor',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => res.redirect('/donor/dashboard')\\n );\\n \\n this.router\\n .get(\\n '/donor/dashboard',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'dashboard'), next()),\\n donorDashboard\\n );\\n \\n this.router\\n .get(\\n '/donor/donations',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'donations'), next()),\\n donorDashboard\\n );\\n \\n this.router\\n .get(\\n '/donor/donations/verify',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n verifyMonetaryDonation\\n )\\n \\n return this.router;\\n}\",\n \"function indexRoute(req, res) {\\n return res.json({\\n users: {\\n users: '/users',\\n user: '/users/{id}',\\n register: '/users/register',\\n login: '/users/login',\\n me: '/users/me',\\n newPin: '/program/{id}/add',\\n },\\n program: {\\n newProgram: '/program',\\n program: '/program/{id}/view',\\n exercises: '/program/{clientId}/view/{programId}',\\n },\\n exercise: {\\n exercise: '/program/{id}/add',\\n }\\n });\\n}\",\n \"function registerFunctionRoutes(app, userFunction, functionSignatureType) {\\n if (functionSignatureType === SignatureType.HTTP) {\\n app.use('/favicon.ico|/robots.txt', (req, res) => {\\n // Neither crawlers nor browsers attempting to pull the icon find the body\\n // contents particularly useful, so we send nothing in the response body.\\n res.status(404).send(null);\\n });\\n app.use('/*', (req, res, next) => {\\n onFinished(res, (err, res) => {\\n res.locals.functionExecutionFinished = true;\\n });\\n next();\\n });\\n app.all('/*', (req, res, next) => {\\n const handler = makeHttpHandler(userFunction);\\n handler(req, res, next);\\n });\\n }\\n else if (functionSignatureType === SignatureType.EVENT) {\\n app.post('/*', (req, res, next) => {\\n const wrappedUserFunction = wrapEventFunction(userFunction);\\n const handler = makeHttpHandler(wrappedUserFunction);\\n handler(req, res, next);\\n });\\n }\\n else {\\n app.post('/*', (req, res, next) => {\\n const wrappedUserFunction = wrapCloudEventFunction(userFunction);\\n const handler = makeHttpHandler(wrappedUserFunction);\\n handler(req, res, next);\\n });\\n }\\n}\",\n \"function oldStuff() {\\n // This container just lets me fold the code.\\n router.post('/users', function(req, res) {\\n models.User.create({\\n email: req.body.email\\n }).then(function(user) {\\n res.json(user);\\n });\\n });\\n\\n // get all todos\\n router.get('/todos', function(req, res) {\\n models.Todo.findAll({}).then(function(todos) {\\n res.json(todos);\\n });\\n });\\n\\n // get single todo\\n router.get('/todo/:id', function(req, res) {\\n models.Todo.find({\\n where: {\\n id: req.params.id\\n }\\n }).then(function(todo) {\\n res.json(todo);\\n });\\n });\\n\\n // add new todo\\n router.post('/todos', function(req, res) {\\n models.Todo.create({\\n title: req.body.title,\\n UserId: req.body.user_id\\n }).then(function(todo) {\\n res.json(todo);\\n });\\n });\\n\\n // update single todo\\n router.put('/todo/:id', function(req, res) {\\n models.Todo.find({\\n where: {\\n id: req.params.id\\n }\\n }).then(function(todo) {\\n if(todo){\\n todo.updateAttributes({\\n title: req.body.title,\\n complete: req.body.complete\\n }).then(function(todo) {\\n res.send(todo);\\n });\\n }\\n });\\n });\\n\\n // delete a single todo\\n router.delete('/todo/:id', function(req, res) {\\n models.Todo.destroy({\\n where: {\\n id: req.params.id\\n }\\n }).then(function(todo) {\\n res.json(todo);\\n });\\n });\\n}\",\n \"function makeApp(InjectedDB)\\n{\\n\\n const DB = InjectedDB;\\n\\n\\n const corsOptions = {\\n exposedHeaders: 'Authorization',\\n };\\n //----------------------middleware------------------------\\n app.use(cors(corsOptions));\\n app.use(express.urlencoded({extended: true}));\\n app.use(express.json());\\n app.use(express.static(path.join(__dirname, 'public')));\\n\\n\\n //-------make the routes with passed in DB ----------//\\n const UserRoute = makeUserRoute(DB);\\n const TaskRoute = makeTaskRoute(DB);\\n const ProjectRoute = makeProjectRoute(DB);\\n //const NodeRoute = makeNodeRoute(DB);\\n //const GraphRoute = makeGraphRoute(DB);\\n\\n //----------- router setup ------------------------//\\n app.use('/project', ProjectRoute);\\n app.use('/user', UserRoute);\\n //app.use('/node', NodeRoute);\\n app.use('/task', TaskRoute);\\n //app.use('/graph',GraphRoute);\\n\\n //default /GET\\n app.use('/', Home);\\n //Handling Errors?\\n app.use((req, res, next) => {\\n const newError = new Error(`Not found. ${req.url}`);\\n newError.status = 404;\\n next(newError);\\n\\n });\\n\\n //Serve Error\\n app.use((error, req, res, next) => {\\n res.status(error.status || 500);\\n res.json({\\n error: error.message,\\n type: error.type,\\n loc: error.prototype,\\n stack: error.stack,\\n url: req.url\\n\\n });\\n });\\n\\n return app;\\n\\n\\n}\",\n \"routes() {\\n // this.app.use( this.paths.auth, require('../routes/auth'));\\n }\",\n \"viewRoute() {\\n\\n this.router.use(auth.isLoggedIn());\\n \\n this.router.get('/signup', auth.isLoggedIn(true), signup);\\n this.router.get('/login', auth.isLoggedIn(true), login);\\n this.router.get('/forgot-password', forgotPassword);\\n this.router.get('/reset-password', resetPassword);\\n this.router.get('/forgot-password/success', forgotPasswordSuccess);\\n this.router.get('/team', team);\\n this.router.get('/volunteer', volunteer);\\n this.router.get('/', home);\\n this.router.get('/about-us', about);\\n this.router.post('/', (req, res, next) => (req.page='home', next()), home);\\n\\n // Donor routes\\n this.router.get(\\n '/donor',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => res.redirect('/donor/dashboard')\\n );\\n \\n this.router.get(\\n '/donor/dashboard',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'dashboard'), next()),\\n donorDashboard\\n );\\n \\n this.router.get(\\n '/donor/donations',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'donations'), next()),\\n donorDashboard\\n );\\n\\n this.router.get(\\n '/donor/donations/new',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'new-food-donation'), next()),\\n donorDashboard\\n );\\n \\n this.router.get(\\n '/donor/donations/verify',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n verifyMonetaryDonation\\n );\\n \\n this.router.get(\\n '/donor/live-chat',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'live-chat'), next()),\\n donorDashboard\\n );\\n \\n this.router.get(\\n '/donor/edit-account',\\n auth.authenticateApp(),\\n auth.authorizeApp('donor'),\\n (req, res, next) => ((req.page = 'edit-account'), next()),\\n donorDashboard\\n );\\n \\n // Admin routes\\n this.router.get(\\n '/admin',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => res.redirect('/admin/dashboard')\\n );\\n\\n this.router.get(\\n '/admin/dashboard',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'dashboard'), next()),\\n adminDashboard\\n );\\n\\n this.router.get(\\n '/admin/donations',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'donations'), next()),\\n adminDashboard\\n );\\n\\n this.router.get(\\n '/admin/donation-stations',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'donation-stations'), next()),\\n adminDashboard\\n );\\n\\n this.router.get(\\n '/admin/live-chat',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'live-chat'), next()),\\n adminDashboard\\n );\\n\\n this.router.get(\\n '/admin/users',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'users'), next()),\\n adminDashboard\\n );\\n\\n this.router.get(\\n '/admin/users/edit/:id',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'user-edit'), next()),\\n adminDashboard\\n );\\n \\n this.router.get(\\n '/admin/users/new',\\n auth.authenticateApp(),\\n auth.authorizeApp('admin'),\\n (req, res, next) => ((req.page = 'user-new'), next()),\\n adminDashboard\\n );\\n \\n return this.router;\\n}\",\n \"setupRoutes() {\\n let expressRouter = express.Router();\\n\\n for (let route of this.router) {\\n let methods;\\n let middleware;\\n if (typeof route[1] === 'string') {\\n methods = route[1].toLowerCase().split(',');\\n middleware = route.slice(2);\\n } else {\\n methods = ['get'];\\n middleware = route.slice(1);\\n }\\n for (let method of methods) {\\n expressRouter[method.trim()](route[0], middleware.map(this.errorWrapper));\\n }\\n }\\n this.app.use(this.config.mountPoint, expressRouter);\\n }\",\n \"function generalRoutes(){\\t\\n\\t\\n\\t// default GET\\n\\tapp.get('*',\\n\\t\\tfunction (req, res) {\\n\\t\\t res.sendfile('./public/index.html');\\n\\t\\t});\\n \\n }\",\n \"function registerFunctionRoutes(app, userFunction, functionSignatureType) {\\n if (isHttpFunction(userFunction, functionSignatureType)) {\\n app.use('/*', (req, res, next) => {\\n onFinished(res, (err, res) => {\\n res.locals.functionExecutionFinished = true;\\n });\\n next();\\n });\\n app.all('/*', (req, res, next) => {\\n const handler = makeHttpHandler(userFunction);\\n handler(req, res, next);\\n });\\n }\\n else {\\n app.post('/*', (req, res, next) => {\\n const wrappedUserFunction = wrapEventFunction(userFunction);\\n const handler = makeHttpHandler(wrappedUserFunction);\\n handler(req, res, next);\\n });\\n }\\n}\",\n \"async index(req, res) {\\n // Verificar se o usuario logado é prestador de serviço\\n const checkUserProvider = await User.findOne({\\n where: { id: req.userId, provider: true },\\n });\\n // Retorno de mensagem de erro\\n if (!checkUserProvider) {\\n return res.status(401).json({ error: 'User is not a provider' });\\n }\\n // Buscar date\\n const { date } = req.query;\\n //\\n const parsedDate = parseISO(date);\\n // Criar variavel appointments que vai listar todos os agendamentos\\n const appointments = await Appointment.findAll({\\n // Verificar agendamento do usuario logado\\n where: {\\n provider_id: req.userId,\\n canceled_at: null,\\n // Verificar agendamentos entre dois horarios na data inserida\\n date: {\\n [Op.between]: [startOfDay(parsedDate), endOfDay(parsedDate)],\\n },\\n },\\n // Ordenar agendamentos por data\\n order: ['date'],\\n });\\n // Criar retorno com json (só para não dar erro, e poder criar a rota)\\n return res.json({ appointments });\\n }\",\n \"function getUserEndpoints() {\\n return function (req, res) {\\n res.send({\\n GetUserByID: \\\"/users/id/:userid\\\",\\n GetUserCourses: \\\"/users/id/:userid/courses\\\",\\n GetAllUsers: \\\"/users/all\\\",\\n GetAllUsersByUni: \\\"/users/all/:university\\\",\\n });\\n };\\n}\",\n \"function UserRoutes(userService) {\\n const router = express.Router();\\n\\n router.get('/me', async (req, res) => {\\n // This returns the OAuth user info\\n const { _raw, _json, ...userProfile } = req.user;\\n const userProfileResponse = userProfileToUserProfileResponse(\\n userProfile,\\n userProfile.userType === UserTypes.ADMIN\\n );\\n\\n console.log('Getting info for user profile', userProfile);\\n // TODO this is literally only the first email in emails\\n const allPossibleUsers = await Promise.all(\\n req.user.emails.map((emailValue) => userService.getUser(emailValue.value))\\n );\\n const userResponse = userToUserResponse(\\n allPossibleUsers.filter((user) => user)[0]\\n );\\n return res.status(200).json({\\n ...userProfileResponse,\\n ...userResponse,\\n });\\n });\\n\\n router.get('/', requireAdmin, async (req, res) => {\\n console.log('listing all users');\\n const allUsers = await userService.listUsers();\\n console.log(allUsers);\\n return res\\n .status(200)\\n .json(allUsers.map((user) => userToUserResponse(user)));\\n });\\n\\n router.get('/:userEmail', requireAdmin, async (req, res) => {\\n const user = await userService.getUser(req.params.userEmail);\\n res.status(200).json(userToUserResponse(user));\\n });\\n\\n router.post('/', parseUserRequestBody, requireAdmin, async (req, res) => {\\n const user = req.body;\\n try {\\n const savedUser = await userService.createUser(user);\\n console.log('created user', user);\\n return res.status(200).json(userToUserResponse(savedUser, true));\\n } catch (e) {\\n // TODO do this smarter\\n if (e.message.startsWith('Validation Error:')) {\\n return res.status(400).send(e.message);\\n }\\n return res.status(500);\\n }\\n });\\n\\n router.put(\\n '/:userEmail',\\n parseUserRequestBody,\\n requireAdmin,\\n async (req, res) => {\\n const user = req.body;\\n const savedUser = await userService.updateUser(\\n req.params.userEmail,\\n user\\n );\\n res.status(200).json(userToUserResponse(savedUser));\\n }\\n );\\n\\n router.delete('/:userEmail', requireAdmin, async (req, res) => {\\n await userService.deleteUser(req.params.userEmail);\\n res.status(200).send();\\n });\\n return router;\\n}\",\n \"function controller(app) {\\n\\n app.get(\\\"/homepage\\\", function (req, res) {\\n if (!req.user) {\\n // The user is not logged in, send back an empty object\\n res.render(\\\"login\\\", {})\\n } else {\\n // Otherwise send back the user's email and id\\n // Sending back a password, even a hashed password, isn't a good idea\\n res.render(\\\"homepage\\\", {})\\n };\\n \\n });\\n\\n app.get(\\\"/api/discussion\\\", function (req, res) {\\n console.log(\\\"hello world 2\\\")\\n res.render(\\\"discussion\\\", {})\\n });\\n\\n app.get(\\\"/api/results\\\", function (req, res) {\\n console.log(\\\"hello world\\\")\\n res.render(\\\"results\\\", {})\\n });\\n\\n app.get(\\\"/api/anis\\\", function (req, res) {\\n res.render(\\\"homepage\\\");\\n });\\n\\n app.post(\\\"/api/anis\\\", function (req, res) {\\n db.User.create({ username: req.body.usrname, password: req.body.psw}).then((result)=>{\\n console.log(result.dataValues.username)\\n var obj = {\\n username: result.dataValues.username.toUpperCase(),\\n password: result.dataValues.password\\n };\\n res.render(\\\"homepage\\\", obj)\\n });\\n });\\n\\n app.get(\\\"/api/all\\\", function(req, res) {\\n\\n // Finding all Chirps, and then returning them to the user as JSON.\\n // Sequelize queries are asynchronous, which helps with perceived speed.\\n // If we want something to be guaranteed to happen after the query, we'll use\\n // the .then function\\n db.Post.findAll({}).then(function(results) {\\n // results are available to us inside the .then\\n res.json(results);\\n });\\n\\n });\\n\\n // Add a chirp\\n app.post(\\\"/api/new\\\", function(req, res) {\\n\\n console.log(\\\"Post Data:\\\");\\n console.log(req.body);\\n\\n db.Post.create({\\n author: req.body.author,\\n body: req.body.body,\\n }).then(function(results) {\\n // `results` here would be the newly created chirp\\n res.end();\\n });\\n\\n });\\n\\n}\",\n \"async function routes(fastify, options) {\\n\\tfastify.get('/', async (request, reply) => {\\n\\t\\treturn { name: 'Hydrant API', version: process.env.npm_package_version, routes: 'api' }\\n\\t})\\n\\n\\tfastify.get('/measurement', (request, reply) => {\\n\\t\\tconst $top = request.query.top;\\n\\t\\tif ($top)\\n\\t\\t\\tdb.all('SELECT * FROM Measurements LIMIT $top', { $top }, (err, rows) => {\\n\\t\\t\\t\\treply.send(rows);\\n\\t\\t\\t});\\n\\t\\telse\\n\\t\\t\\tdb.all('SELECT * FROM Measurements', (err, rows) => {\\n\\t\\t\\t\\treply.send(rows);\\n\\t\\t\\t})\\n\\t});\\n}\",\n \"function apiRoutes(app) {\\n app.get(\\\"/api/friends\\\", function (req, res) {\\n return res.json(friends);\\n });\\n\\n app.post(\\\"/api/friends\\\", function (req, res) {\\n // Get the info from newFriend\\n var newFriend = req.body;\\n\\n // Compare the newFriend's scores to all of the other scores in the friends array\\n var scoreDiffs = [];\\n\\n for (var i = 0; i < friends.length; i++) {\\n\\n var diff = 0;\\n\\n for (var j = 0; j < friends[i].scores.length; j++) {\\n diff += Math.abs(friends[i].scores[j] - parseInt(newFriend.scores[j]));\\n }\\n\\n scoreDiffs.push(diff);\\n };\\n\\n // Whoever's scoreDiff is the lowest is the user's match\\n var matchIndex = scoreDiffs.indexOf(Math.min(...scoreDiffs));\\n\\n var match = friends[matchIndex];\\n\\n // Add newFriend to the friends array\\n friends.push(newFriend);\\n\\n // Send the match's info back to survey.html\\n return res.json(match);\\n });\\n}\",\n \"function getRandQuestions(req, res, next){\\r\\n\\tQuestion.getRandomQuestions(function(err, results){\\r\\n\\t\\tif(err) throw err;\\r\\n\\t\\tres.status(200).render(\\\"pages/quiz\\\", {questions: results , id:req.session.userId});\\r\\n\\t\\treturn;\\r\\n\\t});\\r\\n}\",\n \"function main() {\\n const app = express();\\n const port = process.env.PORT || 5000;\\n\\n // var http = require('http').createServer(app);\\n // var io = require('socket.io')(http);\\n\\n // app.use(cors({\\n // origin: ['http://localhost:3000'],\\n // methods: ['GET', 'POST', 'DELETE', 'PUT'],\\n // credentials: true // enable set cookie\\n // }));\\n // app.use(cors())\\n app.use(express.json());\\n\\n\\n app.get('/admin', (req, res) => {\\n const user =\\n {\\n name: 'Aniket Sharma',\\n username: 'Draqula',\\n email: 'draqulainc@gmail.com'\\n }\\n\\n res.json(user)\\n })\\n\\n // const uri = process.env.ATLAS_URI;\\n // mongoose.connect(uri, { useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true }\\n // );\\n // const connection = mongoose.connection;\\n // connection.once('open', () => {\\n // console.log(\\\"MongoDB database connection established successfully\\\");\\n // })\\n\\n // app.use('/users', Users);\\n // const Todo = require('./routes/todoList.js');\\n // app.use('/Todo', Todo);\\n\\n app.use(express.static(\\\"client/build\\\"));\\n app.get(\\\"*\\\", (req, res) => {\\n res.sendFile(path.resolve(__dirname, \\\"client\\\", \\\"build\\\", \\\"index.html\\\"));\\n });\\n app.listen(port, () => {\\n console.log(`Server is running on port: ${port}`);\\n });\\n}\",\n \"function loadAppRoutes(app){\\n\\t//To support JSON-encoded bodies\\n\\tapp.use(bodyParser.json());\\n\\n\\t//To support URL-encoded bodies\\n\\t//app.use(bodyParser.urlencoded({extended:true}));\\n\\n\\t//Load routes which require no authorization (publicly available)\\n\\tapp.use(\\\"/public\\\", publicRoutes);\\n\\n\\t//Load routes which require authorization (secured access)\\n\\tapp.use(\\\"/secure\\\", securedRoutes);\\n\\n\\t//TEST route for checking successful deployment\\n\\tapp.get(\\\"/\\\", function(req,res){\\n\\t\\tres.send(\\\"Hello! You have reached the index.\\\");\\n\\t});\\n}\",\n \"includeRoutes(app) {\\n\\t\\tapp.get(\\\"/\\\", function (req, res) {\\n\\t\\t\\tres.sendFile(__dirname + '/client/index.html');\\n\\t\\t});\\n\\t\\t\\n\\t\\tapp.post(\\\"/getSuggestion\\\", function (request, response) {\\n\\t\\t\\t// Variable for server response\\n\\t\\t\\tlet responseCollection = [];\\n\\n\\t\\t\\t//Storing the user entered string into variable\\n\\t\\t\\tlet getSuggestionString = request.body.suggestion;\\n\\n /*\\n * Creating an object of the levenshtein-distance node module by passing the collection of words\\n */\\n\\t\\t\\tlet collection = new levenshteinDistance(wordCollection);\\n\\n /*\\n * Calling the find() method on the object of the levenshtein-distance node module\\n * Storing the response inside the responseCollection variable\\n */\\n\\n\\t\\t\\tcollection.find(getSuggestionString, function (result) {\\n\\t\\t\\t\\tresponseCollection.push(result);\\n\\t\\t\\t});\\n\\t\\t\\tresponse.status(200).json(responseCollection);\\n\\t \\t});\\n\\t}\",\n \"function main() {\\n\\t\\n\\tdbconnection();\\n var app = express(); // Export app for other routes to use\\n \\n var port = process.env.PORT || 8000;\\n app.use(bodyParser.urlencoded({\\n extended: true\\n }));\\n app.use(bodyParser.json());\\n // Routes & Handlers\\n app.post('/login', Auth);\\n\\tapp.get('/getCategory/',middleware.checkToken,Category);\\n\\tapp.get('/deleteCategory/:id',middleware.checkToken,Category);\\n\\tapp.get('/getParentcategory/:id',middleware.checkToken,Category);\\n\\tapp.post('/addCategory',middleware.checkToken,Category);\\n\\t\\n\\n app.listen(port, function () { return console.log(\\\"Server is listening on port: \\\" + port); });\\n}\",\n \"async load() {\\n // setup API routes\\n // eslint-disable-next-line\\n this.routes = express.Router({\\n caseSensitive: false,\\n });\\n\\n // user Routes\\n this.routes.route('/test')\\n .get((req, res) => {\\n res.send({hello: 'world'});\\n });\\n\\n // route requiring authentication\\n this.routes.route('/test')\\n .get(this.server.auth.middleware, (req, res) => {\\n res.send({hello: req.user});\\n });\\n\\n // register the routes to the /api prefix and version\\n this.server.app.use(this.urlPrefix, this.routes);\\n }\",\n \"api () {\\r\\n const router = new Router()\\r\\n // READ\\r\\n router.get('/',\\r\\n (req, res) => {\\r\\n this\\r\\n .getAll(req.query)\\r\\n .then(this.ok(res))\\r\\n .then(null, this.fail(res))\\r\\n })\\r\\n router.get('/:key',\\r\\n (req, res) => {\\r\\n this\\r\\n .get(req.params.key, req.query)\\r\\n .then(this.ok(res))\\r\\n .then(null, this.fail(res))\\r\\n })\\r\\n // CREATE\\r\\n router.post('/',\\r\\n this.requiretmobileid,\\r\\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'POST'),\\r\\n (req, res) => {\\r\\n this\\r\\n .post(req.body, req.query)\\r\\n .then(this.ok(res))\\r\\n .then(null, this.fail(res))\\r\\n })\\r\\n // UPDATE\\r\\n router.patch('/:key',\\r\\n this.requiretmobileid,\\r\\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'PATCH'),\\r\\n (req, res) => {\\r\\n this\\r\\n .patch(req.params.key, req.body, req.query) // query?\\r\\n .then(this.ok(res))\\r\\n .then(null, this.fail(res))\\r\\n })\\r\\n // DELETE\\r\\n router.delete('/:key',\\r\\n this.requiretmobileid,\\r\\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'DELETE'),\\r\\n (req, res) => {\\r\\n this\\r\\n .delete(req.params.key, req.query)\\r\\n .then(this.ok(res))\\r\\n .then(null, this.fail(res))\\r\\n })\\r\\n\\r\\n return router\\r\\n }\",\n \"createRoutes() {\\n this.routes['/asciimo'] = (req, res) => {\\n var link = \\\"http://i.imgur.com/kmbjB.png\\\";\\n res.send(\\\"\\\");\\n };\\n }\",\n \"initializeRoutes()\\n {\\n // Dynamic pages\\n this.express.get(\\\"/\\\", function(_request, _response){\\n _response.render(\\\"index/index.njk\\\");\\n });\\n\\n // Static paths\\n this.express.use(\\\"/css\\\", express.static(__dirname + \\\"/../frontend/css\\\"));\\n this.express.use(\\\"/javascript\\\", express.static(__dirname + \\\"/../frontend/javascript\\\"));\\n\\n // External libraries\\n this.express.use(\\\"/bootstrap\\\", express.static(__dirname + \\\"/../../node_modules/bootstrap/dist\\\"));\\n this.express.use(\\\"/bootstrap-table\\\", express.static(__dirname + \\\"/../../node_modules/bootstrap-table/dist\\\"));\\n this.express.use(\\\"/deep-eql\\\", express.static(__dirname + \\\"/../../node_modules/deep-eql\\\"));\\n this.express.use(\\\"/flatpickr\\\", express.static(__dirname + \\\"/../../node_modules/flatpickr/dist\\\"));\\n this.express.use(\\\"/font-awesome\\\", express.static(__dirname + \\\"/../../node_modules/@fortawesome/fontawesome-free\\\"));\\n this.express.use(\\\"/jspdf\\\", express.static(__dirname + \\\"/../../node_modules/jspdf/dist\\\"));\\n this.express.use(\\\"/jspdf-autotable\\\", express.static(__dirname + \\\"/../../node_modules/jspdf-autotable/dist\\\"));\\n this.express.use(\\\"/native-toast\\\", express.static(__dirname + \\\"/../../node_modules/native-toast/dist\\\"));\\n this.express.use(\\\"/jquery\\\", express.static(__dirname + \\\"/../../node_modules/jquery/dist\\\"));\\n this.express.use(\\\"/jquery-ui\\\", express.static(__dirname + \\\"/../../node_modules/jquery-ui-dist\\\"));\\n this.express.use(\\\"/popper-js\\\", express.static(__dirname + \\\"/../../node_modules/popper.js/dist/umd\\\"));\\n this.express.use(\\\"/select2\\\", express.static(__dirname + \\\"/../../node_modules/select2/dist\\\"));\\n\\n this.initializeQueryResponses();\\n this.express.post(\\\"/createOrder\\\", this.createOrderResponse.bind(this));\\n }\",\n \"function setupRoutes(app){\\n const APP_DIR = `${__dirname}/app`\\n const features = fs.readdirSync(APP_DIR).filter(\\n file => fs.statSync(`${APP_DIR}/${file}`).isDirectory()\\n )\\n\\n features.forEach(feature => {\\n const router = express.Router()\\n const routes = require(`${APP_DIR}/${feature}/routes.js`)\\n\\n routes.setup(router)\\n app.use(`/${feature}`, router)\\n })\\n}\",\n \"function route(endpoint){\\n app.get(`/${endpoint}`, (req, res)=>{\\n if (endpoint !== \\\"\\\") {\\n sqlDB.connect(config, ()=>{\\n const request = new sqlDB.Request();\\n request.query(`SELECT * FROM ${endpoint}`, (err, result)=>{\\n if (err) console.log(err);\\n res.send(result.recordset);\\n });\\n })\\n }\\n else res.send(\\\"Hello, you have reached contacts-api. Please navigate to /contacts, /categories, or /companies to continue.\\\");\\n })\\n}\",\n \"function router(app) {\\n const path = require('path')\\n public = path.join(__dirname, \\\"../public\\\")\\n\\n // Get index\\n app.get(\\\"/\\\", async function (req, res) {\\n console.log('[GET /] Getting index')\\n res.sendFile('./index.html', { root: public })\\n })\\n\\n // Get exercise\\n app.get(\\\"/exercise\\\", async function (req, res) {\\n console.log('[GET /exercise] Getting exercise')\\n res.sendFile('./exercise.html', { root: public })\\n })\\n\\n // Get stats\\n app.get(\\\"/stats\\\", async function (req, res) {\\n console.log('[GET /stats] Getting stats')\\n res.sendFile('./stats.html', { root: public })\\n })\\n\\n // *** API routes ***\\n // Get workouts\\n app.get(\\\"/api/workouts\\\", async function (req, res) {\\n console.log('[GET /api/workouts] Getting workouts')\\n Workout.find({})\\n .sort({ date: -1 })\\n .then(dbWorkout => { res.json(dbWorkout) })\\n .catch(err => { res.status(400).json(err) })\\n })\\n\\n // Post workouts\\n app.post(\\\"/api/workouts\\\", async function ({ body }, res) {\\n console.log('POST api/workouts: ', body)\\n Workout.create(body)\\n .then(data => {\\n console.log(`Adding workout`)\\n res.json(data)\\n })\\n .catch(err => {\\n console.log(\\\"Error occured during insert: \\\", err)\\n res.json(err)\\n })\\n })\\n\\n // Put workout\\n app.put(\\\"/api/workouts/:id\\\", async function ({ body, params }, res) {\\n console.log(`[PUT /api/workouts/${params.id}] Adding exercise`)\\n Workout.findByIdAndUpdate(\\n params.id,\\n // push the body to exercises and set the totalDuration\\n { $push: { exercises: body }, $inc: { totalDuration: body.duration } },\\n { new: true, runValidators: true }\\n )\\n .then(data => {\\n res.json(data)\\n console.log(`Adding ${params.id} ${data}`)\\n })\\n .catch(err => {\\n console.log(\\\"Error occured during insert: \\\", err)\\n res.json(err)\\n })\\n })\\n\\n app.get(\\\"/api/workouts/range\\\", async function (req, res) {\\n console.log('[GET /api/workouts/range]')\\n Workout.find({})\\n .then(dbWorkout => { res.json(dbWorkout) })\\n .catch(err => { res.status(400).json(err) })\\n })\\n\\n}\",\n \"function createRoutes (router) {\\n router\\n .get('/', (_, response) => {\\n response.end('')\\n })\\n .get('/user/:id', (request, response) => {\\n response.end(request.params.id)\\n })\\n .post('/user', (request, response) => {\\n response.end('')\\n })\\n}\",\n \"function router(nav) {\\n authRoutes.route('/signin')\\n .post(passport.authenticate('local', {\\n successRedirect: '/auth/profile',\\n failureRedirect: '/auth/signin'\\n }))\\n .get((req, res) => {\\n // al hacer el render hay que decirle la carpeta porque en index solo le decimos que los archivos estáticos están en views, pero ahora hemos creado una carpeta dentro auth\\n res.render('auth/signin', { nav }) // res.send('GET signup works') --> solo para que pinte sin mandar a un ejs // { nav } para que en el ejs salga pintada la importación del header - enviamos el arrary de los links del nav, que lo hemos pasado por le index invocado, para que llegue como parámetro a la función. A render le pasamos un obj con la propiedad nav (del array de los links). render() como segundo argumento siempre recibe un onjeto.\\n })\\n\\n // .post((req, res) => {\\n // res.send('hi')\\n // }\\n // );\\n\\n // res.json(req.body); // para ver el contenido del body, que será un objeto con los datos introducidos\\n \\n\\n authRoutes\\n .route('/signup')\\n .get((req, res) => {\\n res.render('auth/signup', { nav }) \\n })\\n .post((req, res) => {\\n const newUser = { ...req.body, user: req.body.user.toLowerCase() }; // lo metemos en una const con nombre sin destructurar { user, email, password } - de esta manera nos da mucha más información porque no le decimos que queremos el user, etc.\\n // res.json(req.body); // queremos obtener el objeto que nos devuelve - Hay una propiedad ops\\n // metemos destructuring assignment para añadir esa propiedad y que no distinga entre un email escrito en mayúsculas o minúsculas ----> email: req.body.email.toLowerCase()\\n \\n (async function mongo(){\\n try {\\n client = await MongoClient.connect(dbUrl)\\n const db = client.db(dbName);\\n const collection = db.collection(collectionName);\\n\\n // buscar si el usuario existe en la db\\n // para el findOne necesitamos un filtro y un callback para ese filtro\\n // el email del objeto es el nombre que tiene el input en el ejs\\n const user = await collection.findOne({ user: newUser.user }); // buscamos en la db\\n\\n if(user) { // user o email\\n // Si el email de usuario existe, redirecciono a signin\\n res.redirect('/auth/signin'); // si aquí meto un render() pintará en esa misma dirección el signin \\n } else {\\n const result = await collection.insertOne(newUser); // si no está te envío al profile\\n req.login(result.ops[0], () => {\\n res.redirect('/auth/profile')\\n })\\n }\\n\\n } catch (error) {\\n debug(error.stack);\\n }\\n \\n client.close(); \\n }());\\n });\\n\\n\\n authRoutes\\n .route('/profile')\\n .all((req, res, next) => {\\n // si no es ni 0, ni falso, ni undefined, ni null, ni cadena vacía\\n // hay usuario, continúo, next()\\n if(req.user) {\\n next();\\n } else {\\n res.redirect('/auth/signin');\\n }\\n })\\n .get((req, res) => {\\n res.render('/auth/profile', { nav, user: req.user });\\n })\\n .post((req, res) => {\\n res.send('POST profile')\\n })\\n\\n \\n \\n return authRoutes;\\n}\",\n \"function userMoviesApi(app) {\\n \\n /** Crea el router */\\n const router = express.Router();\\n /** Crea la ruta y adjunta el router que vamos a terminar de declarar */\\n app.use('/api/user-movies', router);\\n /** Crea una instancia de los servicios, que contiene los metodos de mongo */\\n const userMovieService = new UserMovieService();\\n\\n /** Get all from this user */\\n router.get(\\n '/',\\n validationHandler({ userId: userIdSchema }, 'query'),\\n async (req, res, next) => {\\n const { userId } = req.query;\\n try {\\n const userMovies = await userMovieService.getUserMovies({ \\n userId, \\n });\\n res.status(200).json({\\n data: userMovies,\\n message: 'user movies list',\\n })\\n } catch (error) {\\n next(error);\\n }\\n }\\n )\\n\\n /** Create one for this user */\\n router.post(\\n '/',\\n validationHandler(createUserMovieSchema),\\n async (req, res, next) => {\\n const { body: userMovie } = req;\\n\\n try {\\n const createUserMovieId = await userMovieService.createUserMovie({\\n userMovie,\\n })\\n res.status(200).json({\\n data: createUserMovieId,\\n message: 'user-movie',\\n })\\n } catch (error) {\\n next(error);\\n }\\n }\\n )\\n\\n /** Delete one for this user */\\n\\n router.delete(\\n '/:userMovieId',\\n validationHandler({ userMovieId: movieIdSchema}, 'params'),\\n async (req, res, next) => {\\n const { userMovieId } = req.params;\\n\\n try {\\n const deleteUserMovieId = await userMovieService.deleteUserMovie({\\n userMovieId\\n });\\n res.status(200).json({\\n data: deleteUserMovieId,\\n message: 'user-movie deleted'\\n })\\n } catch (error) {\\n next(error)\\n }\\n }\\n )\\n\\n}\",\n \"function setupServer() {\\r\\n //\\r\\n // Middleware's\\r\\n //\\r\\n\\r\\n // Use HTTP sessions\\r\\n let session = require('express-session')({\\r\\n secret: 'session_secret_key',\\r\\n resave: true,\\r\\n saveUninitialized: false\\r\\n });\\r\\n app.use(session);\\r\\n\\r\\n // Use Socket IO sessions\\r\\n let sharedSession = require(\\\"express-socket.io-session\\\")(session, {autoSave: true});\\r\\n io.use(sharedSession);\\r\\n\\r\\n // Parse the body of the incoming requests\\r\\n let bodyParser = require('body-parser');\\r\\n app.use(bodyParser.json());\\r\\n app.use(bodyParser.urlencoded({extended: false}));\\r\\n\\r\\n // Set static path to provide required assets\\r\\n let path = require('path');\\r\\n app.use(express.static(path.resolve('../client/')));\\r\\n\\r\\n //\\r\\n // Routes\\r\\n //\\r\\n\\r\\n // Authentication view endpoint\\r\\n app.get('/', function (req, res) {\\r\\n if (req.session.user) {\\r\\n res.sendFile(path.resolve('../client/views/profile.html'));\\r\\n }\\r\\n else {\\r\\n res.sendFile(path.resolve('../client/views/auth.html'));\\r\\n }\\r\\n });\\r\\n\\r\\n // Main game screen\\r\\n app.get('/play', function (req, res) {\\r\\n req.session.name = req.session.name || \\\"\\\";\\r\\n\\r\\n res.sendFile(path.resolve('../client/views/index.html'));\\r\\n });\\r\\n\\r\\n // Join endpoint\\r\\n app.post('/join', function (req, res) {\\r\\n req.session.name = (req.session.user ? req.session.user.username : req.body.name) || \\\"\\\";\\r\\n res.json({status: 0});\\r\\n });\\r\\n\\r\\n // Register endpoint\\r\\n app.post('/register', function (req, res) {\\r\\n let username = req.body.username;\\r\\n let password = req.body.password;\\r\\n\\r\\n if (!username || !password) {\\r\\n return res.json({status: 1, error_msg: \\\"Invalid register request\\\"});\\r\\n }\\r\\n\\r\\n let userData = {\\r\\n username: username,\\r\\n password: password,\\r\\n highScore: 10\\r\\n };\\r\\n\\r\\n // Try registering the user\\r\\n User.create(userData, function (error, user) {\\r\\n if (error || !user) {\\r\\n res.json({status: 1, error_msg: \\\"The username already exists\\\"});\\r\\n console.log(\\\"error in registering\\\", error);\\r\\n }\\r\\n else {\\r\\n req.session.user = user;\\r\\n req.session.name = user.username;\\r\\n res.json({status: 0});\\r\\n console.log(user.username, \\\"has registered...\\\");\\r\\n }\\r\\n });\\r\\n });\\r\\n\\r\\n // Log in post request endpoint\\r\\n app.post('/login', function (req, res) {\\r\\n let username = req.body.username;\\r\\n let password = req.body.password;\\r\\n\\r\\n if (!username || !password) {\\r\\n return res.json({status: 1, error_msg: \\\"Invalid login request\\\"});\\r\\n }\\r\\n\\r\\n // Authenticate user's credentials\\r\\n User.authenticate(username, password, function (error, user) {\\r\\n if (error) {\\r\\n res.json({status: 1, error_msg: error.message});\\r\\n console.log(\\\"error in logging in\\\", error);\\r\\n }\\r\\n else {\\r\\n req.session.user = user;\\r\\n req.session.name = user.username;\\r\\n res.json({status: 0});\\r\\n console.log(user.username, \\\"has logged in...\\\");\\r\\n }\\r\\n });\\r\\n });\\r\\n\\r\\n // Log out endpoint\\r\\n app.get('/logout', function (req, res) {\\r\\n // Destroy session object\\r\\n if (req.session) {\\r\\n let username = req.session.user;\\r\\n\\r\\n req.session.destroy(function (err) {\\r\\n if (err) {\\r\\n res.json({status: 1, error_msg: \\\"Please try again later!\\\"});\\r\\n console.log(\\\"error in logging out\\\", error);\\r\\n }\\r\\n else {\\r\\n res.json({status: 0});\\r\\n console.log(username, \\\"has logged out...\\\");\\r\\n }\\r\\n });\\r\\n }\\r\\n });\\r\\n}\",\n \"function createUsers(req, res) {\\n\\n}\",\n \"async function index(req, res) {}\",\n \"function movieApi(app){\\n const router = express.Router();\\n app.use('/api/movies', router);\\n\\n const moviesService = new MoviesService()\\n\\n router.get('/', async function(req,res,next){\\n const { tags } = req.query;\\n try{\\n const movie = await moviesService.getMovies({tags});\\n\\n res.status(200).json({\\n data: movie,\\n menssage: 'movie listed'\\n });\\n }catch(err){\\n next(err);\\n }\\n });\\n\\n router.get('/:movieId', async function(req,res,next){\\n const { movieId } = req.params;\\n try{\\n const movie = await moviesService.getMovie({movieId});\\n\\n res.status(200).json({\\n data: movie,\\n menssage: 'movie retrieved'\\n });\\n }catch(err){\\n next(err);\\n }\\n });\\n\\n router.post('/', async function(req,res,next){\\n const { body: movie } = req;\\n try{\\n const createdMovieId = moviesService.createMovie({movie});\\n\\n res.status(201).json({\\n data: createdMovieId,\\n menssage: 'movie created'\\n });\\n }catch(err){\\n next(err);\\n }\\n });\\n\\n router.put('/:movieId', async function(req,res,next){\\n const { movieId } = req.params;\\n const { body: movie } = req;\\n try{\\n const updateMovieId = await moviesService.updateMovie({ movieId, movie });\\n\\n res.status(200).json({\\n data: updateMovieId,\\n menssage: 'movie update'\\n });\\n }catch(err){\\n next(err);\\n }\\n });\\n\\n router.delete('/:movieId', async function(req,res,next){\\n const { movieId } = req.params;\\n try{\\n const deleteMovie = await moviesService.deleteMovie({ movieId });\\n\\n res.status(200).json({\\n data: deleteMovie,\\n menssage: 'movie deleted'\\n });\\n }catch(err){\\n next(err);\\n }\\n });\\n}\",\n \"async function dbOps() {\\n let testing = false;\\n\\n //If in dev, set fake Ip and testing status to true\\n if (process.env.NODE_ENV === \\\"development\\\") {\\n testing = true;\\n }\\n\\n MongoClient.connect(\\n process.env.DB,\\n { useNewUrlParser: true },\\n async function(err, client) {\\n //Error\\n if (err) {\\n next(err);\\n }\\n //Connection\\n else {\\n const db = client.db(\\\"trivia-actually\\\"); // Database\\n const scoreCollection = db.collection(\\\"scores\\\"); // Scores collection\\n const ipCollection = db.collection(\\\"ips\\\"); // IPs collection\\n\\n //Get score stats\\n const scoreData = await statsHandler.getScores(testing, scoreCollection).catch(err => {\\n next(err);\\n });\\n\\n //Get ip Stats\\n const ipData = await statsHandler.getIps(testing, ipCollection).catch(err => {\\n next(err);\\n });\\n\\n //Get unique locations\\n const locations = await statsHandler.reduceLocations(ipData.locations).catch(err => {\\n next(err);\\n });\\n\\n //JSON request for testing\\n if (req.body.format === \\\"json\\\") {\\n try {\\n res.json({\\n triviaData: {\\n easyCount: easyTrivia.length,\\n medCount: medTrivia.length,\\n hardCount: hardTrivia.length,\\n totalTriviaCount: triviaData.length\\n },\\n scoreStats: scoreData,\\n ipStats: { ipCount: ipData.ipCount, locations: locations }\\n });\\n } catch (err) {\\n next(err);\\n }\\n } // end of if format json\\n //Otherwise render Jade page\\n else {\\n try {\\n res.render(\\\"admin_stats\\\", {\\n totalCount: scoreData.totalCount,\\n ipCount: ipData.ipCount,\\n average: scoreData.average,\\n median: scoreData.median,\\n zeroCount: scoreData.zeroCount,\\n tenCount: scoreData.tenCount,\\n twentyCount: scoreData.twentyCount,\\n thirtyCount: scoreData.thirtyCount,\\n fortyCount: scoreData.fortyCount,\\n fiftyCount: scoreData.fiftyCount,\\n sixtyCount: scoreData.sixtyCount,\\n seventyCount: scoreData.seventyCount,\\n eightyCount: scoreData.eightyCount,\\n ninetyCount: scoreData.ninetyCount,\\n hundredCount: scoreData.hundredCount,\\n easyCount: easyTrivia.length,\\n medCount: medTrivia.length,\\n hardCount: hardTrivia.length,\\n totalTriviaCount: triviaData.length,\\n locations: locations\\n });\\n } catch (err) {\\n next(err);\\n }\\n } // end of else render Jade\\n\\n client.close();\\n } // end of else for successful connection\\n } // end of connection function\\n ); // end of MongoClient.connect\\n }\",\n \"function htmlRoutes(app) {\\n app.get('/survey', function (req, res) {\\n res.sendFile(path.join(__dirname + '/../public/survey.html'));\\n });\\n\\n // A default USE route that leads to home.html which displays the home page.\\n app.use(function (req, res) {\\n res.sendFile(path.join(__dirname + '/../public/home.html'));\\n });\\n\\n}\",\n \"function authroute(navbar,login){\\r\\n //Authot Array\\r\\n var authors = [\\r\\n { \\r\\n id:1,\\r\\n name:'William Shakespeare',\\r\\n img:'shakespeare.jfif',\\r\\n description:\\\"William Shakespeare was an English poet, playwright, and actor, widely regarded as the greatest writer in the English language\\\"\\r\\n },\\r\\n { \\r\\n id:2,\\r\\n name:'Joseph Barbera',\\r\\n img:'joseph.jpg',\\r\\n description:\\\"Joseph Roland Barbera was an American animator, director, producer, storyboard artist, and cartoon artist, whose film and television cartoon characters entertained millions of fans worldwide\\\"\\r\\n },\\r\\n { \\r\\n id:3,\\r\\n name:\\\"Jonathan Swift\\\",\\r\\n img:'jonathan.jpg',\\r\\n description:\\\"Jonathan Swift was an Anglo-Irish satirist, essayist, political pamphleteer poet and Anglican cleric who became Dean of St Patrick's Cathedral, Dublin, hence his common sobriquet, 'Dean Swift'\\\"\\r\\n }\\r\\n ]\\r\\n authorRouter.get('/',function(req,res){\\r\\n res.render(\\\"authors\\\",{\\r\\n navbar,\\r\\n login,\\r\\n title:\\\"Authors\\\",\\r\\n authors\\r\\n });\\r\\n });\\r\\n authorRouter.get('/:id',function(req,res){\\r\\n const id = req.params.id;\\r\\n res.render('author',{\\r\\n navbar,\\r\\n login,\\r\\n title:\\\"Author\\\",\\r\\n authors:authors[id]\\r\\n });\\r\\n })\\r\\n return authorRouter;\\r\\n}\",\n \"function main () {\\n app.use(bodyParser.json());\\n // Routes & Handlers\\n app.get('/list',cacheMiddleware(10), function (req, res) {\\n connection.query('select * from list', function (error, results, fields) {\\n if (error) throw error;\\n memCache.put(req.mCacheKey, results,1200000);\\n incrementApiHitCount(req.mCacheKey);\\n res.json(results);\\n });\\n});\\n\\napp.get('/emplist',cacheMiddleware(10), function (req, res) {\\n connection.query('select * from list', function (error, results, fields) {\\n if (error) throw error;\\n memCache.put(req.mCacheKey, results,1200000);\\n incrementApiHitCount(req.mCacheKey);\\n res.json(results);\\n });\\n});\\n \\napp.get('/apilist/:key',cacheMiddleware(10), function (req, res) {\\n let apikey=req.params.key;\\n connection.query('select word from filter_words where siteid in (select siteid from keyinfo where api_key=?)',apikey, function (error, results, fields) {\\n if (error) throw error;\\n if(results.length>0) {\\n memCache.put(req.mCacheKey, results,1200000);\\n incrementApiHitCount(req.mCacheKey);\\n res.json(results);\\n }\\n else{\\n let emptyResponse='Invalid Key';\\n res.json(emptyResponse);\\n }\\n });\\n\\n \\n});\\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\\n\\n}\",\n \"_declareExpressUses(express) {\\n this.expApp.use('/', express.static(__dirname + '/../web'));\\n this.expApp.use('/materialize', express.static('./node_modules/materialize-css/dist'));\\n this.expApp.use('/blockui', express.static('./node_modules/blockui-npm'));\\n this.expApp.use('/materialize-autocomplete', express.static('./node_modules/materialize-autocomplete'));\\n this.expApp.use('/jquery', express.static('./node_modules/jquery/dist'));\\n }\",\n \"setUpRoutes () {\\n\\n /*\\n * Hotels Query\\n * GET /hotels\\n * params: stringify query\\n * - ?name=**&stars=[2, 5]\\n * - ?_id=**\\n */\\n this.app.get('/hotels', async (req, res) => {\\n const query = parse(req.url, true).query\\n\\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\\n\\n console.log(query)\\n const results = this.filterData(query, data)\\n res.status(200).json(results)\\n })\\n\\n /*\\n * Hotels Create\\n * POST /\\n * body: Hotel fields (see validator)\\n */\\n this.app.post('/', db(async (req, res) => {\\n const {Model} = req\\n const data = req.body\\n let result = {}\\n try {\\n result = await new Model(data).save()\\n } catch (err) {\\n console.log('error', err)\\n if (err.name && err.name === 'ValidationError') {\\n return res.status(400).send({message: err.message})\\n }\\n return res.status(500).send({message: 'Error: save hotel'})\\n }\\n return res.status(200).send(result)\\n }))\\n\\n /*\\n * Hotel Update\\n * PUT /:id\\n * params: @id\\n * body: Dataset to update\\n */\\n this.app.put('/:id', db(async (req, res) => {\\n const {Model} = req\\n const data = req.body\\n const {id} = req.params\\n delete data._id\\n let result = {}\\n try {\\n result = await Model.findByIdAndUpdate(id, { $set: data }, { new: true })\\n } catch (err) {\\n console.log('error', err)\\n if (err.name && err.name === 'ValidationError') {\\n return res.status(400).send({message: err.message})\\n }\\n return res.status(500).send({message: 'Error: update hotel'})\\n }\\n return res.status(200).send(result)\\n }))\\n\\n /*\\n * Hotel Delete\\n * DELETE /:id\\n * params: @id\\n */\\n this.app.delete('/:id', db(async (req, res) => {\\n const {Model} = req\\n const {id} = req.params\\n let result = {}\\n try {\\n result = await Model.findByIdAndRemove(id)\\n if (!result) {\\n return res.status(404).send({message: 'hotel not found'})\\n }\\n } catch (err) {\\n if (err.name && err.name === 'ValidationError') {\\n return res.status(400).send({message: err.message})\\n }\\n return res.status(500).send({message: 'Error: delete hotel'})\\n }\\n return res.status(200).send({message: 'delete ok', data: result})\\n }))\\n\\n /*\\n * Hotels find by id\\n * GET /:id\\n * params: @id\\n */\\n this.app.get('/:id', db(async (req, res) => {\\n const {Model} = req\\n const {id} = req.params\\n let result = {}\\n try {\\n result = await Model.findById(id)\\n if (!result) {\\n return res.status(404).send({message: 'hotel not found'})\\n }\\n } catch (err) {\\n if (err.name && err.name === 'ValidationError') {\\n return res.status(400).send({message: err.message})\\n }\\n return res.status(500).send({message: 'Error: find by id hotel'})\\n }\\n return res.status(200).send(result)\\n }))\\n\\n /*\\n * Hotels Query\\n * GET /hotels\\n * params: stringify query\\n * - ?name=**&stars=[2, 5]\\n * - ?_id=**\\n */\\n this.app.get('/', db(async (req, res) => {\\n const {Model} = req\\n const query = parse(req.url, true).query\\n\\n for (const i in query) query[i] = JSON.parse(unescape(query[i])) // parse query to object\\n let results = []\\n try {\\n results = await Model.find(query)\\n } catch (err) {\\n return res.status(500).send({message: 'Error: find all hotels'})\\n }\\n return res.status(200).send(results)\\n }))\\n }\",\n \"setup() {\\n this.app.use(express.json());\\n\\n this.app.get('/', (req, res) => {\\n res.send(\\\"Hello World!\\\")\\n });\\n }\",\n \"middlewares() {\\n //directorio publico\\n this.app.use(express.static('public'));\\n\\n //convertir los datos que llegan en json\\n this.app.use(express.json());\\n }\",\n \"index(req, res) {\\n User.find({}, (err, users) => {\\n if (err) {\\n console.log(`Error: ${err} `);\\n }\\n let context = {\\n users: users\\n };\\n return res.render('index', context);\\n })\\n }\",\n \"function randomRest(req, res, next){\\n var id = req.params.id;\\n Wishlist.find({_id: id}, function(err, wishlist) {\\n var taurs = wishlist.restaurants;\\n var taur = shuffleList(taurs);\\n res.json(taur);\\n })\\n}\",\n \"function route(...etc)\\n{\\n etc.unshift(stockAPI);\\n let sOut = etc.reduce((acc, curr)=>acc+=curr+'/');\\n return sOut;\\n}\",\n \"function main () {\\n let app = express(); // Export app for other routes to use\\n let handlers = new HandlerGenerator();\\n const port = process.env.PORT || 8000;\\n app.use(bodyParser.urlencoded({ // Middleware\\n extended: true\\n }));\\n app.use(bodyParser.json());\\n // Routes & Handlers\\n app.post('/login', handlers.login);\\n app.get('/', middleware.checkToken, handlers.index);\\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\\n}\",\n \"function bootApplication(app, config, passport) {\\n app.set('showStackError', true)\\n app.use(express.static(__dirname + '/../public'))\\n app.use(express.logger(':method :url :status'))\\n\\n // set views path, template engine and default layout\\n console.log(__dirname + '/../app/views');\\n app.set('views', __dirname + '/../app/views')\\n app.set('view engine', 'jade')\\n\\n app.configure(function () {\\n // dynamic helpers\\n app.use(function (req, res, next) {\\n res.locals.appName = 'XbeeCordinator'\\n res.locals.title = 'Xbee Cordiator'\\n res.locals.showStack = app.showStackError\\n res.locals.req = req\\n next()\\n })\\n\\n\\n // bodyParser should be above methodOverride\\n app.use(express.bodyParser())\\n app.use(express.methodOverride())\\n\\n // cookieParser should be above session\\n app.use(express.cookieParser());\\n app.use(express.session({\\n secret: 'sessionstore',\\n store: new MemoryStore(),\\n key: 'blah'\\n })\\n );\\n\\n app.use(passport.initialize())\\n app.use(passport.session())\\n\\n app.use(express.favicon())\\n app.use(express.errorHandler({showStack: true, dumpExceptions: true}));\\n // routes should be at the last\\n app.use(app.router)\\n\\n // assume \\\"not found\\\" in the error msgs\\n // is a 404. this is somewhat silly, but\\n // valid, you can do whatever you like, set\\n // properties, use instanceof etc.\\n app.use(function(err, req, res, next){\\n // treat as 404\\n if (~err.message.indexOf('not found')) return next()\\n\\n // log it\\n console.error(err.stack)\\n\\n // error page\\n res.status(500).render('500')\\n })\\n\\n // assume 404 since no middleware responded\\n app.use(function(req, res, next){\\n res.status(404).render('404', { url: req.originalUrl })\\n })\\n\\n })\\n\\n app.set('showStackError', true)\\n\\n}\",\n \"route() {\\n this.router\\n .route('/:id/accounts')\\n .get(validateToken, verifyIsClient, this.userController.getAccounts)\\n .post(\\n validateToken,\\n verifyIsClient,\\n createAccountValidator,\\n validate,\\n this.userController.createAccount,\\n );\\n\\n this.router\\n .route('/:id/accounts/:accountNumber/transactions')\\n .get(validateToken, verifyIsClient, this.userController.accountHistory);\\n\\n this.router\\n .route('/:id/transactions/:transId')\\n .get(validateToken, verifyIsClient, this.userController.specificTranHist);\\n\\n this.router\\n .route('/:id/accounts/:accountNumber')\\n .get(validateToken, verifyIsClient, this.userController.specAcctDetails);\\n\\n this.router\\n .route('/:id/confirmEmail/:token')\\n .get(\\n setHeadersparams2,\\n validateToken,\\n verifyIsClient,\\n this.userController.confirmEmail,\\n );\\n\\n this.router\\n .route('/:id/changePassword')\\n .patch(\\n validateToken,\\n verifyIsClient,\\n changePasswordValidator,\\n validate,\\n this.userController.changePassword,\\n );\\n\\n this.router\\n .route('/:id/transactions/:accountNumber/transfer')\\n .post(\\n validateToken,\\n verifyIsClient,\\n transferFundValidator,\\n validate,\\n this.userController.transferFunds,\\n );\\n\\n this.router\\n .route('/:id/transactions/:accountNumber/airtime')\\n .post(\\n validateToken,\\n verifyIsClient,\\n airtimeValidator,\\n validate,\\n this.userController.buyAirtime,\\n this.staffController.debitAccount,\\n );\\n\\n this.router\\n .route('/:id/upload')\\n .post(upload.single('passport'), this.userController.uploadPassport);\\n\\n return this.router;\\n }\",\n \"function htmlRoutes(app) {\\n // Route to the homepage\\n app.get(\\\"/\\\", function (req, res) {\\n res.sendFile(path.join(__dirname, \\\"../public/home.html\\\"));\\n });\\n\\n // Route to the survey page\\n app.get(\\\"/survey\\\", function (req, res) {\\n res.sendFile(path.join(__dirname, \\\"../public/survey.html\\\"));\\n });\\n}\",\n \"function route(req,res,module,app,next,counter) { \\n \\n // Wait for the dependencies to be met \\n if(!calipso.socket) {\\n \\n counter = (counter ? counter : 0) + 1; \\n \\n if(counter < 1000) {\\n process.nextTick(function() { route(req,res,module,app,next,counter); }); \\n return;\\n } else {\\n calipso.error(\\\"Tweetstream couldn't route as dependencies not met.\\\")\\n next();\\n return;\\n } \\n }\\n \\n res.menu.primary.push({name:'Tweets',url:'/tweets',regexp:/tweets/});\\n \\n /**\\n * Routes\\n */ \\n module.router.route(req,res,next);\\n \\n}\",\n \"run (req, res, next) {}\",\n \"function failRandomlyMiddleware(req, res, next) {\\n if (Math.random() * 2 >= 1) {\\n next();\\n } else {\\n res.status(500).end();\\n }\\n}\",\n \"function AboutRoute(db) {\\n //var ctrl = new AboutCtrl(db);\\n \\n return [\\n {\\n method: 'GET',\\n path: '/',\\n handler: (request, h) => {\\n \\n return 'Hello, world!';\\n }\\n },\\n {\\n method: 'GET',\\n path: '/{name}',\\n handler: (request, h) => {\\n \\n return 'Hello, ' + encodeURIComponent(request.params.name) + '!';\\n }\\n }\\n ];\\n}\",\n \"async index(req, res) {\\n // checando se o usuario logado é um provider\\n const checkUserProvider = await User.findOne({\\n where: { id: req.Id, provider: true },\\n });\\n // caso nao seja cai aqui\\n if (!checkUserProvider) {\\n return res.status(401).json({ error: 'User is not a provider' });\\n }\\n\\n // pega a data passada\\n const { date } = req.query;\\n // variavel que retorna a data\\n const parsedDate = parseISO(date);\\n // checa todos os Appointments do dia atraves do usuario logado\\n const Appointments = await Appointment.findAll({\\n where: {\\n provider_id: req.Id,\\n canceled_at: null,\\n date: {\\n [Op.between]: [startOfDay(parsedDate), endOfDay(parsedDate)], // operador between, com o inicio do dia e o fim do dia\\n },\\n },\\n order: ['date'], // ordenado pela data\\n });\\n\\n return res.json(Appointments);\\n }\",\n \"start() {\\n const app = express_1.default();\\n let query = new user_serv_1.default();\\n // route for GET /\\n // returns items\\n app.get('/', (request, response) => __awaiter(this, void 0, void 0, function* () {\\n let data = yield query.find({});\\n response.send(data);\\n }));\\n app.get('/register', (request, response) => __awaiter(this, void 0, void 0, function* () {\\n let user = new user_1.default();\\n let answer = yield query.register(user);\\n if (answer.result)\\n response.send();\\n else\\n response.status(500).send(answer);\\n }));\\n // Server is listening to port defined when Server was initiated\\n app.listen(this.port, () => {\\n console.log(\\\"Server is running on port \\\" + this.port);\\n });\\n }\",\n \"constructor() {\\n this.express = express(); //THE APP\\n this.middleware();\\n this.routes();\\n }\",\n \"constructor() {\\n this.express = express(); //THE APP\\n this.middleware();\\n this.routes();\\n }\",\n \"function createExpressApp() {\\n var app = express();\\n\\n // returns an empty response and sends a chosen HTTP status\\n app.get('/return-status/:status', function(req, res) {\\n res.status(parseInt(req.params.status)).send(\\\"\\\");\\n });\\n\\n // returns a chosen body with HTTP status 200\\n app.get('/return-body/:body', function(req, res) {\\n res.status(200).send(req.params.body);\\n });\\n\\n // returns a chosen header with HTTP status 200\\n app.get('/return-header/:name/:value', function(req, res) {\\n res.status(200).set(req.params.name, req.params.value).send(\\\"Ok!\\\");\\n });\\n\\n // responds \\\"Ok!\\\" after a delay of :ms milliseconds\\n app.get('/delay-for-ms/:ms', function(req, res) {\\n setTimeout(function() {\\n res.status(200).send(\\\"Ok!\\\");\\n }, parseInt(req.params.ms));\\n });\\n\\n // responds with a body of the chosen size\\n app.get('/response-size/:bytes', function(req, res) {\\n var size = parseInt(req.params.bytes);\\n res.set({'content-type': 'application/octet-stream'});\\n res.status(200).send(new Buffer(size)).end();\\n });\\n\\n // for each ID - fails 2 times with 500, then returns \\\"Ok!\\\"\\n var fttsCounts = {};\\n app.all('/fail-twice-then-succeed/:id', function(req, res) {\\n var count = fttsCounts[req.params.id] || 0;\\n fttsCounts[req.params.id] = count + 1;\\n if (count >= 2)\\n res.status(200).send(\\\"Ok!\\\");\\n else\\n res.status(500).send(\\\"Oh my!\\\");\\n });\\n\\n // for each ID - returns an incrementing counter after a small delay, starting at 1 for the first request\\n var icCounts = {};\\n app.all('/incrementing-counter/:id', function(req, res) {\\n var count = icCounts[req.params.id] || 1;\\n icCounts[req.params.id] = count + 1;\\n setTimeout(function() {\\n res.status(200).send(count.toString());\\n }, 50);\\n });\\n\\n // incrementing counter with a configurable cache-control setting\\n app.all('/counter/:id/cache-control/:cache', function(req, res) {\\n var count = icCounts[req.params.id] || 1;\\n icCounts[req.params.id] = count + 1;\\n\\n res.status(200)\\n .set('Cache-Control', req.params.cache)\\n .send(count.toString());\\n });\\n\\n // for each ID - return success response with cache, then fail\\n var stfCounts = {};\\n app.all('/succeed-then-fail/:id/cache-control/:cache', function(req, res) {\\n var count = stfCounts[req.params.id] || 1;\\n stfCounts[req.params.id] = count + 1;\\n\\n if(count < 2)\\n res.status(200)\\n .set('Cache-Control', req.params.cache)\\n .send('Ok!');\\n else\\n res.status(500).send(\\\"Oh my!\\\");\\n });\\n\\n // register a route for each HTTP method returning the method that was used in a header (to test HEAD properly)\\n app.all('/return-method-used/:method', function(req, res) {\\n res.status(200).set('X-Method', req.method).send('');\\n });\\n\\n // this route returns a 404 once, then 200 to test 4xx caching\\n var first404then200Ids = {};\\n app.get('/first-404-then-200/:id', function(req, res) {\\n if (first404then200Ids[req.params.id]) {\\n res.status(200).send('Ok.');\\n } else {\\n first404then200Ids[req.params.id] = true;\\n res.status(404).send('Not found.');\\n }\\n });\\n\\n return app;\\n}\",\n \"function setupApp () {\\n const app = express()\\n app.use(errorHandler);\\n app.get(\\\"/test\\\",(req, res)=>{\\n //res.send(\\\"Is is working!\\\");\\n var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];\\n let sorted=_.sortBy(stooges, 'age');\\n res.send(sorted);\\n });//end get(/error)\\n\\n\\n app.get(\\\"/load-practitioners\\\", (req, res)=>{\\n\\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\\\"/practitioner\\\",result:typeResult.iniate,\\n message:`Start the import CSV file content`});\\n\\n let filePath = mappingConfig.app.dataFilePath;\\n\\n let server = mappingConfig.app.server;\\n\\n customLibrairy.createPractitionerFromCSV(filePath,function(records){\\n\\n let fhirs = records.entry\\n\\n for(let fhir of fhirs)\\n {\\n \\n //fhir = fhir.resource\\n\\n if ( fhir.resourceType === \\\"Bundle\\\" &&\\n ( fhir.type === \\\"transaction\\\" || fhir.type === \\\"batch\\\" ) ) {\\n console.log( \\\"Saving \\\" + fhir.type )\\n let dest = URI(server).toString()\\n axios.post( dest, fhir ).then( ( res ) => {\\n console.log( dest+\\\": \\\"+ res.status )\\n console.log( JSON.stringify( res.data, null, 2 ) )\\n } ).catch( (err) => {\\n console.error(err)\\n } )\\n } else {\\n console.log( \\\"Saving \\\" + fhir.resourceType +\\\" - \\\"+fhir.id )\\n let dest = URI(server).segment(fhir.resourceType).segment(fhir.id).toString()\\n axios.put( dest, fhir ).then( ( res ) => {\\n console.log( dest+\\\": \\\"+ res.status )\\n console.log( res.headers['content-location'] )\\n } ).catch( (err) => {\\n console.error(err)\\n console.error(JSON.stringify(err.response.data,null,2))\\n } )\\n }\\n \\n }\\n });\\n\\n });//end \\n\\n app.get(\\\"/load-roles\\\", (req, res)=>{\\n\\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\\\"/practitionerRole\\\",result:typeResult.iniate,\\n message:`Start the import CSV file content`});\\n\\n let filePath = mappingConfig.app.dataFilePath;\\n\\n let server = mappingConfig.app.server;\\n\\n\\n customLibrairy.createPractitionerRoleFromCSV(filePath,function(records){\\n\\n let fhirs = records.entry\\n\\n\\n for(let fhir of fhirs)\\n {\\n\\n if ( fhir.resourceType === \\\"Bundle\\\" &&\\n ( fhir.type === \\\"transaction\\\" || fhir.type === \\\"batch\\\" ) ) {\\n\\n console.log( \\\"Saving \\\" + fhir.type )\\n let dest = URI(server).toString()\\n axios.post( dest, fhir ).then( ( res ) => {\\n console.log( dest+\\\": \\\"+ res.status )\\n console.log( JSON.stringify( res.data, null, 2 ) )\\n } ).catch( (err) => {\\n console.error(err)\\n } )\\n } else {\\n console.log( \\\"Saving \\\" + fhir.resourceType +\\\" - \\\"+fhir.id )\\n let dest = URI(server).segment(fhir.resourceType).segment(fhir.id).toString()\\n axios.put( dest, fhir ).then( ( res ) => {\\n console.log( dest+\\\": \\\"+ res.status )\\n console.log( res.headers['content-location'] )\\n } ).catch( (err) => {\\n console.error(err)\\n console.error(JSON.stringify(err.response.data,null,2))\\n } )\\n }\\n \\n }\\n });\\n });//end \\n\\n app.get(\\\"/Practitioner\\\",(req, res)=>{\\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\\\"/practitioner\\\",result:typeResult.iniate,\\n message:`Start the import CSV file content`});\\n let filePath=mappingConfig.app.dataFilePath;\\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\\n\\n //console.log(recordPractitioners);\\n\\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\\\"readCSVData\\\",\\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\\n let listExtractedPractitioner=[];\\n listExtractedPractitioner=customLibrairy.buildPractitioner(recordPractitioners);\\n\\n //console.log(listExtractedPractitioner.entry)\\n \\n res.send(listExtractedPractitioner);\\n \\n });\\n });//end \\n\\n app.get(\\\"/PractitionerRole\\\",(req, res)=>{\\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\\\"/practitioner\\\",result:typeResult.iniate,\\n message:`Start the import CSV file content`});\\n let filePath=mappingConfig.app.dataFilePath;\\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\\n //console.log(patientData);\\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\\\"readCSVData\\\",\\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\\n let listExtractedPractitionerRole=[];\\n listExtractedPractitionerRole=customLibrairy.buildPractitionerRole(recordPractitioners);\\n res.send(listExtractedPractitionerRole);\\n \\n });\\n });//end\\n app.get(\\\"/Location\\\",(req, res)=>{\\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\\\"/location\\\",result:typeResult.iniate,\\n message:`Start the import CSV file content`});\\n let filePath=mappingConfig.app.dataFilePath;\\n console.log(filePath)\\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\\n //console.log(patientData);\\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\\\"readCSVData\\\",\\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\\n let listExtractedLocation=[];\\n listExtractedLocation=customLibrairy.buildLocation(recordPractitioners);\\n res.send(listExtractedLocation);\\n \\n });\\n });//end\\n app.get(\\\"/ValueSet\\\",(req, res)=>{\\n logger.log({level:levelType.info,operationType:typeOperation.normalProcess,action:\\\"/Job-ValueSet\\\",result:typeResult.iniate,\\n message:`Start the import CSV file content`});\\n let filePath=mappingConfig.app.dataFilePath;\\n customLibrairy.readCSVData(filePath,function(recordPractitioners){\\n //console.log(patientData);\\n logger.log({level:levelType.info,operationType:typeOperation.getData,action:\\\"readCSVData\\\",\\n result:typeResult.success,message:`Return ${recordPractitioners.length} practitioner`});\\n let listExtractedJob=[];\\n listExtractedJob=customLibrairy.buildJob(recordPractitioners);\\n res.send(listExtractedJob);\\n \\n });\\n });//end\\n \\n return app\\n}\",\n \"function moviesApi(app) {\\n const router = express.Router();\\n app.use('/api/movies', router);\\n\\n //Instanciando un nuevo servicio\\n const moviesServices = new MoviesServices();\\n\\n //----------------- Aqui definimos las rutas -----------------------------\\n\\n //Aqui passport actua como un middleware y en este caso no requiere de un custom callback, de esta forma protegemos nuestros endpoint con passport. Cn lo que la unica manera de obtener acceso es si tenemos un jwt valido.\\n router.get(\\n '/',\\n passport.authenticate('jwt', { session: false }),\\n scopesValidationHandler(['read:movies']),\\n async function(req, res, next) {\\n cacheResponse(res, FIVE_MINUTES_IN_SECONDS);\\n //los tags probiene del query de la url recuerda response.object y request.object la lectura del curso\\n const { tags } = req.query;\\n try {\\n //getMovies probiene del la capa de servicios\\n const movies = await moviesServices.getMovies({ tags });\\n //Hardcode Error para ver un error\\n //throw new Error('error for testing propuses');\\n res.status(200).json({\\n data: movies,\\n massage: 'movies Listed'\\n });\\n } catch (err) {\\n next(err);\\n }\\n }\\n );\\n\\n //NOTA:La diferencia principal entre parametros y query es que: los parametros estan establecidos en l url y query es cuando se le pone ?-nombreQuery- y ademas se puede concatenar.\\n\\n //Implementando metodos CRUD\\n //Buscado por medio del ID\\n //NOTA: Los middleware van entre la ruta y la definicion de la ruta tantos como se quiera\\n router.get(\\n '/:movieId',\\n passport.authenticate('jwt', { session: false }),\\n scopesValidationHandler(['read:movies']),\\n validationHandler({ movieId: movieIdSchema }, 'params'),\\n async function(req, res, next) {\\n cacheResponse(res, SIXTY_MINUTES_IN_SECONDS);\\n //en este caso el id biene como parametro en la url\\n const { movieId } = req.params;\\n try {\\n const movies = await moviesServices.getMovie({ movieId });\\n res.status(200).json({\\n data: movies,\\n massage: 'Movie retrive'\\n });\\n } catch (err) {\\n next(err);\\n }\\n }\\n );\\n\\n //Creando y recibiendo la pelicula\\n router.post(\\n '/',\\n passport.authenticate('jwt', { session: false }),\\n scopesValidationHandler(['create:movies']),\\n validationHandler(createMovieSchema),\\n async function(req, res, next) {\\n //en este caso biene es del cuerpo el body con un alias para ser mas especifioc en este caso boyd: movie(alias)\\n const { body: movie } = req;\\n try {\\n const createMovieId = await moviesServices.createMovie({ movie });\\n //cuando creamos el codigo es 201\\n res.status(201).json({\\n data: createMovieId,\\n massage: 'Movies created'\\n });\\n } catch (err) {\\n next(err);\\n }\\n }\\n );\\n\\n //Actualizando las peliculas\\n router.put(\\n '/:movieId',\\n passport.authenticate('jwt', { session: false }),\\n scopesValidationHandler(['update:movies']),\\n validationHandler({ movieId: movieIdSchema }, 'params'),\\n validationHandler(updateMovieSchema),\\n async function(req, res, next) {\\n const { movieId } = req.params;\\n const { body: movie } = req;\\n try {\\n const updatedMovieId = await moviesServices.updateMovie({\\n movieId,\\n movie\\n });\\n res.status(200).json({\\n data: updatedMovieId,\\n massage: 'Movie updated'\\n });\\n } catch (err) {\\n next(err);\\n }\\n }\\n );\\n\\n //Reto:\\n //NOTA: PATCH como PUT se usa para actualizaciones pero con la diferencia de que este es usado para hacer cambios en una parte del recurso en una locacion y no el recurso completo es descrito como una minorUpdate y fallara si el recurso no existe. Mas info https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods\\n router.patch('/:movieId', async (req, res, next) => {\\n const { movieId } = req.params;\\n const { body: movie } = req;\\n\\n try {\\n const partiallyUpdatedMovieId = await moviesServices.partialUpdateMovie({\\n movieId,\\n movie\\n });\\n\\n res.status(200).json({\\n data: partiallyUpdatedMovieId,\\n massage: 'partially updated movie'\\n });\\n } catch (err) {\\n next(err);\\n }\\n });\\n\\n //Borrar las Peliculas\\n router.delete(\\n '/:movieId',\\n passport.authenticate('jwt', { session: false }), //Validar Autenticacion\\n scopesValidationHandler(['delete:movies']), //Validar Permisos Necesarios\\n validationHandler({ movieId: movieIdSchema }, 'params'), //Validar que los Datos esten Correctos\\n async function(req, res, next) {\\n const { movieId } = req.params;\\n try {\\n const movies = await moviesServices.deleteMovie({ movieId });\\n res.status(200).json({\\n data: movies,\\n massage: 'Movies deleted'\\n });\\n } catch (err) {\\n next(err);\\n }\\n }\\n );\\n}\",\n \"_createApp () {\\n return new Promise(resolve => {\\n this.app = Express()\\n\\n if (datadog.key === 'none') this.app.use((req, res) => res.json({ success: true }))\\n else LoadRoutes(this, this.app, __dirname, './routes')\\n\\n this.app.listen(statsPort, () => {\\n resolve()\\n })\\n })\\n }\",\n \"constructor(apiName, config, totoEventPublisher, totoEventConsumer) {\\n\\n this.app = express();\\n this.apiName = apiName;\\n this.totoEventPublisher = totoEventPublisher;\\n this.totoEventConsumer = totoEventConsumer;\\n this.logger = new Logger(apiName)\\n\\n // Init the paths\\n this.paths = [];\\n\\n config.load().then(() => {\\n let authorizedClientIDs = config.getAuthorizedClientIDs ? config.getAuthorizedClientIDs() : null;\\n\\n if (config.getCustomAuthVerifier) console.log('[' + this.apiName + '] - A custom Auth Provider was provided');\\n\\n this.validator = new Validator(config.getProps ? config.getProps() : null, authorizedClientIDs, this.logger, config.getCustomAuthVerifier ? config.getCustomAuthVerifier() : null);\\n\\n });\\n\\n // Initialize the basic Express functionalities\\n this.app.use(function (req, res, next) {\\n res.header(\\\"Access-Control-Allow-Origin\\\", \\\"*\\\");\\n res.header(\\\"Access-Control-Allow-Headers\\\", \\\"Origin, X-Requested-With, Content-Type, Accept, Authorization, x-correlation-id, x-msg-id, auth-provider, x-app-version, x-client\\\");\\n res.header(\\\"Access-Control-Allow-Methods\\\", \\\"OPTIONS, GET, PUT, POST, DELETE\\\");\\n next();\\n });\\n\\n this.app.use(bodyParser.json());\\n this.app.use(busboy());\\n this.app.use(express.static(path.join(__dirname, 'public')));\\n\\n // Add the standard Toto paths\\n // Add the basic SMOKE api\\n this.path('GET', '/', {\\n do: (req) => {\\n\\n return new Promise((s, f) => {\\n\\n return s({ api: apiName, status: 'running' })\\n });\\n }\\n });\\n\\n // Add the /publishes path\\n this.path('GET', '/produces', {\\n do: (req) => {\\n\\n return new Promise((s, f) => {\\n\\n if (this.totoEventPublisher != null) s({ topics: totoEventPublisher.getRegisteredTopics() });\\n else s({ topics: [] });\\n });\\n }\\n })\\n\\n // Add the /consumes path\\n this.path('GET', '/consumes', {\\n do: (req) => {\\n\\n return new Promise((s, f) => {\\n\\n if (this.totoEventConsumer != null) s({ topics: totoEventConsumer.getRegisteredTopics() });\\n else s({ topics: [] });\\n })\\n }\\n })\\n\\n // Bindings\\n this.staticContent = this.staticContent.bind(this);\\n this.fileUploadPath = this.fileUploadPath.bind(this);\\n this.path = this.path.bind(this);\\n }\",\n \"function main() {\\n getRoutes();\\n}\",\n \"config() {\\n this.app.set(\\\"PORT\\\", process.env.PORT || 3000);\\n this.app.use(morgan_1.default(\\\"dev\\\")); //Miraremos las peticiones en modo desarrollador.\\n this.app.use(cors_1.default()); //Permitira que clientes haga peticiones\\n this.app.use(express_1.default.json()); //La app entendera json gracias a esto\\n this.app.use(express_1.default.urlencoded({ extended: false })); //Permite peticiones por HTML\\n }\",\n \"function discoverHikes(req, res, next) {\\n \\tconsole.log(req.user);\\n\\tres.render('main', req.user);\\n}\",\n \"use (middleware) {\\n this.app.use(middleware)\\n }\",\n \"function Router(nav1){\\n\\n \\nvisitorauthorsRouter.get('/', function(req,res){\\n Authorsdata.find()\\n .then(function(authors){\\n\\n res.render(\\\"visitorauthors\\\",{\\n nav1,\\n title:'Library',\\n authors\\n })\\n })\\n \\n})\\n\\nvisitorauthorsRouter.get('/:id',function(req,res){\\n const id=req.params.id;\\n Authorsdata.findOne({_id:id})\\n .then(function(author){\\n res.render('visitorauthor',{\\n nav1,\\n title:'Library App',\\n author\\n })\\n })\\n \\n})\\n \\n \\n \\n return visitorauthorsRouter;\\n }\",\n \"function call(req, res) {\\n // estatutos...\\n}\",\n \"function indexTripRoute(req, res, next){\\n Trip.find()\\n .populate('user') //had to populate user data in order to get access to trip.user._id\\n .then(trips => {\\n trips = trips.filter(trip => trip.user._id.equals(req.currentUser._id)); // req.currentUser is from secureRoute\\n res.status(200).json(trips);\\n })\\n .catch(next);\\n}\",\n \"index(req, res){\\r\\n User.find({}, (err, users) => {\\r\\n if(err){\\r\\n console.log(err);\\r\\n }\\r\\n res.render('index', { users: users})\\r\\n })\\r\\n }\",\n \"function init(app) {\\n app.get('/', (request, response) => { \\n //throw 44\\n response.render('home', {\\n name: 'John' + request.chance\\n })\\n })\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7205066","0.68016106","0.65026265","0.64773345","0.6475147","0.6441569","0.6441569","0.63967544","0.635786","0.6301378","0.62763906","0.6275354","0.62747335","0.6191203","0.61695","0.61682653","0.61668205","0.61516255","0.61287296","0.611662","0.60459256","0.6043112","0.5998688","0.59811306","0.5952885","0.5941086","0.59206724","0.5917157","0.5906911","0.5902978","0.5879673","0.58766645","0.58497363","0.5838889","0.5816853","0.5802155","0.57530534","0.57456416","0.5736151","0.5714696","0.57079625","0.57061034","0.5691066","0.5668394","0.5663614","0.5659089","0.5656438","0.5650737","0.5649133","0.564738","0.560635","0.5591301","0.5558994","0.55551946","0.55397886","0.5538527","0.5531524","0.5528333","0.5526968","0.55243397","0.55140966","0.5506268","0.5501406","0.5499699","0.5495741","0.5489487","0.5479651","0.5478872","0.54765135","0.54738516","0.54601026","0.54585046","0.5441833","0.5424688","0.54102445","0.5409485","0.5407392","0.5401075","0.53998435","0.5389837","0.53853333","0.5380548","0.5375236","0.5368183","0.53553134","0.53538114","0.53538114","0.53500444","0.53405285","0.5339521","0.5336796","0.5331847","0.53312206","0.5324842","0.5324448","0.5320774","0.5307231","0.53047425","0.5303917","0.52932256","0.5290944"],"string":"[\n \"0.7205066\",\n \"0.68016106\",\n \"0.65026265\",\n \"0.64773345\",\n \"0.6475147\",\n \"0.6441569\",\n \"0.6441569\",\n \"0.63967544\",\n \"0.635786\",\n \"0.6301378\",\n \"0.62763906\",\n \"0.6275354\",\n \"0.62747335\",\n \"0.6191203\",\n \"0.61695\",\n \"0.61682653\",\n \"0.61668205\",\n \"0.61516255\",\n \"0.61287296\",\n \"0.611662\",\n \"0.60459256\",\n \"0.6043112\",\n \"0.5998688\",\n \"0.59811306\",\n \"0.5952885\",\n \"0.5941086\",\n \"0.59206724\",\n \"0.5917157\",\n \"0.5906911\",\n \"0.5902978\",\n \"0.5879673\",\n \"0.58766645\",\n \"0.58497363\",\n \"0.5838889\",\n \"0.5816853\",\n \"0.5802155\",\n \"0.57530534\",\n \"0.57456416\",\n \"0.5736151\",\n \"0.5714696\",\n \"0.57079625\",\n \"0.57061034\",\n \"0.5691066\",\n \"0.5668394\",\n \"0.5663614\",\n \"0.5659089\",\n \"0.5656438\",\n \"0.5650737\",\n \"0.5649133\",\n \"0.564738\",\n \"0.560635\",\n \"0.5591301\",\n \"0.5558994\",\n \"0.55551946\",\n \"0.55397886\",\n \"0.5538527\",\n \"0.5531524\",\n \"0.5528333\",\n \"0.5526968\",\n \"0.55243397\",\n \"0.55140966\",\n \"0.5506268\",\n \"0.5501406\",\n \"0.5499699\",\n \"0.5495741\",\n \"0.5489487\",\n \"0.5479651\",\n \"0.5478872\",\n \"0.54765135\",\n \"0.54738516\",\n \"0.54601026\",\n \"0.54585046\",\n \"0.5441833\",\n \"0.5424688\",\n \"0.54102445\",\n \"0.5409485\",\n \"0.5407392\",\n \"0.5401075\",\n \"0.53998435\",\n \"0.5389837\",\n \"0.53853333\",\n \"0.5380548\",\n \"0.5375236\",\n \"0.5368183\",\n \"0.53553134\",\n \"0.53538114\",\n \"0.53538114\",\n \"0.53500444\",\n \"0.53405285\",\n \"0.5339521\",\n \"0.5336796\",\n \"0.5331847\",\n \"0.53312206\",\n \"0.5324842\",\n \"0.5324448\",\n \"0.5320774\",\n \"0.5307231\",\n \"0.53047425\",\n \"0.5303917\",\n \"0.52932256\",\n \"0.5290944\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":24,"cells":{"query":{"kind":"string","value":"TimeEngine method (scheduled interface)"},"document":{"kind":"string","value":"advanceTime(time) {\n this.trigger(time);\n this.__lastTime = time;\n return time + this.__period;\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":["ScheduleAt(time){\n \tconsole.log(\"scheduleprofecionales at\");\n }","scheduler() {\n this.maybeTickSongChart();\n\n // When nextNoteTime (in the future) is near (gap is determined by \n // scheduleAheadTime), schedule audio & visuals and advance to the next\n // note.\n while (this.nextNoteTime <\n (this.audioContext.currentTime + this.scheduleAheadTime)) {\n this.scheduleNote(this.current16thNote, this.nextNoteTime);\n this.nextNote();\n }\n }","function Schedule(options,element){return _super.call(this,options,element)||this;}","constructor(schedule) {\n\n }","static get schedule() {\n // once every hour\n return '* */1 * * *';\n }","function startTime() {\n setTimer();\n}","static get schedule() {\n // once every minute\n return '0 0 10 1/1 * ? *'\n }","getSchedule() {\n this.setRelativeTime();\n return this.schedule;\n }","function Scheduler() {\n this.clock = 0\n this.upcoming_events = []\n this.running = true\n this.devices = {}\n}","get schedule() {\n\t\treturn this.__schedule;\n\t}","function __time($obj) {\r\n if (window.STATICCLASS_CALENDAR==null) {\r\n window.STATICCLASS_CALENDAR = __loadScript(\"CalendarTime\", 1);\r\n }\r\n window.STATICCLASS_CALENDAR.perform($obj);\r\n}","function tickCurrentTimeEngine() {\n\n var d = new Date();\n\n currentHours = d.getHours();\n currentMinutes = d.getMinutes();\n currentSeconds = d.getSeconds();\n\n if (currentHours.toString().length == 1) {\n choursDigit_1 = 0;\n choursDigit_2 = currentHours;\n }\n else {\n choursDigit_1 = parseInt(currentHours.toString().charAt(0), 10);\n choursDigit_2 = parseInt(currentHours.toString().charAt(1), 10);\n }\n\n if (currentMinutes.toString().length == 1) {\n cminutesDigit_1 = 0;\n cminutesDigit_2 = currentMinutes;\n }\n else {\n cminutesDigit_1 = parseInt(currentMinutes.toString().charAt(0), 10);\n cminutesDigit_2 = parseInt(currentMinutes.toString().charAt(1), 10);\n }\n\n if (currentSeconds.toString().length == 1) {\n csecondsDigit_1 = 0;\n csecondsDigit_2 = currentSeconds;\n }\n else {\n csecondsDigit_1 = parseInt(currentSeconds.toString().charAt(0), 10);\n csecondsDigit_2 = parseInt(currentSeconds.toString().charAt(1), 10);\n }\n\n tickCurrentTime = setTimeout(tickCurrentTimeEngine, timerCurrentTimeMiliSecs);\n\n return;\n }","function morning() {\n // whole morning routine\n}","function task4 () {\n\n function Clock (options) {\n this._template = options.template\n }\n \n Clock.prototype.render = function() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = this._template.replace('h', hours)\n .replace('m', min)\n .replace('s', sec);\n console.log(output);\n };\n\n Clock.prototype.stop = function () {\n clearInterval(this._timer)\n }\n\n Clock.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), 1000)\n };\n\n\n\n // Descendant\n\n function RelativeClock(options) {\n Clock.apply(this, arguments) // coffee script super() :)\n this._precision = options.precision || 1000\n };\n\n RelativeClock.prototype = Object.create(Clock.prototype);\n RelativeClock.prototype.constructor = RelativeClock;\n\n RelativeClock.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), this._precision)\n };\n\n var rc = new RelativeClock({\n template: \"h:m:s\",\n precision: 10000\n })\n rc.start()\n}","Schedule(){ren\n \tconsole.log(\"schedule\");\n \tif (this.flights.length == 0 )ren\n \t\treturn new Date();Charlie\n \tlet candidato = new Candidate();\n \tfor (let i = 0; i < this.flights.length; i++) {\n \t\tlet actualDate = newCharlie Date(this.flights[i].getTime() + 60000*10);\n \t\tif (this.CouldScheduleAt(actualDate)){\n \t\t\tconsole.log(actualDate.toLocaleTimeString());\n \t\t\treturn true;\n \t\t}\n \t\telse{\n \t\t\tactualDate = new Date(this.flights[i].getTime() - 60000*10);\n \t\t\tif (this.CouldScheduleAt(actualDate)){\n \t\t\t\tconsole.log(actualDate.toLocaleTimeString());\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t\tif (i == this.flights.length - 1 ){\n \t\t\tconsole.log(actualDate.toLocaleTimeString());\n \t\t\treturn false;\n \t\t}ren\n \t}\n\n }","function cronometro () { \n timeActual = new Date();\n acumularTime = timeActual - timeInicial;\n acumularTime2 = new Date();\n acumularTime2.setTime(acumularTime);\n ss = acumularTime2.getSeconds();\n mm = acumularTime2.getMinutes();\n hh = acumularTime2.getHours()-21;\n if (ss < 10) {ss = \"0\"+ss;} \n if (mm < 10) {mm = \"0\"+mm;}\n if (hh < 10) {hh = \"0\"+hh;}\n timer.innerHTML = hh+\" : \"+mm+\" : \"+ss;\n}","getSchedule(){\n // return CRON schedule format\n // this sample job runs every 15 seconds\n return '*/15 * * * * *';\n }","_scheduleEvents() {\n let now = clock.now();\n // number of events to schedule variaes based on the day of the week\n let dow = now.getDay();\n let numberOfEvents = (dow === 0 || dow === 7) ? this.weekendFrequency : this.weekDayFrequency;\n for (let i = 0; i < numberOfEvents; i++) {\n this.events.push(now.getTime() + Math.random() * MILLISECONDS_IN_DAY);\n }\n // sort ascending so we can quickly figure out the next time to run\n // after running, we'll remove it from the queue\n this.events.sort((a, b) => a - b);\n }","static async _schedule() {\n\t\t// Register the task definition first\n\t\tconsole.log(\"SCHEDULE 1) Register Task Definition\");\n\t\tconst taskDefinition = await ECSManager.registerTaskDefinition();\n\t\tconst taskDefinitionArn = taskDefinition.taskDefinition.taskDefinitionArn;\n\n\t\t// Register a Cloudwatch event for this task definition as a cron job\n\t\tconsole.log(\"SCHEDULE 2) Register CloudWatch event\")\n\t\tconst targetSchedule = await CloudWatchManager.registerEvent(taskDefinitionArn);\n\t\treturn targetSchedule;\n\t}","UnscheduleAt(time){\n \tconsole.log(\"unschedule\");\n }","function schedule () {\n var future = next()\n var delta = Math.max(future.diff(moment()), 1000)\n\n debug(name + ': next run in ' + ms(delta) +\n ' at ' + future.format('llll Z'))\n\n if (timer) clearTimeout(timer)\n timer = setTimeout(run, delta)\n }","function tickTheClock(){\n\n \n \n}","computeNextExecution(task) {\n /**\n * If schedule is a number it means we are executing\n * on a delay of `schedule` milliseconds\n */\n if (typeof task.schedule === 'number') return task.schedule;\n\n let options = extend({}, task.scheduleOptions);\n\n /**\n * For testing etc we can specify a current date\n */\n if (!options.currentDate) {\n options.currentDate = DateTime.utc().toJSDate();\n }\n\n const interval = cron.parseExpression(task.schedule, options);\n\n const next = options.iterator ? interval.next().value.toDate() : interval.next().toDate();\n\n let now;\n\n if (task.scheduleOptions.tz) {\n DateTime.now().setZone(task.scheduleOptions.tz)\n } else {\n now = DateTime.utc().toJSDate()\n }\n\n //TODO: we should check the TTL, it should always be positive!\n let ttl = next.getTime() - now.getTime()\n\n return {\n ttl,\n interval,\n time: next.toLocaleTimeString(),\n };\n }","onSleepingTime() {\n throw new NotImplementedException();\n }","function Stopwatch() {}","function Time() {}","static cron(options) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_applicationautoscaling_CronOptions(options);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.cron);\n }\n throw error;\n }\n if (options.weekDay !== undefined && options.day !== undefined) {\n throw new Error('Cannot supply both \\'day\\' and \\'weekDay\\', use at most one');\n }\n const minute = fallback(options.minute, '*');\n const hour = fallback(options.hour, '*');\n const month = fallback(options.month, '*');\n const year = fallback(options.year, '*');\n // Weekday defaults to '?' if not supplied. If it is supplied, day must become '?'\n const day = fallback(options.day, options.weekDay !== undefined ? '?' : '*');\n const weekDay = fallback(options.weekDay, '?');\n return new class extends Schedule {\n constructor() {\n super(...arguments);\n this.expressionString = `cron(${minute} ${hour} ${day} ${month} ${weekDay} ${year})`;\n }\n _bind(scope) {\n if (!options.minute) {\n core_1.Annotations.of(scope).addWarning('cron: If you don\\'t pass \\'minute\\', by default the event runs every minute. Pass \\'minute: \\'*\\'\\' if that\\'s what you intend, or \\'minute: 0\\' to run once per hour instead.');\n }\n return new LiteralSchedule(this.expressionString);\n }\n };\n }","function TimeScheduler() {\n this.timer = new Timer();\n\n /**\n * Holds an Array of timeouts : [timeout time, callback function]\n */\n this.timeouts = [];\n this.nTimeouts = 0;\n /**\n * Holds an Array of intervals : [interval starting time, interval time, callback function]\n */\n this.intervals = [];\n this.nIntervals = 0;\n\n this.clear();\n this.reset();\n }","function sched () {\n pub()\n .then(function() {\n return Useful.handyTimer(ns.settings.redisSyncFrequency);\n }) \n .then(function() {\n sched();\n });\n }","function schedule(elapsed) {\n\t self.state = SCHEDULED;\n\t if (self.delay <= elapsed) start(elapsed - self.delay);\n\t else self.timer.restart(start, self.delay, self.time);\n\t }","function schedule(elapsed) {\n\t self.state = SCHEDULED;\n\t if (self.delay <= elapsed) start(elapsed - self.delay);\n\t else self.timer.restart(start, self.delay, self.time);\n\t }","function schedule(elapsed) {\n\t self.state = SCHEDULED;\n\t if (self.delay <= elapsed) start(elapsed - self.delay);\n\t else self.timer.restart(start, self.delay, self.time);\n\t }","function task3 () {\n //\n function Clock(options) {\n var template = options.template;\n var timer;\n \n function render() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\n console.log(output);\n }\n this.stop = function() {\n clearInterval(timer);\n };\n this.start = function() {\n render();\n timer = setInterval(render, 1000);\n }\n }\n \n var cf = new Clock({\n template: 'h:m:s'\n });\n // cf.start();\n\n\n function ClockP (options) {\n this._template = options.template\n this._timer = null\n }\n\n ClockP.prototype.render = function() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = this._template.replace('h', hours)\n .replace('m', min)\n .replace('s', sec);\n console.log(output);\n };\n\n ClockP.prototype.stop = function () {\n clearInterval(this._timer)\n }\n\n ClockP.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), 1000)\n };\n\n var cp = new ClockP({\n template: 'h:m:s'\n });\n cp.start();\n\n}","function timeTest()\r\n{\r\n}","function manualSchedule() {\r\n streamController_.manualSchedule();\r\n }","function Scheduler(guild_id) {\n\tlet timeRule, timeJob, midnightRule, midnightJob;\n\tfunction init(time = \"00:00\", timezone, timeCommand, midnightCommand) {\n\t\ttimeRule = new schedule.RecurrenceRule();\n\t\tmidnightRule = new schedule.RecurrenceRule();\n\t\tif (timezone) {\n\t\t\ttimeRule.tz = timezone;\n\t\t\tmidnightRule.tz = timezone;\n\t\t}\n\t\t[timeRule.hour, timeRule.minute] = time.split(\":\").map(part => part * 1);\n\t\ttimeJob = schedule.scheduleJob(timeRule, (time) => {\n\t\t\ttry {\n\t\t\t\ttimeCommand(guild_id, time);\n\t\t\t} catch(e) {\n\t\t\t\tconsole.error(guild_id, time, e);\n\t\t\t}\n\t\t});\n\t\t[midnightRule.hour, midnightRule.minute] = [0, 0];\n\t\tmidnightJob = schedule.scheduleJob(midnightRule, (time) => {\n\t\t\ttry {\n\t\t\t\tmidnightCommand(guild_id, time);\n\t\t\t} catch(e) {\n\t\t\t\tconsole.error(guild_id, time, e);\n\t\t\t}\n\t\t});\n\t}\n\tfunction setTimezone(timezone) {\n\t\ttimeRule.tz = timezone;\n\t\ttimeJob.reschedule(timeRule);\n\t\tmidnightRule.tz = timezone;\n\t\tmidnightJob.reschedule(midnightRule);\n\t}\n\tfunction setTime(time = \"00:00\") {\n\t\t[timeRule.hour, timeRule.minute] = time.split(\":\").map(part => part * 1);\n\t\ttimeJob.reschedule(timeRule);\n\t}\n\tfunction destroy() {\n\t\ttimeJob.cancel();\n\t\tmidnightJob.cancel();\n\t\tdelete schedulers[guild_id];\n\t}\n\treturn {\n\t\tinit,\n\t\tsetTimezone,\n\t\tsetTime,\n\t\tdestroy\n\t}\n}","run() {\n this.fillSportListAndTick();\n this.timerID = setInterval(() => {\n this.tick();\n console.log(\"ctr = \"+this.ctr);\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\n this.ctr = this.ctr + 1;\n } else {\n this.ctr = 1;\n }\n }, LIVE_TICK_INTERVAL);\n }","function updateTime() {\n\n}","chronoStart(){\n this.start = new Date();\n this.chrono();\n }","function intervalTasks() {\n calculateGreeting()\n displayTime()\n}","function schedule(elapsed) {\n self.state = SCHEDULED;\n if (self.delay <= elapsed) start(elapsed - self.delay);\n else self.timer.restart(start, self.delay, self.time);\n }","startTimer() {\n this.startTime = Date.now();\n }","createTimer() {\n\t\t// set initial in seconds\n\t\tthis.initialTime = 0;\n\n\t\t// display text on Axis with formated Time\n\t\tthis.text = this.add.text(\n\t\t\t16,\n\t\t\t50,\n\t\t\t\"Time: \" + this.formatTime(this.initialTime)\n\t\t);\n\n\t\t// Each 1000 ms call onEvent\n\t\tthis.timedEvent = this.time.addEvent({\n\t\t\tdelay: 1000,\n\t\t\tcallback: this.onEvent,\n\t\t\tcallbackScope: this,\n\t\t\tloop: true,\n\t\t});\n\t}","function runScheduler()\n{\n schedulerTick();\n setTimeout(runScheduler, scheduler_tick_interval);\n}","get startTime() { return this._startTime; }","function schedulePlan()\r\n{\r\n\tvar url = \"scheduled\";\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\r\n\tsectionName = objAjax.getDivSectionId();\r\n\t//alert(\"sectionName \" + sectionName);\r\n\tif(objAjax && objHTMLData)\r\n\t{\r\n\t\tif(!isValidRecord(true))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tbShowMsg = true;\r\n\t Main.loadWorkArea(\"techspecevents.do\", url);\t \r\n\t}\r\n}","ticker() {\n if (!this.paused) {\n // Increment the tick counter:\n this.ticks++;\n this.scheduler();\n const _this = this;\n this._tickTimeout = setTimeout(() => {\n _this.ticker();\n }, this.__defaultInterval);\n }\n }","overTime(){\n\t\t//\n\t}","scheduleRefresh() {}","scheduleRefresh() {}","async flowSetupHook(flow) {\n /*\n EDEN TRIGGERS\n */\n\n // do initial triggers\n flow.trigger('cron', {\n icon : 'fa fa-clock',\n title : 'Date/Time',\n }, (action, render) => {\n\n }, (run, cancel, query) => {\n // set interval for query\n setInterval(async () => {\n // set query\n const q = query.lte('execute_at', new Date());\n\n // run with query\n await run({\n query : q,\n value : {},\n });\n }, 5000);\n }, (element, flowModel) => {\n // days\n const days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];\n\n // parse next date\n const previous = flowModel.get('executed_at') || new Date();\n let next = moment();\n\n // set time\n if (element.time) {\n // set time\n next.set({\n hour : parseInt(element.time.split(':')[0], 10),\n minute : parseInt(element.time.split(':')[1], 10),\n second : 0,\n });\n }\n\n // set day\n if (element.when === 'week') {\n // set next\n next = next.day(days.indexOf((element.day || 'monday').toLowerCase()) + 1);\n }\n\n // check last executed\n if (next.toDate() < new Date()) {\n // set day\n if (element.when === 'week') {\n // add one week\n next = next.add(7, 'days');\n } else if (element.when === 'month') {\n // add\n next = next.add(1, 'months');\n }\n }\n\n // set values\n flowModel.set('executed_at', previous);\n flowModel.set('execute_at', next.toDate());\n }, (data, flowModel) => {\n // check when\n if (flowModel.get('trigger.data.when') === 'week') {\n // set execute at\n flowModel.set('execute_at', moment(flowModel.get('execute_at')).add(7, 'days').toDate());\n } else if (flow.get('trigger.data.when') === 'month') {\n // set execute at\n flowModel.set('execute_at', moment(flowModel.get('execute_at')).add(1, 'month').toDate());\n }\n\n // set executed at\n flowModel.set('executed_at', new Date());\n });\n flow.trigger('hook', {\n icon : 'fa fa-play',\n title : 'Named Hook',\n }, (action, render) => {\n\n }, (run, cancel, query) => {\n // execute function\n const execute = (...subArgs) => {\n // find hook/type\n const { hook, type } = subArgs.find(s => s.hook && s.type);\n\n // check\n if (!hook || !type) return;\n\n // create trigger object\n const data = {\n opts : { type, hook, when : type === 'pre' ? 'before' : 'after' },\n value : { args : subArgs },\n query : query.where({\n 'trigger.data.when' : type === 'pre' ? 'before' : 'after',\n 'trigger.data.hook' : hook,\n }),\n };\n\n // run trigger\n run(data);\n };\n\n // add hooks\n this.eden.pre('*', execute);\n this.eden.post('*', execute);\n });\n flow.trigger('event', {\n icon : 'fa fa-calendar-exclamation',\n title : 'Named Event',\n }, (action, render) => {\n\n }, (run, cancel, query) => {\n // execute function\n const execute = (...subArgs) => {\n // find hook/type\n const { event } = subArgs.find(s => s.event);\n\n // check\n if (!event) return;\n\n // create trigger object\n const data = {\n opts : { event },\n value : { args : subArgs },\n query : query.where({\n 'trigger.data.event' : event,\n }),\n };\n\n // run trigger\n run(data);\n };\n\n // add hooks\n this.eden.on('*', execute);\n });\n flow.trigger('model', {\n icon : 'fa fa-calendar-exclamation',\n title : 'Model Change',\n }, (action, render) => {\n\n }, (run, cancel, query) => {\n // execute function\n const execute = (model, a, b) => {\n // check model\n if (!(model instanceof Model)) return;\n\n // set vars\n let hook;\n let type;\n\n // chec vars\n if (!b) {\n hook = a.hook;\n type = a.type;\n } else {\n hook = b.hook;\n type = b.type;\n }\n\n // check\n if (!hook || !type) return;\n\n // get model type\n const modelName = hook.split('.')[0];\n const updateType = hook.split('.')[1];\n\n // create trigger object\n const data = {\n opts : { type : updateType, name : modelName, when : type === 'pre' ? 'before' : 'after' },\n value : { model },\n query : query.where({\n 'trigger.data.when' : type === 'pre' ? 'before' : 'after',\n 'trigger.data.model' : modelName,\n 'trigger.data.event' : updateType,\n }),\n };\n\n // run trigger\n run(data);\n };\n\n // add hooks\n this.eden.pre('*.update', execute);\n this.eden.pre('*.remove', execute);\n this.eden.pre('*.create', execute);\n this.eden.post('*.update', execute);\n this.eden.post('*.remove', execute);\n this.eden.post('*.create', execute);\n });\n flow.trigger('value', {\n icon : 'fa fa-calendar-exclamation',\n title : 'Model Value',\n }, (action, render) => {\n\n }, (run, cancel, query) => {\n\n });\n\n /*\n EDEN ACTIONS\n */\n // do initial actions\n flow.action('event.trigger', {\n tag : 'event',\n icon : 'fa fa-play',\n title : 'Trigger Event',\n }, (action, render) => {\n\n }, (opts, element, data) => {\n // trigger event\n if ((element.config || {}).event) {\n // trigger event\n this.eden.emit(`flow:event.${element.config.event}`, data);\n }\n\n // return true\n return true;\n });\n // do initial actions\n flow.action('email.send', {\n tag : 'email',\n icon : 'fa fa-envelope',\n title : 'Send Email',\n }, (action, render) => {\n\n }, async (opts, element, data) => {\n // set config\n element.config = element.config || {};\n\n // clone data\n const newData = Object.assign({}, data);\n\n // send model\n if (newData.model instanceof Model) {\n // sanitise model\n newData.model = await newData.model.sanitise();\n }\n\n // send email\n await emailHelper.send((tmpl.tmpl(element.config.to || '', newData)).split(',').map(i => i.trim()), 'blank', {\n body : tmpl.tmpl(element.config.body || '', newData),\n subject : tmpl.tmpl(element.config.subject || '', newData),\n });\n\n // return true\n return true;\n });\n flow.action('hook.trigger', {\n tag : 'hook',\n icon : 'fa fa-calendar-exclamation',\n title : 'Trigger Hook',\n }, (action, render) => {\n\n }, async (opts, element, ...args) => {\n // trigger event\n if ((element.config || {}).hook) {\n // trigger event\n await this.eden.hook(`flow:hook.${element.config.hook}`, ...args);\n }\n\n // return true\n return true;\n });\n flow.action('model.query', {\n tag : 'model-query',\n icon : 'fa fa-plus',\n title : 'Find Model(s)',\n }, (action, render) => {\n\n }, async (opts, element, data) => {\n // query for data\n const Model = model(element.config.model);\n\n // create query\n let query = Model;\n\n // sanitise model\n if (data.model) data.model = await data.model.sanitise();\n\n // loop queries\n element.config.queries.forEach((q) => {\n // get values\n const { method, type } = q;\n let { key, value } = q;\n\n // data\n key = tmpl.tmpl(key, data);\n value = tmpl.tmpl(value, data);\n\n // check type\n if (type === 'number') {\n // parse\n value = parseFloat(value);\n } else if (type === 'boolean') {\n // set value\n value = value.toLowerCase() === 'true';\n }\n\n // add to query\n if (method === 'eq' || !method) {\n // query\n query = query.where({\n [key] : value,\n });\n } else if (['gt', 'lt'].includes(method)) {\n // set gt/lt\n query = query[method](key, value);\n } else if (method === 'ne') {\n // not equal\n query = query.ne(key, value);\n }\n });\n\n // return true\n return (await query.limit(element.config.count || 1).find()).map((item) => {\n // clone data\n const cloneData = Object.assign({}, data, {\n model : item,\n }, {});\n\n // return clone data\n return cloneData;\n });\n });\n flow.action('model.set', {\n tag : 'model-set',\n icon : 'fa fa-plus',\n title : 'Set Value',\n }, (action, render) => {\n\n }, async (opts, element, { model }) => {\n // sets\n element.config.sets.forEach((set) => {\n // set values\n let { value } = set;\n const { key, type } = set;\n\n // check type\n if (type === 'number') {\n // parse\n value = parseFloat(value);\n } else if (type === 'boolean') {\n // set value\n value = value.toLowerCase() === 'true';\n }\n\n // set\n model.set(key, value);\n });\n\n // save toSet\n await model.save();\n\n // return true\n return true;\n });\n flow.action('model.clone', {\n tag : 'model-clone',\n icon : 'fa fa-copy',\n title : 'Clone Model',\n }, (action, render) => {\n\n }, async (opts, element, data) => {\n // got\n const got = data.model.get();\n delete got._id;\n\n // new model\n const NewModel = model(data.model.constructor.name);\n const newModel = new NewModel(got);\n\n // set new model\n data.model = newModel;\n\n // return true\n return true;\n });\n flow.action('delay', {\n tag : 'delay',\n icon : 'fa fa-stopwatch',\n color : 'info',\n title : 'Time Delay',\n }, (action, render) => {\n\n }, (opts, element, data) => {\n return true;\n });\n\n // boolean check\n const filterCheck = async (opts, element, model) => {\n // set config\n element.config = element.config || {};\n\n // check model\n if ((element.config.type || 'value') === 'code') {\n // safe eval code\n return !!safeEval(element.config.code, model);\n }\n\n // get value\n let value = model[element.config.of];\n const is = element.config.is || 'eq';\n\n // check model\n if (model instanceof Model) {\n // get value from model\n value = await model.get(element.config.of);\n }\n\n // check\n if (is === 'eq' && value !== element.config.value) {\n // return false\n return false;\n }\n if (is === 'ne' && value === element.config.value) {\n // return false\n return false;\n }\n if (is === 'gt' && value < element.config.value) {\n // return false\n return false;\n }\n if (is === 'lt' && value > element.config.value) {\n // return false\n return false;\n }\n\n // return false at every opportunity\n return true;\n };\n\n // do initial logics\n flow.action('filter', {\n tag : 'filter',\n icon : 'fa fa-filter',\n color : 'warning',\n title : 'Conditional Filter',\n }, (action, render) => {\n\n }, filterCheck);\n flow.action('condition.split', {\n tag : 'split',\n icon : 'fa fa-code-merge',\n color : 'warning',\n title : 'Conditional Split',\n }, (action, render) => {\n\n }, async (opts, element, ...args) => {\n // set go\n const go = await filterCheck(opts, element, ...args);\n\n // get children\n const children = (element.children || [])[go ? 0 : 1] || [];\n\n // await trigger\n await FlowHelper.run(opts.flow, children, opts, ...args);\n\n // return true\n return true;\n });\n }","eventTimer() {throw new Error('Must declare the function')}","function tickTime() {\n // the magic object with all the time data\n // the present passing current moment\n let pc = {\n thisMoment: {},\n current: {},\n msInA: {},\n utt: {},\n passage: {},\n display: {}\n };\n\n // get the current time\n pc.thisMoment = {};\n pc.thisMoment = new Date();\n\n // slice current time into units\n pc.current = {\n ms: pc.thisMoment.getMilliseconds(),\n second: pc.thisMoment.getSeconds(),\n minute: pc.thisMoment.getMinutes(),\n hour: pc.thisMoment.getHours(),\n day: pc.thisMoment.getDay(),\n date: pc.thisMoment.getDate(),\n week: weekOfYear(pc.thisMoment),\n month: pc.thisMoment.getMonth(),\n year: pc.thisMoment.getFullYear()\n };\n\n // TODO: display day of week and month name\n let dayOfWeek = DAYS[pc.current.day];\n let monthName = MONTHS[pc.current.month];\n\n // returns the week no. out of the year\n function weekOfYear(d) {\n d.setHours(0, 0, 0);\n d.setDate(d.getDate() + 4 - (d.getDay() || 7));\n return Math.ceil(((d - new Date(d.getFullYear(), 0, 1)) / 8.64e7 + 1) / 7);\n }\n\n // set the slice conversions based on pc.thisMoment\n pc.msInA.ms = 1;\n pc.msInA.second = 1000;\n pc.msInA.minute = pc.msInA.second * 60;\n pc.msInA.hour = pc.msInA.minute * 60;\n pc.msInA.day = pc.msInA.hour * 24;\n pc.msInA.week = pc.msInA.day * 7;\n pc.msInA.month = pc.msInA.day * MONTH_DAYS[pc.current.month - 1];\n pc.msInA.year = pc.msInA.day * daysThisYear(pc.current.year);\n\n // handle leap years\n function daysThisYear(year) {\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n MONTH_DAYS[1] = 29;\n return 366;\n } else {\n return 365;\n }\n }\n\n // utt means UpToThis\n // calculates the count in ms of each unit that has passed\n pc.utt.ms = pc.current.ms;\n pc.utt.second = pc.current.second * pc.msInA.second + pc.utt.ms;\n pc.utt.minute = pc.current.minute * pc.msInA.minute + pc.utt.second;\n pc.utt.hour = pc.current.hour * pc.msInA.hour + pc.utt.minute;\n pc.utt.day = pc.current.day * pc.msInA.day + pc.utt.hour;\n pc.utt.week = pc.current.week * pc.msInA.week + pc.utt.day;\n pc.utt.date = pc.current.date * pc.msInA.day + pc.utt.hour;\n pc.utt.month = pc.current.month + 1 * pc.msInA.month + pc.utt.date;\n pc.utt.year = pc.current.year * pc.msInA.year + pc.utt.month;\n\n // calculates the proportion/ratio of each unit that has passed\n // used to display percentages\n pc.passage = {\n ms: pc.current.ms / 100,\n second: pc.current.ms / pc.msInA.second,\n minute: pc.utt.second / pc.msInA.minute,\n hour: pc.utt.minute / pc.msInA.hour,\n day: pc.utt.hour / pc.msInA.day,\n week: pc.utt.day / pc.msInA.week,\n month: pc.utt.date / pc.msInA.month,\n year: pc.utt.month / pc.msInA.year\n };\n\n // tidies up the current clock readouts for display\n pc.display = {\n ms: pc.utt.ms,\n second: pc.current.second,\n minute: pc.current.minute.toString().padStart(2, \"0\"),\n hour: pc.current.hour.toString().padStart(2, \"0\"),\n day: pc.current.date,\n week: pc.current.week,\n month: pc.current.month.toString().padStart(2, \"0\"),\n year: pc.current.year\n };\n\n if (debug) {\n console.dir(pc);\n }\n\n // returns the ratios and the clock readouts\n return { psg: pc.passage, dsp: pc.display };\n}","get isStartable() { return (Now < this.endTime.plus(minutes(60))) && (Now > this.startTime.minus(minutes(60))) }","update(timeStep) {\n\n }","isScheduled() {\r\n return this.timeoutToken !== -1;\r\n }","static cron(options) {\n if (options.weekDay !== undefined && options.day !== undefined) {\n throw new Error('Cannot supply both \\'day\\' and \\'weekDay\\', use at most one');\n }\n const minute = fallback(options.minute, '*');\n const hour = fallback(options.hour, '*');\n const month = fallback(options.month, '*');\n const day = fallback(options.day, '*');\n const weekDay = fallback(options.weekDay, '*');\n return new LiteralSchedule(`${minute} ${hour} ${day} ${month} ${weekDay}`);\n }","_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }","_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }","handler() {\n this.totalMilliseconds = this.time;\n this.endTime = this.now() + this.time;\n\n if (this.autoStart) {\n this.start();\n }\n }","function RequestScheduler() {}","function tick() {\n setTime(howOld(createdOn));\n }","checkPeriodicalTasks() {\n // Now is now\n var now = new Date(this.time.getTime());\n\n // If the farm fields are valid\n if (window.game.farm && window.game.farm.farmFields) {\n // Go through each farm field\n window.game.farm.farmFields.forEach(function(farmField, i) {\n // If there's a seed planted on them\n if (farmField.seed && farmField.seedItem) {\n // Check on which stage they are by comparing the time and their different stages\n var currentStage = 0;\n farmField.stages.forEach(function(stage, index) {\n if (stage.getTime() <= now.getTime()) {\n currentStage = index + 1;\n }\n })\n\n // If the stage is above zero, update the farm field to actually receive the new stage\n if (currentStage > 0) {\n farmField.setStage(currentStage);\n }\n }\n });\n }\n\n // If the fruit trees are valid\n if (window.game.farm && window.game.farm.fruitTrees) {\n // Go through each fruit tree\n window.game.farm.fruitTrees.forEach(function(fruitTree, i) {\n // If the fruit tree has a next ripe time set and it should be ripe by now and it isn't locked, set it to be ripe\n if (fruitTree.nextRipe && fruitTree.nextRipe.getTime() <= now.getTime() && !fruitTree.isRipe && !fruitTree.isLocked) {\n fruitTree.setRipe(true);\n }\n })\n }\n\n // Check if we should update a season\n // Season dates are\n // 01.03 - spring\n // 01.06 - summer\n // 01.09 - autumn\n // 01.12 - winter\n var month = this.time.getMonth();\n\n // If the current month (months start from 0 in js) is dividable through 3 and seasons didn't change already\n if ((month+1) % 3 == 0 && !this.didSeasonChange) {\n // Trigger a season change\n window.game.map.nextSeason();\n\n // Set this flag so the if statement above won't be fired again\n this.didSeasonChange = true;\n } \n // Check if the month IS NOT dividable through 3 and the flag is set\n else if ((month+1) % 3 != 0 && this.didSeasonChange) {\n // in that case, we can safely reset it to let the first if statement fire next roud\n this.didSeasonChange = false;\n }\n\n // Check for crop growth every 3 seconds (real time!)\n setTimeout(this.checkPeriodicalTasks.bind(this), 3*1000);\n }","function $hs_schedule(args, onComplete, onException) {\n var f = args[0];\n var a = Array.prototype.slice.call(args, 1, args.length);\n $tr_Scheduler.start(new $tr_Jump(f.hscall, f, a), onComplete, onException);\n}","getStartTime() {\n return this.startTime;\n }","setupSchedule(){\n // setup the schedule\n\n SchedulerUtils.addInstructionsToSchedule(this);\n\n let n_trials = (this.practice)? constants.PRACTICE_LEN : 25;\n // added for feedback\n this.feedbacks = [];\n for(let i= 0;i daysInAMonth[this.month - 1]) {\n this.month += 1;\n this.day = 1;\n }\n\n }\n\n this.time = function() {\n \tvar month = this.month < 10 ? \"0\" + this.month : this.month;\n \tvar day = this.day < 10 ? \"0\" + this.day : this.day;\n console.log(`${this.year}-${month}-${day}`)\n }\n\n this.getTime = function() {\n var month = this.month < 10 ? \"0\" + this.month : this.month;\n \tvar day = this.day < 10 ? \"0\" + this.day : this.day;\n return `${this.year}-${month}-${day}`;\n }\n\n}","function calculateTime() {\n displayTime(Date.now() - startTime);\n}","twelveClock () {\n const shiftAM = () => this.#hour < 4\n ? eveningGreet.run()\n : morningGreet.run()\n\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\n ? eveningGreet.run()\n : afternoonGreet.run()\n\n return this.#shift === 'AM'\n ? shiftAM()\n : shiftPM()\n }","start() {\n // Run immediately..\n this.runUpdate();\n\n // .. then schedule 15 min interval\n timers.setInterval(() => {\n this.runUpdate();\n }, 900000);\n }","function schedule() {\n var now = new Date().getTime(), delta = now - lastCycleTime, timeout = (30 * 60 * 1000) - delta, then = new Date(now + timeout);\n if (timeout < 100) timeout = 100;\n setTimeout(start, timeout);\n console.log(\"\\nNext cycle time:\", then.toLocaleString());\n}","function updateTime(){\n setTimeContent(\"timer\");\n}","function runAndScheduleTask () {\n\t\ttask( scheduleNextExecution );\n\t}","tick() {\n let prevSecond = this.createDigits(this.vDigits(this.timeString()));\n\n this.checkAlarm();\n\n setTimeout(() => {\n this.get();\n this.update(cacheDOM.timeDisplay, this.createDigits(this.vDigits(this.timeString())), prevSecond);\n this.tick();\n }, 1000)\n }","getTime(){return this.time;}","function scheduler(part) {\n let relativeMod = relativeTime % part.loopTime,\n lookAheadMod = lookAheadTime % part.loopTime;\n\n if (lookAheadMod < relativeMod && part.iterator > 1) {\n part.iterator = 0;\n } \n\n while (part.iterator < part.schedule.length &&\n part.schedule[part.iterator].when < lookAheadMod) {\n\n part.queue(part.schedule[part.iterator].when - relativeMod);\n part.iterator += 1;\n }\n }","function scheduler(part) {\n let relativeMod = relativeTime % part.loopTime,\n lookAheadMod = lookAheadTime % part.loopTime;\n\n if (lookAheadMod < relativeMod && part.iterator > 1) {\n part.iterator = 0;\n } \n\n while (part.iterator < part.schedule.length &&\n part.schedule[part.iterator].when < lookAheadMod) {\n\n part.queue(part.schedule[part.iterator].when - relativeMod);\n part.iterator += 1;\n }\n }","resetSchedule() {\n this._scheduler.resetSchedule();\n }","function Timer() {}","tick() {\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::tick\");\t\n var timeNow = new Date().getTime();\n\n if (this.lastTime != 0)\n \tthis.elapsed = timeNow - this.lastTime;\n\n this.lastTime = timeNow;\n }","changeStartTime(startTime){\n this.startTime = startTime;\n }","applyWorkingTime(timeAxis) {\n const me = this,\n config = me._workingTime;\n\n if (config) {\n let hour = null; // Only use valid values\n\n if (config.fromHour >= 0 && config.fromHour < 24 && config.toHour > config.fromHour && config.toHour <= 24 && config.toHour - config.fromHour < 24) {\n hour = {\n from: config.fromHour,\n to: config.toHour\n };\n }\n\n let day = null; // Only use valid values\n\n if (config.fromDay >= 0 && config.fromDay < 7 && config.toDay > config.fromDay && config.toDay <= 7 && config.toDay - config.fromDay < 7) {\n day = {\n from: config.fromDay,\n to: config.toDay\n };\n }\n\n if (hour || day) {\n timeAxis.include = {\n hour,\n day\n };\n } else {\n // No valid rules, restore timeAxis\n timeAxis.include = null;\n }\n } else {\n // No rules, restore timeAxis\n timeAxis.include = null;\n }\n\n if (me.isPainted) {\n var _me$features$columnLi;\n\n // Refreshing header, which also recalculate tickSize and header data\n me.timeAxisColumn.refreshHeader(); // Update column lines\n\n (_me$features$columnLi = me.features.columnLines) === null || _me$features$columnLi === void 0 ? void 0 : _me$features$columnLi.refresh(); // Animate event changes\n\n me.refreshWithTransition();\n }\n }","now () {\n return this.t;\n }","applyWorkingTime(timeAxis) {\n const me = this,\n config = me._workingTime;\n\n if (config) {\n let hour = null;\n // Only use valid values\n if (\n config.fromHour >= 0 &&\n config.fromHour < 24 &&\n config.toHour > config.fromHour &&\n config.toHour <= 24 &&\n config.toHour - config.fromHour < 24\n ) {\n hour = { from: config.fromHour, to: config.toHour };\n }\n\n let day = null;\n // Only use valid values\n if (\n config.fromDay >= 0 &&\n config.fromDay < 7 &&\n config.toDay > config.fromDay &&\n config.toDay <= 7 &&\n config.toDay - config.fromDay < 7\n ) {\n day = { from: config.fromDay, to: config.toDay };\n }\n\n if (hour || day) {\n timeAxis.include = {\n hour,\n day\n };\n } else {\n // No valid rules, restore timeAxis\n timeAxis.include = null;\n }\n } else {\n // No rules, restore timeAxis\n timeAxis.include = null;\n }\n\n if (me.rendered) {\n // Refreshing header, which also recalculate tickSize and header data\n me.timeAxisColumn.refreshHeader();\n // Update column lines\n if (me.features.columnLines) {\n me.features.columnLines.drawLines();\n }\n\n // Animate event changes\n me.refreshWithTransition();\n }\n }","constructor(){\n this.startTime = 0;\n this.endTime = 0; \n this.running = 0;\n this.duration = 0;\n }","scheduleWatchMessages() {\n this.cronJob = schedule(checkFrequency, this.checkNewMessages.bind(this), {});\n }","function startTime() {\n var today = new Date();\n var hourNow = today.getHours();\n var h = formatHour(hourNow);\n var m = today.getMinutes();\n var ap = formatAmPm(hourNow);\n if(m==0) {\n writeDate();\n }\n m = checkTime(m);\n document.getElementById('clock').innerHTML = h + ':' + m + ap;\n var t = setTimeout(startTime, 10000);\n}","get_timeSet() {\n return this.liveFunc._timeSet;\n }","function Scheduler() {\n this.tasks = [];\n this.current_running = 0;\n this.enabled = false;\n this.running = {};\n}","function scheduleTick(rootContext,flags){var nothingScheduled=rootContext.flags===0/* Empty */;rootContext.flags|=flags;if(nothingScheduled&&rootContext.clean==_CLEAN_PROMISE){var res_1;rootContext.clean=new Promise(function(r){return res_1=r;});rootContext.scheduler(function(){if(rootContext.flags&1/* DetectChanges */){rootContext.flags&=~1/* DetectChanges */;tickRootContext(rootContext);}if(rootContext.flags&2/* FlushPlayers */){rootContext.flags&=~2/* FlushPlayers */;var playerHandler=rootContext.playerHandler;if(playerHandler){playerHandler.flushPlayers();}}rootContext.clean=_CLEAN_PROMISE;res_1(null);});}}","function TimeUtils() {}","function scheduleNextExecution () {\n\t\tif ( status == \"running\" ) {\n\t\t\ttimerId = setTimeout( runAndScheduleTask, interval );\n\t\t}\n\t}","timer() {\n this.sethandRotation('hour');\n this.sethandRotation('minute');\n this.sethandRotation('second');\n }","constructor() {\n /** Indicates if the clock is endend. */\n this.endedLocal = false;\n /** The duration between start and end of the clock. */\n this.diff = null;\n this.startTimeLocal = new Date();\n this.hrtimeLocal = process.hrtime();\n }","resume(){\n\t\tvar _self = this\n\t\tvar dur = new Date( _self.currentTime )\n\t\tthis.tick( dur.getUTCMinutes() )\n\t\tconsole.log(\"timer resumed\")\n\t}","function scheduler() {\n if (!play) {\n return;\n }\n while (nextNoteTime < context.currentTime + scheduleAheadTime) {\n commandList.forEach(function (c) {\n return c.play(cursor);\n });\n nextNote();\n }\n}","initChronometer() {\n let self = this;\n\n setInterval(() => {\n self.allDuration();\n }, 1000);\n\n }","function next(){ // runs current scheduled task and creates timeout to schedule next\n\t\tif(task !== null){ // is task scheduled??\n\t\t\ttask.func(); // run it\n\t\t\ttask = null; // clear task\n\t\t}\n\t\tif(queue.length > 0){ // are there any remain tasks??\n\t\t\ttask = queue.shift(); // yes set as next task\n\t\t\ttHandle = setTimeout(next,task.time) // schedual when\n\t\t}else{\n\t\t\tAPI.done = true;\n\t\t}\n\t}","function updateSchedule() {\n // clear all textblocks\n $(\"textarea\").empty();\n // check the time and formatting]\n styleSchedule(startHr, endHr);\n // insert the text items\n // i is the id of the textarea associated\n // with each hour on the schedule\n for (i = startHr; i <= endHr; i++) {\n indx = i - startHr;\n var nextEl = $(`#${i}`);\n nextEl.text(scheduleList[indx].task);\n }\n }","getTime(){\n this.time = millis();\n this.timeFromLast = this.time - this.timeUntilLast;\n\n this.lifeTime = this.time - this.startTime;\n \n \n }","function createTimeDrivenTriggers() {\n // Trigger every 6 hours.\n ScriptApp.newTrigger('myFunction')\n .timeBased()\n .everyHours(6)\n .create();\n // Trigger every Monday at 09:00.\n ScriptApp.newTrigger('myFunction')\n .timeBased()\n .onWeekDay(ScriptApp.WeekDay.MONDAY)\n .atHour(9)\n .create();\n}"],"string":"[\n \"ScheduleAt(time){\\n \\tconsole.log(\\\"scheduleprofecionales at\\\");\\n }\",\n \"scheduler() {\\n this.maybeTickSongChart();\\n\\n // When nextNoteTime (in the future) is near (gap is determined by \\n // scheduleAheadTime), schedule audio & visuals and advance to the next\\n // note.\\n while (this.nextNoteTime <\\n (this.audioContext.currentTime + this.scheduleAheadTime)) {\\n this.scheduleNote(this.current16thNote, this.nextNoteTime);\\n this.nextNote();\\n }\\n }\",\n \"function Schedule(options,element){return _super.call(this,options,element)||this;}\",\n \"constructor(schedule) {\\n\\n }\",\n \"static get schedule() {\\n // once every hour\\n return '* */1 * * *';\\n }\",\n \"function startTime() {\\n setTimer();\\n}\",\n \"static get schedule() {\\n // once every minute\\n return '0 0 10 1/1 * ? *'\\n }\",\n \"getSchedule() {\\n this.setRelativeTime();\\n return this.schedule;\\n }\",\n \"function Scheduler() {\\n this.clock = 0\\n this.upcoming_events = []\\n this.running = true\\n this.devices = {}\\n}\",\n \"get schedule() {\\n\\t\\treturn this.__schedule;\\n\\t}\",\n \"function __time($obj) {\\r\\n if (window.STATICCLASS_CALENDAR==null) {\\r\\n window.STATICCLASS_CALENDAR = __loadScript(\\\"CalendarTime\\\", 1);\\r\\n }\\r\\n window.STATICCLASS_CALENDAR.perform($obj);\\r\\n}\",\n \"function tickCurrentTimeEngine() {\\n\\n var d = new Date();\\n\\n currentHours = d.getHours();\\n currentMinutes = d.getMinutes();\\n currentSeconds = d.getSeconds();\\n\\n if (currentHours.toString().length == 1) {\\n choursDigit_1 = 0;\\n choursDigit_2 = currentHours;\\n }\\n else {\\n choursDigit_1 = parseInt(currentHours.toString().charAt(0), 10);\\n choursDigit_2 = parseInt(currentHours.toString().charAt(1), 10);\\n }\\n\\n if (currentMinutes.toString().length == 1) {\\n cminutesDigit_1 = 0;\\n cminutesDigit_2 = currentMinutes;\\n }\\n else {\\n cminutesDigit_1 = parseInt(currentMinutes.toString().charAt(0), 10);\\n cminutesDigit_2 = parseInt(currentMinutes.toString().charAt(1), 10);\\n }\\n\\n if (currentSeconds.toString().length == 1) {\\n csecondsDigit_1 = 0;\\n csecondsDigit_2 = currentSeconds;\\n }\\n else {\\n csecondsDigit_1 = parseInt(currentSeconds.toString().charAt(0), 10);\\n csecondsDigit_2 = parseInt(currentSeconds.toString().charAt(1), 10);\\n }\\n\\n tickCurrentTime = setTimeout(tickCurrentTimeEngine, timerCurrentTimeMiliSecs);\\n\\n return;\\n }\",\n \"function morning() {\\n // whole morning routine\\n}\",\n \"function task4 () {\\n\\n function Clock (options) {\\n this._template = options.template\\n }\\n \\n Clock.prototype.render = function() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = this._template.replace('h', hours)\\n .replace('m', min)\\n .replace('s', sec);\\n console.log(output);\\n };\\n\\n Clock.prototype.stop = function () {\\n clearInterval(this._timer)\\n }\\n\\n Clock.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), 1000)\\n };\\n\\n\\n\\n // Descendant\\n\\n function RelativeClock(options) {\\n Clock.apply(this, arguments) // coffee script super() :)\\n this._precision = options.precision || 1000\\n };\\n\\n RelativeClock.prototype = Object.create(Clock.prototype);\\n RelativeClock.prototype.constructor = RelativeClock;\\n\\n RelativeClock.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), this._precision)\\n };\\n\\n var rc = new RelativeClock({\\n template: \\\"h:m:s\\\",\\n precision: 10000\\n })\\n rc.start()\\n}\",\n \"Schedule(){ren\\n \\tconsole.log(\\\"schedule\\\");\\n \\tif (this.flights.length == 0 )ren\\n \\t\\treturn new Date();Charlie\\n \\tlet candidato = new Candidate();\\n \\tfor (let i = 0; i < this.flights.length; i++) {\\n \\t\\tlet actualDate = newCharlie Date(this.flights[i].getTime() + 60000*10);\\n \\t\\tif (this.CouldScheduleAt(actualDate)){\\n \\t\\t\\tconsole.log(actualDate.toLocaleTimeString());\\n \\t\\t\\treturn true;\\n \\t\\t}\\n \\t\\telse{\\n \\t\\t\\tactualDate = new Date(this.flights[i].getTime() - 60000*10);\\n \\t\\t\\tif (this.CouldScheduleAt(actualDate)){\\n \\t\\t\\t\\tconsole.log(actualDate.toLocaleTimeString());\\n \\t\\t\\t\\treturn true;\\n \\t\\t\\t}\\n \\t\\t}\\n \\t\\tif (i == this.flights.length - 1 ){\\n \\t\\t\\tconsole.log(actualDate.toLocaleTimeString());\\n \\t\\t\\treturn false;\\n \\t\\t}ren\\n \\t}\\n\\n }\",\n \"function cronometro () { \\n timeActual = new Date();\\n acumularTime = timeActual - timeInicial;\\n acumularTime2 = new Date();\\n acumularTime2.setTime(acumularTime);\\n ss = acumularTime2.getSeconds();\\n mm = acumularTime2.getMinutes();\\n hh = acumularTime2.getHours()-21;\\n if (ss < 10) {ss = \\\"0\\\"+ss;} \\n if (mm < 10) {mm = \\\"0\\\"+mm;}\\n if (hh < 10) {hh = \\\"0\\\"+hh;}\\n timer.innerHTML = hh+\\\" : \\\"+mm+\\\" : \\\"+ss;\\n}\",\n \"getSchedule(){\\n // return CRON schedule format\\n // this sample job runs every 15 seconds\\n return '*/15 * * * * *';\\n }\",\n \"_scheduleEvents() {\\n let now = clock.now();\\n // number of events to schedule variaes based on the day of the week\\n let dow = now.getDay();\\n let numberOfEvents = (dow === 0 || dow === 7) ? this.weekendFrequency : this.weekDayFrequency;\\n for (let i = 0; i < numberOfEvents; i++) {\\n this.events.push(now.getTime() + Math.random() * MILLISECONDS_IN_DAY);\\n }\\n // sort ascending so we can quickly figure out the next time to run\\n // after running, we'll remove it from the queue\\n this.events.sort((a, b) => a - b);\\n }\",\n \"static async _schedule() {\\n\\t\\t// Register the task definition first\\n\\t\\tconsole.log(\\\"SCHEDULE 1) Register Task Definition\\\");\\n\\t\\tconst taskDefinition = await ECSManager.registerTaskDefinition();\\n\\t\\tconst taskDefinitionArn = taskDefinition.taskDefinition.taskDefinitionArn;\\n\\n\\t\\t// Register a Cloudwatch event for this task definition as a cron job\\n\\t\\tconsole.log(\\\"SCHEDULE 2) Register CloudWatch event\\\")\\n\\t\\tconst targetSchedule = await CloudWatchManager.registerEvent(taskDefinitionArn);\\n\\t\\treturn targetSchedule;\\n\\t}\",\n \"UnscheduleAt(time){\\n \\tconsole.log(\\\"unschedule\\\");\\n }\",\n \"function schedule () {\\n var future = next()\\n var delta = Math.max(future.diff(moment()), 1000)\\n\\n debug(name + ': next run in ' + ms(delta) +\\n ' at ' + future.format('llll Z'))\\n\\n if (timer) clearTimeout(timer)\\n timer = setTimeout(run, delta)\\n }\",\n \"function tickTheClock(){\\n\\n \\n \\n}\",\n \"computeNextExecution(task) {\\n /**\\n * If schedule is a number it means we are executing\\n * on a delay of `schedule` milliseconds\\n */\\n if (typeof task.schedule === 'number') return task.schedule;\\n\\n let options = extend({}, task.scheduleOptions);\\n\\n /**\\n * For testing etc we can specify a current date\\n */\\n if (!options.currentDate) {\\n options.currentDate = DateTime.utc().toJSDate();\\n }\\n\\n const interval = cron.parseExpression(task.schedule, options);\\n\\n const next = options.iterator ? interval.next().value.toDate() : interval.next().toDate();\\n\\n let now;\\n\\n if (task.scheduleOptions.tz) {\\n DateTime.now().setZone(task.scheduleOptions.tz)\\n } else {\\n now = DateTime.utc().toJSDate()\\n }\\n\\n //TODO: we should check the TTL, it should always be positive!\\n let ttl = next.getTime() - now.getTime()\\n\\n return {\\n ttl,\\n interval,\\n time: next.toLocaleTimeString(),\\n };\\n }\",\n \"onSleepingTime() {\\n throw new NotImplementedException();\\n }\",\n \"function Stopwatch() {}\",\n \"function Time() {}\",\n \"static cron(options) {\\n try {\\n jsiiDeprecationWarnings.aws_cdk_lib_aws_applicationautoscaling_CronOptions(options);\\n }\\n catch (error) {\\n if (process.env.JSII_DEBUG !== \\\"1\\\" && error.name === \\\"DeprecationError\\\") {\\n Error.captureStackTrace(error, this.cron);\\n }\\n throw error;\\n }\\n if (options.weekDay !== undefined && options.day !== undefined) {\\n throw new Error('Cannot supply both \\\\'day\\\\' and \\\\'weekDay\\\\', use at most one');\\n }\\n const minute = fallback(options.minute, '*');\\n const hour = fallback(options.hour, '*');\\n const month = fallback(options.month, '*');\\n const year = fallback(options.year, '*');\\n // Weekday defaults to '?' if not supplied. If it is supplied, day must become '?'\\n const day = fallback(options.day, options.weekDay !== undefined ? '?' : '*');\\n const weekDay = fallback(options.weekDay, '?');\\n return new class extends Schedule {\\n constructor() {\\n super(...arguments);\\n this.expressionString = `cron(${minute} ${hour} ${day} ${month} ${weekDay} ${year})`;\\n }\\n _bind(scope) {\\n if (!options.minute) {\\n core_1.Annotations.of(scope).addWarning('cron: If you don\\\\'t pass \\\\'minute\\\\', by default the event runs every minute. Pass \\\\'minute: \\\\'*\\\\'\\\\' if that\\\\'s what you intend, or \\\\'minute: 0\\\\' to run once per hour instead.');\\n }\\n return new LiteralSchedule(this.expressionString);\\n }\\n };\\n }\",\n \"function TimeScheduler() {\\n this.timer = new Timer();\\n\\n /**\\n * Holds an Array of timeouts : [timeout time, callback function]\\n */\\n this.timeouts = [];\\n this.nTimeouts = 0;\\n /**\\n * Holds an Array of intervals : [interval starting time, interval time, callback function]\\n */\\n this.intervals = [];\\n this.nIntervals = 0;\\n\\n this.clear();\\n this.reset();\\n }\",\n \"function sched () {\\n pub()\\n .then(function() {\\n return Useful.handyTimer(ns.settings.redisSyncFrequency);\\n }) \\n .then(function() {\\n sched();\\n });\\n }\",\n \"function schedule(elapsed) {\\n\\t self.state = SCHEDULED;\\n\\t if (self.delay <= elapsed) start(elapsed - self.delay);\\n\\t else self.timer.restart(start, self.delay, self.time);\\n\\t }\",\n \"function schedule(elapsed) {\\n\\t self.state = SCHEDULED;\\n\\t if (self.delay <= elapsed) start(elapsed - self.delay);\\n\\t else self.timer.restart(start, self.delay, self.time);\\n\\t }\",\n \"function schedule(elapsed) {\\n\\t self.state = SCHEDULED;\\n\\t if (self.delay <= elapsed) start(elapsed - self.delay);\\n\\t else self.timer.restart(start, self.delay, self.time);\\n\\t }\",\n \"function task3 () {\\n //\\n function Clock(options) {\\n var template = options.template;\\n var timer;\\n \\n function render() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\\n console.log(output);\\n }\\n this.stop = function() {\\n clearInterval(timer);\\n };\\n this.start = function() {\\n render();\\n timer = setInterval(render, 1000);\\n }\\n }\\n \\n var cf = new Clock({\\n template: 'h:m:s'\\n });\\n // cf.start();\\n\\n\\n function ClockP (options) {\\n this._template = options.template\\n this._timer = null\\n }\\n\\n ClockP.prototype.render = function() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = this._template.replace('h', hours)\\n .replace('m', min)\\n .replace('s', sec);\\n console.log(output);\\n };\\n\\n ClockP.prototype.stop = function () {\\n clearInterval(this._timer)\\n }\\n\\n ClockP.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), 1000)\\n };\\n\\n var cp = new ClockP({\\n template: 'h:m:s'\\n });\\n cp.start();\\n\\n}\",\n \"function timeTest()\\r\\n{\\r\\n}\",\n \"function manualSchedule() {\\r\\n streamController_.manualSchedule();\\r\\n }\",\n \"function Scheduler(guild_id) {\\n\\tlet timeRule, timeJob, midnightRule, midnightJob;\\n\\tfunction init(time = \\\"00:00\\\", timezone, timeCommand, midnightCommand) {\\n\\t\\ttimeRule = new schedule.RecurrenceRule();\\n\\t\\tmidnightRule = new schedule.RecurrenceRule();\\n\\t\\tif (timezone) {\\n\\t\\t\\ttimeRule.tz = timezone;\\n\\t\\t\\tmidnightRule.tz = timezone;\\n\\t\\t}\\n\\t\\t[timeRule.hour, timeRule.minute] = time.split(\\\":\\\").map(part => part * 1);\\n\\t\\ttimeJob = schedule.scheduleJob(timeRule, (time) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\ttimeCommand(guild_id, time);\\n\\t\\t\\t} catch(e) {\\n\\t\\t\\t\\tconsole.error(guild_id, time, e);\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\t[midnightRule.hour, midnightRule.minute] = [0, 0];\\n\\t\\tmidnightJob = schedule.scheduleJob(midnightRule, (time) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tmidnightCommand(guild_id, time);\\n\\t\\t\\t} catch(e) {\\n\\t\\t\\t\\tconsole.error(guild_id, time, e);\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\\n\\tfunction setTimezone(timezone) {\\n\\t\\ttimeRule.tz = timezone;\\n\\t\\ttimeJob.reschedule(timeRule);\\n\\t\\tmidnightRule.tz = timezone;\\n\\t\\tmidnightJob.reschedule(midnightRule);\\n\\t}\\n\\tfunction setTime(time = \\\"00:00\\\") {\\n\\t\\t[timeRule.hour, timeRule.minute] = time.split(\\\":\\\").map(part => part * 1);\\n\\t\\ttimeJob.reschedule(timeRule);\\n\\t}\\n\\tfunction destroy() {\\n\\t\\ttimeJob.cancel();\\n\\t\\tmidnightJob.cancel();\\n\\t\\tdelete schedulers[guild_id];\\n\\t}\\n\\treturn {\\n\\t\\tinit,\\n\\t\\tsetTimezone,\\n\\t\\tsetTime,\\n\\t\\tdestroy\\n\\t}\\n}\",\n \"run() {\\n this.fillSportListAndTick();\\n this.timerID = setInterval(() => {\\n this.tick();\\n console.log(\\\"ctr = \\\"+this.ctr);\\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\\n this.ctr = this.ctr + 1;\\n } else {\\n this.ctr = 1;\\n }\\n }, LIVE_TICK_INTERVAL);\\n }\",\n \"function updateTime() {\\n\\n}\",\n \"chronoStart(){\\n this.start = new Date();\\n this.chrono();\\n }\",\n \"function intervalTasks() {\\n calculateGreeting()\\n displayTime()\\n}\",\n \"function schedule(elapsed) {\\n self.state = SCHEDULED;\\n if (self.delay <= elapsed) start(elapsed - self.delay);\\n else self.timer.restart(start, self.delay, self.time);\\n }\",\n \"startTimer() {\\n this.startTime = Date.now();\\n }\",\n \"createTimer() {\\n\\t\\t// set initial in seconds\\n\\t\\tthis.initialTime = 0;\\n\\n\\t\\t// display text on Axis with formated Time\\n\\t\\tthis.text = this.add.text(\\n\\t\\t\\t16,\\n\\t\\t\\t50,\\n\\t\\t\\t\\\"Time: \\\" + this.formatTime(this.initialTime)\\n\\t\\t);\\n\\n\\t\\t// Each 1000 ms call onEvent\\n\\t\\tthis.timedEvent = this.time.addEvent({\\n\\t\\t\\tdelay: 1000,\\n\\t\\t\\tcallback: this.onEvent,\\n\\t\\t\\tcallbackScope: this,\\n\\t\\t\\tloop: true,\\n\\t\\t});\\n\\t}\",\n \"function runScheduler()\\n{\\n schedulerTick();\\n setTimeout(runScheduler, scheduler_tick_interval);\\n}\",\n \"get startTime() { return this._startTime; }\",\n \"function schedulePlan()\\r\\n{\\r\\n\\tvar url = \\\"scheduled\\\";\\r\\n\\tvar htmlAreaObj = _getWorkAreaDefaultObj();\\r\\n\\tvar objAjax = htmlAreaObj.getHTMLAjax();\\r\\n\\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\\r\\n\\r\\n\\tsectionName = objAjax.getDivSectionId();\\r\\n\\t//alert(\\\"sectionName \\\" + sectionName);\\r\\n\\tif(objAjax && objHTMLData)\\r\\n\\t{\\r\\n\\t\\tif(!isValidRecord(true))\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn;\\r\\n\\t\\t}\\r\\n\\t\\tbShowMsg = true;\\r\\n\\t Main.loadWorkArea(\\\"techspecevents.do\\\", url);\\t \\r\\n\\t}\\r\\n}\",\n \"ticker() {\\n if (!this.paused) {\\n // Increment the tick counter:\\n this.ticks++;\\n this.scheduler();\\n const _this = this;\\n this._tickTimeout = setTimeout(() => {\\n _this.ticker();\\n }, this.__defaultInterval);\\n }\\n }\",\n \"overTime(){\\n\\t\\t//\\n\\t}\",\n \"scheduleRefresh() {}\",\n \"scheduleRefresh() {}\",\n \"async flowSetupHook(flow) {\\n /*\\n EDEN TRIGGERS\\n */\\n\\n // do initial triggers\\n flow.trigger('cron', {\\n icon : 'fa fa-clock',\\n title : 'Date/Time',\\n }, (action, render) => {\\n\\n }, (run, cancel, query) => {\\n // set interval for query\\n setInterval(async () => {\\n // set query\\n const q = query.lte('execute_at', new Date());\\n\\n // run with query\\n await run({\\n query : q,\\n value : {},\\n });\\n }, 5000);\\n }, (element, flowModel) => {\\n // days\\n const days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];\\n\\n // parse next date\\n const previous = flowModel.get('executed_at') || new Date();\\n let next = moment();\\n\\n // set time\\n if (element.time) {\\n // set time\\n next.set({\\n hour : parseInt(element.time.split(':')[0], 10),\\n minute : parseInt(element.time.split(':')[1], 10),\\n second : 0,\\n });\\n }\\n\\n // set day\\n if (element.when === 'week') {\\n // set next\\n next = next.day(days.indexOf((element.day || 'monday').toLowerCase()) + 1);\\n }\\n\\n // check last executed\\n if (next.toDate() < new Date()) {\\n // set day\\n if (element.when === 'week') {\\n // add one week\\n next = next.add(7, 'days');\\n } else if (element.when === 'month') {\\n // add\\n next = next.add(1, 'months');\\n }\\n }\\n\\n // set values\\n flowModel.set('executed_at', previous);\\n flowModel.set('execute_at', next.toDate());\\n }, (data, flowModel) => {\\n // check when\\n if (flowModel.get('trigger.data.when') === 'week') {\\n // set execute at\\n flowModel.set('execute_at', moment(flowModel.get('execute_at')).add(7, 'days').toDate());\\n } else if (flow.get('trigger.data.when') === 'month') {\\n // set execute at\\n flowModel.set('execute_at', moment(flowModel.get('execute_at')).add(1, 'month').toDate());\\n }\\n\\n // set executed at\\n flowModel.set('executed_at', new Date());\\n });\\n flow.trigger('hook', {\\n icon : 'fa fa-play',\\n title : 'Named Hook',\\n }, (action, render) => {\\n\\n }, (run, cancel, query) => {\\n // execute function\\n const execute = (...subArgs) => {\\n // find hook/type\\n const { hook, type } = subArgs.find(s => s.hook && s.type);\\n\\n // check\\n if (!hook || !type) return;\\n\\n // create trigger object\\n const data = {\\n opts : { type, hook, when : type === 'pre' ? 'before' : 'after' },\\n value : { args : subArgs },\\n query : query.where({\\n 'trigger.data.when' : type === 'pre' ? 'before' : 'after',\\n 'trigger.data.hook' : hook,\\n }),\\n };\\n\\n // run trigger\\n run(data);\\n };\\n\\n // add hooks\\n this.eden.pre('*', execute);\\n this.eden.post('*', execute);\\n });\\n flow.trigger('event', {\\n icon : 'fa fa-calendar-exclamation',\\n title : 'Named Event',\\n }, (action, render) => {\\n\\n }, (run, cancel, query) => {\\n // execute function\\n const execute = (...subArgs) => {\\n // find hook/type\\n const { event } = subArgs.find(s => s.event);\\n\\n // check\\n if (!event) return;\\n\\n // create trigger object\\n const data = {\\n opts : { event },\\n value : { args : subArgs },\\n query : query.where({\\n 'trigger.data.event' : event,\\n }),\\n };\\n\\n // run trigger\\n run(data);\\n };\\n\\n // add hooks\\n this.eden.on('*', execute);\\n });\\n flow.trigger('model', {\\n icon : 'fa fa-calendar-exclamation',\\n title : 'Model Change',\\n }, (action, render) => {\\n\\n }, (run, cancel, query) => {\\n // execute function\\n const execute = (model, a, b) => {\\n // check model\\n if (!(model instanceof Model)) return;\\n\\n // set vars\\n let hook;\\n let type;\\n\\n // chec vars\\n if (!b) {\\n hook = a.hook;\\n type = a.type;\\n } else {\\n hook = b.hook;\\n type = b.type;\\n }\\n\\n // check\\n if (!hook || !type) return;\\n\\n // get model type\\n const modelName = hook.split('.')[0];\\n const updateType = hook.split('.')[1];\\n\\n // create trigger object\\n const data = {\\n opts : { type : updateType, name : modelName, when : type === 'pre' ? 'before' : 'after' },\\n value : { model },\\n query : query.where({\\n 'trigger.data.when' : type === 'pre' ? 'before' : 'after',\\n 'trigger.data.model' : modelName,\\n 'trigger.data.event' : updateType,\\n }),\\n };\\n\\n // run trigger\\n run(data);\\n };\\n\\n // add hooks\\n this.eden.pre('*.update', execute);\\n this.eden.pre('*.remove', execute);\\n this.eden.pre('*.create', execute);\\n this.eden.post('*.update', execute);\\n this.eden.post('*.remove', execute);\\n this.eden.post('*.create', execute);\\n });\\n flow.trigger('value', {\\n icon : 'fa fa-calendar-exclamation',\\n title : 'Model Value',\\n }, (action, render) => {\\n\\n }, (run, cancel, query) => {\\n\\n });\\n\\n /*\\n EDEN ACTIONS\\n */\\n // do initial actions\\n flow.action('event.trigger', {\\n tag : 'event',\\n icon : 'fa fa-play',\\n title : 'Trigger Event',\\n }, (action, render) => {\\n\\n }, (opts, element, data) => {\\n // trigger event\\n if ((element.config || {}).event) {\\n // trigger event\\n this.eden.emit(`flow:event.${element.config.event}`, data);\\n }\\n\\n // return true\\n return true;\\n });\\n // do initial actions\\n flow.action('email.send', {\\n tag : 'email',\\n icon : 'fa fa-envelope',\\n title : 'Send Email',\\n }, (action, render) => {\\n\\n }, async (opts, element, data) => {\\n // set config\\n element.config = element.config || {};\\n\\n // clone data\\n const newData = Object.assign({}, data);\\n\\n // send model\\n if (newData.model instanceof Model) {\\n // sanitise model\\n newData.model = await newData.model.sanitise();\\n }\\n\\n // send email\\n await emailHelper.send((tmpl.tmpl(element.config.to || '', newData)).split(',').map(i => i.trim()), 'blank', {\\n body : tmpl.tmpl(element.config.body || '', newData),\\n subject : tmpl.tmpl(element.config.subject || '', newData),\\n });\\n\\n // return true\\n return true;\\n });\\n flow.action('hook.trigger', {\\n tag : 'hook',\\n icon : 'fa fa-calendar-exclamation',\\n title : 'Trigger Hook',\\n }, (action, render) => {\\n\\n }, async (opts, element, ...args) => {\\n // trigger event\\n if ((element.config || {}).hook) {\\n // trigger event\\n await this.eden.hook(`flow:hook.${element.config.hook}`, ...args);\\n }\\n\\n // return true\\n return true;\\n });\\n flow.action('model.query', {\\n tag : 'model-query',\\n icon : 'fa fa-plus',\\n title : 'Find Model(s)',\\n }, (action, render) => {\\n\\n }, async (opts, element, data) => {\\n // query for data\\n const Model = model(element.config.model);\\n\\n // create query\\n let query = Model;\\n\\n // sanitise model\\n if (data.model) data.model = await data.model.sanitise();\\n\\n // loop queries\\n element.config.queries.forEach((q) => {\\n // get values\\n const { method, type } = q;\\n let { key, value } = q;\\n\\n // data\\n key = tmpl.tmpl(key, data);\\n value = tmpl.tmpl(value, data);\\n\\n // check type\\n if (type === 'number') {\\n // parse\\n value = parseFloat(value);\\n } else if (type === 'boolean') {\\n // set value\\n value = value.toLowerCase() === 'true';\\n }\\n\\n // add to query\\n if (method === 'eq' || !method) {\\n // query\\n query = query.where({\\n [key] : value,\\n });\\n } else if (['gt', 'lt'].includes(method)) {\\n // set gt/lt\\n query = query[method](key, value);\\n } else if (method === 'ne') {\\n // not equal\\n query = query.ne(key, value);\\n }\\n });\\n\\n // return true\\n return (await query.limit(element.config.count || 1).find()).map((item) => {\\n // clone data\\n const cloneData = Object.assign({}, data, {\\n model : item,\\n }, {});\\n\\n // return clone data\\n return cloneData;\\n });\\n });\\n flow.action('model.set', {\\n tag : 'model-set',\\n icon : 'fa fa-plus',\\n title : 'Set Value',\\n }, (action, render) => {\\n\\n }, async (opts, element, { model }) => {\\n // sets\\n element.config.sets.forEach((set) => {\\n // set values\\n let { value } = set;\\n const { key, type } = set;\\n\\n // check type\\n if (type === 'number') {\\n // parse\\n value = parseFloat(value);\\n } else if (type === 'boolean') {\\n // set value\\n value = value.toLowerCase() === 'true';\\n }\\n\\n // set\\n model.set(key, value);\\n });\\n\\n // save toSet\\n await model.save();\\n\\n // return true\\n return true;\\n });\\n flow.action('model.clone', {\\n tag : 'model-clone',\\n icon : 'fa fa-copy',\\n title : 'Clone Model',\\n }, (action, render) => {\\n\\n }, async (opts, element, data) => {\\n // got\\n const got = data.model.get();\\n delete got._id;\\n\\n // new model\\n const NewModel = model(data.model.constructor.name);\\n const newModel = new NewModel(got);\\n\\n // set new model\\n data.model = newModel;\\n\\n // return true\\n return true;\\n });\\n flow.action('delay', {\\n tag : 'delay',\\n icon : 'fa fa-stopwatch',\\n color : 'info',\\n title : 'Time Delay',\\n }, (action, render) => {\\n\\n }, (opts, element, data) => {\\n return true;\\n });\\n\\n // boolean check\\n const filterCheck = async (opts, element, model) => {\\n // set config\\n element.config = element.config || {};\\n\\n // check model\\n if ((element.config.type || 'value') === 'code') {\\n // safe eval code\\n return !!safeEval(element.config.code, model);\\n }\\n\\n // get value\\n let value = model[element.config.of];\\n const is = element.config.is || 'eq';\\n\\n // check model\\n if (model instanceof Model) {\\n // get value from model\\n value = await model.get(element.config.of);\\n }\\n\\n // check\\n if (is === 'eq' && value !== element.config.value) {\\n // return false\\n return false;\\n }\\n if (is === 'ne' && value === element.config.value) {\\n // return false\\n return false;\\n }\\n if (is === 'gt' && value < element.config.value) {\\n // return false\\n return false;\\n }\\n if (is === 'lt' && value > element.config.value) {\\n // return false\\n return false;\\n }\\n\\n // return false at every opportunity\\n return true;\\n };\\n\\n // do initial logics\\n flow.action('filter', {\\n tag : 'filter',\\n icon : 'fa fa-filter',\\n color : 'warning',\\n title : 'Conditional Filter',\\n }, (action, render) => {\\n\\n }, filterCheck);\\n flow.action('condition.split', {\\n tag : 'split',\\n icon : 'fa fa-code-merge',\\n color : 'warning',\\n title : 'Conditional Split',\\n }, (action, render) => {\\n\\n }, async (opts, element, ...args) => {\\n // set go\\n const go = await filterCheck(opts, element, ...args);\\n\\n // get children\\n const children = (element.children || [])[go ? 0 : 1] || [];\\n\\n // await trigger\\n await FlowHelper.run(opts.flow, children, opts, ...args);\\n\\n // return true\\n return true;\\n });\\n }\",\n \"eventTimer() {throw new Error('Must declare the function')}\",\n \"function tickTime() {\\n // the magic object with all the time data\\n // the present passing current moment\\n let pc = {\\n thisMoment: {},\\n current: {},\\n msInA: {},\\n utt: {},\\n passage: {},\\n display: {}\\n };\\n\\n // get the current time\\n pc.thisMoment = {};\\n pc.thisMoment = new Date();\\n\\n // slice current time into units\\n pc.current = {\\n ms: pc.thisMoment.getMilliseconds(),\\n second: pc.thisMoment.getSeconds(),\\n minute: pc.thisMoment.getMinutes(),\\n hour: pc.thisMoment.getHours(),\\n day: pc.thisMoment.getDay(),\\n date: pc.thisMoment.getDate(),\\n week: weekOfYear(pc.thisMoment),\\n month: pc.thisMoment.getMonth(),\\n year: pc.thisMoment.getFullYear()\\n };\\n\\n // TODO: display day of week and month name\\n let dayOfWeek = DAYS[pc.current.day];\\n let monthName = MONTHS[pc.current.month];\\n\\n // returns the week no. out of the year\\n function weekOfYear(d) {\\n d.setHours(0, 0, 0);\\n d.setDate(d.getDate() + 4 - (d.getDay() || 7));\\n return Math.ceil(((d - new Date(d.getFullYear(), 0, 1)) / 8.64e7 + 1) / 7);\\n }\\n\\n // set the slice conversions based on pc.thisMoment\\n pc.msInA.ms = 1;\\n pc.msInA.second = 1000;\\n pc.msInA.minute = pc.msInA.second * 60;\\n pc.msInA.hour = pc.msInA.minute * 60;\\n pc.msInA.day = pc.msInA.hour * 24;\\n pc.msInA.week = pc.msInA.day * 7;\\n pc.msInA.month = pc.msInA.day * MONTH_DAYS[pc.current.month - 1];\\n pc.msInA.year = pc.msInA.day * daysThisYear(pc.current.year);\\n\\n // handle leap years\\n function daysThisYear(year) {\\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\\n MONTH_DAYS[1] = 29;\\n return 366;\\n } else {\\n return 365;\\n }\\n }\\n\\n // utt means UpToThis\\n // calculates the count in ms of each unit that has passed\\n pc.utt.ms = pc.current.ms;\\n pc.utt.second = pc.current.second * pc.msInA.second + pc.utt.ms;\\n pc.utt.minute = pc.current.minute * pc.msInA.minute + pc.utt.second;\\n pc.utt.hour = pc.current.hour * pc.msInA.hour + pc.utt.minute;\\n pc.utt.day = pc.current.day * pc.msInA.day + pc.utt.hour;\\n pc.utt.week = pc.current.week * pc.msInA.week + pc.utt.day;\\n pc.utt.date = pc.current.date * pc.msInA.day + pc.utt.hour;\\n pc.utt.month = pc.current.month + 1 * pc.msInA.month + pc.utt.date;\\n pc.utt.year = pc.current.year * pc.msInA.year + pc.utt.month;\\n\\n // calculates the proportion/ratio of each unit that has passed\\n // used to display percentages\\n pc.passage = {\\n ms: pc.current.ms / 100,\\n second: pc.current.ms / pc.msInA.second,\\n minute: pc.utt.second / pc.msInA.minute,\\n hour: pc.utt.minute / pc.msInA.hour,\\n day: pc.utt.hour / pc.msInA.day,\\n week: pc.utt.day / pc.msInA.week,\\n month: pc.utt.date / pc.msInA.month,\\n year: pc.utt.month / pc.msInA.year\\n };\\n\\n // tidies up the current clock readouts for display\\n pc.display = {\\n ms: pc.utt.ms,\\n second: pc.current.second,\\n minute: pc.current.minute.toString().padStart(2, \\\"0\\\"),\\n hour: pc.current.hour.toString().padStart(2, \\\"0\\\"),\\n day: pc.current.date,\\n week: pc.current.week,\\n month: pc.current.month.toString().padStart(2, \\\"0\\\"),\\n year: pc.current.year\\n };\\n\\n if (debug) {\\n console.dir(pc);\\n }\\n\\n // returns the ratios and the clock readouts\\n return { psg: pc.passage, dsp: pc.display };\\n}\",\n \"get isStartable() { return (Now < this.endTime.plus(minutes(60))) && (Now > this.startTime.minus(minutes(60))) }\",\n \"update(timeStep) {\\n\\n }\",\n \"isScheduled() {\\r\\n return this.timeoutToken !== -1;\\r\\n }\",\n \"static cron(options) {\\n if (options.weekDay !== undefined && options.day !== undefined) {\\n throw new Error('Cannot supply both \\\\'day\\\\' and \\\\'weekDay\\\\', use at most one');\\n }\\n const minute = fallback(options.minute, '*');\\n const hour = fallback(options.hour, '*');\\n const month = fallback(options.month, '*');\\n const day = fallback(options.day, '*');\\n const weekDay = fallback(options.weekDay, '*');\\n return new LiteralSchedule(`${minute} ${hour} ${day} ${month} ${weekDay}`);\\n }\",\n \"_onTimeupdate () {\\n this.emit('timeupdate', this.getCurrentTime())\\n }\",\n \"_onTimeupdate () {\\n this.emit('timeupdate', this.getCurrentTime())\\n }\",\n \"handler() {\\n this.totalMilliseconds = this.time;\\n this.endTime = this.now() + this.time;\\n\\n if (this.autoStart) {\\n this.start();\\n }\\n }\",\n \"function RequestScheduler() {}\",\n \"function tick() {\\n setTime(howOld(createdOn));\\n }\",\n \"checkPeriodicalTasks() {\\n // Now is now\\n var now = new Date(this.time.getTime());\\n\\n // If the farm fields are valid\\n if (window.game.farm && window.game.farm.farmFields) {\\n // Go through each farm field\\n window.game.farm.farmFields.forEach(function(farmField, i) {\\n // If there's a seed planted on them\\n if (farmField.seed && farmField.seedItem) {\\n // Check on which stage they are by comparing the time and their different stages\\n var currentStage = 0;\\n farmField.stages.forEach(function(stage, index) {\\n if (stage.getTime() <= now.getTime()) {\\n currentStage = index + 1;\\n }\\n })\\n\\n // If the stage is above zero, update the farm field to actually receive the new stage\\n if (currentStage > 0) {\\n farmField.setStage(currentStage);\\n }\\n }\\n });\\n }\\n\\n // If the fruit trees are valid\\n if (window.game.farm && window.game.farm.fruitTrees) {\\n // Go through each fruit tree\\n window.game.farm.fruitTrees.forEach(function(fruitTree, i) {\\n // If the fruit tree has a next ripe time set and it should be ripe by now and it isn't locked, set it to be ripe\\n if (fruitTree.nextRipe && fruitTree.nextRipe.getTime() <= now.getTime() && !fruitTree.isRipe && !fruitTree.isLocked) {\\n fruitTree.setRipe(true);\\n }\\n })\\n }\\n\\n // Check if we should update a season\\n // Season dates are\\n // 01.03 - spring\\n // 01.06 - summer\\n // 01.09 - autumn\\n // 01.12 - winter\\n var month = this.time.getMonth();\\n\\n // If the current month (months start from 0 in js) is dividable through 3 and seasons didn't change already\\n if ((month+1) % 3 == 0 && !this.didSeasonChange) {\\n // Trigger a season change\\n window.game.map.nextSeason();\\n\\n // Set this flag so the if statement above won't be fired again\\n this.didSeasonChange = true;\\n } \\n // Check if the month IS NOT dividable through 3 and the flag is set\\n else if ((month+1) % 3 != 0 && this.didSeasonChange) {\\n // in that case, we can safely reset it to let the first if statement fire next roud\\n this.didSeasonChange = false;\\n }\\n\\n // Check for crop growth every 3 seconds (real time!)\\n setTimeout(this.checkPeriodicalTasks.bind(this), 3*1000);\\n }\",\n \"function $hs_schedule(args, onComplete, onException) {\\n var f = args[0];\\n var a = Array.prototype.slice.call(args, 1, args.length);\\n $tr_Scheduler.start(new $tr_Jump(f.hscall, f, a), onComplete, onException);\\n}\",\n \"getStartTime() {\\n return this.startTime;\\n }\",\n \"setupSchedule(){\\n // setup the schedule\\n\\n SchedulerUtils.addInstructionsToSchedule(this);\\n\\n let n_trials = (this.practice)? constants.PRACTICE_LEN : 25;\\n // added for feedback\\n this.feedbacks = [];\\n for(let i= 0;i daysInAMonth[this.month - 1]) {\\n this.month += 1;\\n this.day = 1;\\n }\\n\\n }\\n\\n this.time = function() {\\n \\tvar month = this.month < 10 ? \\\"0\\\" + this.month : this.month;\\n \\tvar day = this.day < 10 ? \\\"0\\\" + this.day : this.day;\\n console.log(`${this.year}-${month}-${day}`)\\n }\\n\\n this.getTime = function() {\\n var month = this.month < 10 ? \\\"0\\\" + this.month : this.month;\\n \\tvar day = this.day < 10 ? \\\"0\\\" + this.day : this.day;\\n return `${this.year}-${month}-${day}`;\\n }\\n\\n}\",\n \"function calculateTime() {\\n displayTime(Date.now() - startTime);\\n}\",\n \"twelveClock () {\\n const shiftAM = () => this.#hour < 4\\n ? eveningGreet.run()\\n : morningGreet.run()\\n\\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\\n ? eveningGreet.run()\\n : afternoonGreet.run()\\n\\n return this.#shift === 'AM'\\n ? shiftAM()\\n : shiftPM()\\n }\",\n \"start() {\\n // Run immediately..\\n this.runUpdate();\\n\\n // .. then schedule 15 min interval\\n timers.setInterval(() => {\\n this.runUpdate();\\n }, 900000);\\n }\",\n \"function schedule() {\\n var now = new Date().getTime(), delta = now - lastCycleTime, timeout = (30 * 60 * 1000) - delta, then = new Date(now + timeout);\\n if (timeout < 100) timeout = 100;\\n setTimeout(start, timeout);\\n console.log(\\\"\\\\nNext cycle time:\\\", then.toLocaleString());\\n}\",\n \"function updateTime(){\\n setTimeContent(\\\"timer\\\");\\n}\",\n \"function runAndScheduleTask () {\\n\\t\\ttask( scheduleNextExecution );\\n\\t}\",\n \"tick() {\\n let prevSecond = this.createDigits(this.vDigits(this.timeString()));\\n\\n this.checkAlarm();\\n\\n setTimeout(() => {\\n this.get();\\n this.update(cacheDOM.timeDisplay, this.createDigits(this.vDigits(this.timeString())), prevSecond);\\n this.tick();\\n }, 1000)\\n }\",\n \"getTime(){return this.time;}\",\n \"function scheduler(part) {\\n let relativeMod = relativeTime % part.loopTime,\\n lookAheadMod = lookAheadTime % part.loopTime;\\n\\n if (lookAheadMod < relativeMod && part.iterator > 1) {\\n part.iterator = 0;\\n } \\n\\n while (part.iterator < part.schedule.length &&\\n part.schedule[part.iterator].when < lookAheadMod) {\\n\\n part.queue(part.schedule[part.iterator].when - relativeMod);\\n part.iterator += 1;\\n }\\n }\",\n \"function scheduler(part) {\\n let relativeMod = relativeTime % part.loopTime,\\n lookAheadMod = lookAheadTime % part.loopTime;\\n\\n if (lookAheadMod < relativeMod && part.iterator > 1) {\\n part.iterator = 0;\\n } \\n\\n while (part.iterator < part.schedule.length &&\\n part.schedule[part.iterator].when < lookAheadMod) {\\n\\n part.queue(part.schedule[part.iterator].when - relativeMod);\\n part.iterator += 1;\\n }\\n }\",\n \"resetSchedule() {\\n this._scheduler.resetSchedule();\\n }\",\n \"function Timer() {}\",\n \"tick() {\\n\\t\\t// debug\\n\\t\\t// console.log(\\\"atomicGLClock::tick\\\");\\t\\n var timeNow = new Date().getTime();\\n\\n if (this.lastTime != 0)\\n \\tthis.elapsed = timeNow - this.lastTime;\\n\\n this.lastTime = timeNow;\\n }\",\n \"changeStartTime(startTime){\\n this.startTime = startTime;\\n }\",\n \"applyWorkingTime(timeAxis) {\\n const me = this,\\n config = me._workingTime;\\n\\n if (config) {\\n let hour = null; // Only use valid values\\n\\n if (config.fromHour >= 0 && config.fromHour < 24 && config.toHour > config.fromHour && config.toHour <= 24 && config.toHour - config.fromHour < 24) {\\n hour = {\\n from: config.fromHour,\\n to: config.toHour\\n };\\n }\\n\\n let day = null; // Only use valid values\\n\\n if (config.fromDay >= 0 && config.fromDay < 7 && config.toDay > config.fromDay && config.toDay <= 7 && config.toDay - config.fromDay < 7) {\\n day = {\\n from: config.fromDay,\\n to: config.toDay\\n };\\n }\\n\\n if (hour || day) {\\n timeAxis.include = {\\n hour,\\n day\\n };\\n } else {\\n // No valid rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n } else {\\n // No rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n\\n if (me.isPainted) {\\n var _me$features$columnLi;\\n\\n // Refreshing header, which also recalculate tickSize and header data\\n me.timeAxisColumn.refreshHeader(); // Update column lines\\n\\n (_me$features$columnLi = me.features.columnLines) === null || _me$features$columnLi === void 0 ? void 0 : _me$features$columnLi.refresh(); // Animate event changes\\n\\n me.refreshWithTransition();\\n }\\n }\",\n \"now () {\\n return this.t;\\n }\",\n \"applyWorkingTime(timeAxis) {\\n const me = this,\\n config = me._workingTime;\\n\\n if (config) {\\n let hour = null;\\n // Only use valid values\\n if (\\n config.fromHour >= 0 &&\\n config.fromHour < 24 &&\\n config.toHour > config.fromHour &&\\n config.toHour <= 24 &&\\n config.toHour - config.fromHour < 24\\n ) {\\n hour = { from: config.fromHour, to: config.toHour };\\n }\\n\\n let day = null;\\n // Only use valid values\\n if (\\n config.fromDay >= 0 &&\\n config.fromDay < 7 &&\\n config.toDay > config.fromDay &&\\n config.toDay <= 7 &&\\n config.toDay - config.fromDay < 7\\n ) {\\n day = { from: config.fromDay, to: config.toDay };\\n }\\n\\n if (hour || day) {\\n timeAxis.include = {\\n hour,\\n day\\n };\\n } else {\\n // No valid rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n } else {\\n // No rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n\\n if (me.rendered) {\\n // Refreshing header, which also recalculate tickSize and header data\\n me.timeAxisColumn.refreshHeader();\\n // Update column lines\\n if (me.features.columnLines) {\\n me.features.columnLines.drawLines();\\n }\\n\\n // Animate event changes\\n me.refreshWithTransition();\\n }\\n }\",\n \"constructor(){\\n this.startTime = 0;\\n this.endTime = 0; \\n this.running = 0;\\n this.duration = 0;\\n }\",\n \"scheduleWatchMessages() {\\n this.cronJob = schedule(checkFrequency, this.checkNewMessages.bind(this), {});\\n }\",\n \"function startTime() {\\n var today = new Date();\\n var hourNow = today.getHours();\\n var h = formatHour(hourNow);\\n var m = today.getMinutes();\\n var ap = formatAmPm(hourNow);\\n if(m==0) {\\n writeDate();\\n }\\n m = checkTime(m);\\n document.getElementById('clock').innerHTML = h + ':' + m + ap;\\n var t = setTimeout(startTime, 10000);\\n}\",\n \"get_timeSet() {\\n return this.liveFunc._timeSet;\\n }\",\n \"function Scheduler() {\\n this.tasks = [];\\n this.current_running = 0;\\n this.enabled = false;\\n this.running = {};\\n}\",\n \"function scheduleTick(rootContext,flags){var nothingScheduled=rootContext.flags===0/* Empty */;rootContext.flags|=flags;if(nothingScheduled&&rootContext.clean==_CLEAN_PROMISE){var res_1;rootContext.clean=new Promise(function(r){return res_1=r;});rootContext.scheduler(function(){if(rootContext.flags&1/* DetectChanges */){rootContext.flags&=~1/* DetectChanges */;tickRootContext(rootContext);}if(rootContext.flags&2/* FlushPlayers */){rootContext.flags&=~2/* FlushPlayers */;var playerHandler=rootContext.playerHandler;if(playerHandler){playerHandler.flushPlayers();}}rootContext.clean=_CLEAN_PROMISE;res_1(null);});}}\",\n \"function TimeUtils() {}\",\n \"function scheduleNextExecution () {\\n\\t\\tif ( status == \\\"running\\\" ) {\\n\\t\\t\\ttimerId = setTimeout( runAndScheduleTask, interval );\\n\\t\\t}\\n\\t}\",\n \"timer() {\\n this.sethandRotation('hour');\\n this.sethandRotation('minute');\\n this.sethandRotation('second');\\n }\",\n \"constructor() {\\n /** Indicates if the clock is endend. */\\n this.endedLocal = false;\\n /** The duration between start and end of the clock. */\\n this.diff = null;\\n this.startTimeLocal = new Date();\\n this.hrtimeLocal = process.hrtime();\\n }\",\n \"resume(){\\n\\t\\tvar _self = this\\n\\t\\tvar dur = new Date( _self.currentTime )\\n\\t\\tthis.tick( dur.getUTCMinutes() )\\n\\t\\tconsole.log(\\\"timer resumed\\\")\\n\\t}\",\n \"function scheduler() {\\n if (!play) {\\n return;\\n }\\n while (nextNoteTime < context.currentTime + scheduleAheadTime) {\\n commandList.forEach(function (c) {\\n return c.play(cursor);\\n });\\n nextNote();\\n }\\n}\",\n \"initChronometer() {\\n let self = this;\\n\\n setInterval(() => {\\n self.allDuration();\\n }, 1000);\\n\\n }\",\n \"function next(){ // runs current scheduled task and creates timeout to schedule next\\n\\t\\tif(task !== null){ // is task scheduled??\\n\\t\\t\\ttask.func(); // run it\\n\\t\\t\\ttask = null; // clear task\\n\\t\\t}\\n\\t\\tif(queue.length > 0){ // are there any remain tasks??\\n\\t\\t\\ttask = queue.shift(); // yes set as next task\\n\\t\\t\\ttHandle = setTimeout(next,task.time) // schedual when\\n\\t\\t}else{\\n\\t\\t\\tAPI.done = true;\\n\\t\\t}\\n\\t}\",\n \"function updateSchedule() {\\n // clear all textblocks\\n $(\\\"textarea\\\").empty();\\n // check the time and formatting]\\n styleSchedule(startHr, endHr);\\n // insert the text items\\n // i is the id of the textarea associated\\n // with each hour on the schedule\\n for (i = startHr; i <= endHr; i++) {\\n indx = i - startHr;\\n var nextEl = $(`#${i}`);\\n nextEl.text(scheduleList[indx].task);\\n }\\n }\",\n \"getTime(){\\n this.time = millis();\\n this.timeFromLast = this.time - this.timeUntilLast;\\n\\n this.lifeTime = this.time - this.startTime;\\n \\n \\n }\",\n \"function createTimeDrivenTriggers() {\\n // Trigger every 6 hours.\\n ScriptApp.newTrigger('myFunction')\\n .timeBased()\\n .everyHours(6)\\n .create();\\n // Trigger every Monday at 09:00.\\n ScriptApp.newTrigger('myFunction')\\n .timeBased()\\n .onWeekDay(ScriptApp.WeekDay.MONDAY)\\n .atHour(9)\\n .create();\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6416027","0.6408302","0.63115746","0.62752646","0.62608033","0.62101203","0.61650443","0.61095214","0.6015887","0.5985229","0.59624815","0.59351104","0.5895897","0.5881284","0.5830455","0.5811016","0.5795725","0.5775376","0.57715","0.57437265","0.5733257","0.56578195","0.56393665","0.5629156","0.561515","0.55869395","0.55837786","0.5547538","0.55332357","0.5529204","0.5529204","0.5529204","0.55043876","0.5502614","0.5500715","0.5488461","0.5484539","0.5484311","0.54842967","0.5473574","0.5458078","0.54548216","0.54511625","0.54502976","0.54437023","0.5443256","0.54351884","0.5426672","0.54219425","0.54219425","0.5414837","0.5409172","0.5395589","0.5392481","0.5389904","0.5377731","0.53469247","0.5346616","0.5346616","0.53419","0.533841","0.5329606","0.5319567","0.5319538","0.5316337","0.5308291","0.5300458","0.527308","0.5263869","0.5262108","0.52596205","0.52540964","0.5252081","0.52469957","0.52394325","0.52267224","0.52267224","0.52267116","0.5225651","0.52222985","0.52194977","0.5212188","0.5204083","0.52039814","0.52002025","0.51927525","0.5189826","0.51843715","0.51832086","0.5178657","0.5174342","0.51681244","0.51619637","0.51585823","0.515806","0.5157653","0.5157465","0.515051","0.5144879","0.51386195","0.51357555"],"string":"[\n \"0.6416027\",\n \"0.6408302\",\n \"0.63115746\",\n \"0.62752646\",\n \"0.62608033\",\n \"0.62101203\",\n \"0.61650443\",\n \"0.61095214\",\n \"0.6015887\",\n \"0.5985229\",\n \"0.59624815\",\n \"0.59351104\",\n \"0.5895897\",\n \"0.5881284\",\n \"0.5830455\",\n \"0.5811016\",\n \"0.5795725\",\n \"0.5775376\",\n \"0.57715\",\n \"0.57437265\",\n \"0.5733257\",\n \"0.56578195\",\n \"0.56393665\",\n \"0.5629156\",\n \"0.561515\",\n \"0.55869395\",\n \"0.55837786\",\n \"0.5547538\",\n \"0.55332357\",\n \"0.5529204\",\n \"0.5529204\",\n \"0.5529204\",\n \"0.55043876\",\n \"0.5502614\",\n \"0.5500715\",\n \"0.5488461\",\n \"0.5484539\",\n \"0.5484311\",\n \"0.54842967\",\n \"0.5473574\",\n \"0.5458078\",\n \"0.54548216\",\n \"0.54511625\",\n \"0.54502976\",\n \"0.54437023\",\n \"0.5443256\",\n \"0.54351884\",\n \"0.5426672\",\n \"0.54219425\",\n \"0.54219425\",\n \"0.5414837\",\n \"0.5409172\",\n \"0.5395589\",\n \"0.5392481\",\n \"0.5389904\",\n \"0.5377731\",\n \"0.53469247\",\n \"0.5346616\",\n \"0.5346616\",\n \"0.53419\",\n \"0.533841\",\n \"0.5329606\",\n \"0.5319567\",\n \"0.5319538\",\n \"0.5316337\",\n \"0.5308291\",\n \"0.5300458\",\n \"0.527308\",\n \"0.5263869\",\n \"0.5262108\",\n \"0.52596205\",\n \"0.52540964\",\n \"0.5252081\",\n \"0.52469957\",\n \"0.52394325\",\n \"0.52267224\",\n \"0.52267224\",\n \"0.52267116\",\n \"0.5225651\",\n \"0.52222985\",\n \"0.52194977\",\n \"0.5212188\",\n \"0.5204083\",\n \"0.52039814\",\n \"0.52002025\",\n \"0.51927525\",\n \"0.5189826\",\n \"0.51843715\",\n \"0.51832086\",\n \"0.5178657\",\n \"0.5174342\",\n \"0.51681244\",\n \"0.51619637\",\n \"0.51585823\",\n \"0.515806\",\n \"0.5157653\",\n \"0.5157465\",\n \"0.515051\",\n \"0.5144879\",\n \"0.51386195\",\n \"0.51357555\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":25,"cells":{"query":{"kind":"string","value":"TimeEngine method (transported interface)"},"document":{"kind":"string","value":"syncPosition(time, position, speed) {\n if (this.__period > 0) {\n var nextPosition = (Math.floor(position / this.__period) + this.__phase) * this.__period;\n\n if (speed > 0 && nextPosition < position)\n nextPosition += this.__period;\n else if (speed < 0 && nextPosition > position)\n nextPosition -= this.__period;\n\n return nextPosition;\n }\n\n return Infinity * speed;\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 tickCurrentTimeEngine() {\n\n var d = new Date();\n\n currentHours = d.getHours();\n currentMinutes = d.getMinutes();\n currentSeconds = d.getSeconds();\n\n if (currentHours.toString().length == 1) {\n choursDigit_1 = 0;\n choursDigit_2 = currentHours;\n }\n else {\n choursDigit_1 = parseInt(currentHours.toString().charAt(0), 10);\n choursDigit_2 = parseInt(currentHours.toString().charAt(1), 10);\n }\n\n if (currentMinutes.toString().length == 1) {\n cminutesDigit_1 = 0;\n cminutesDigit_2 = currentMinutes;\n }\n else {\n cminutesDigit_1 = parseInt(currentMinutes.toString().charAt(0), 10);\n cminutesDigit_2 = parseInt(currentMinutes.toString().charAt(1), 10);\n }\n\n if (currentSeconds.toString().length == 1) {\n csecondsDigit_1 = 0;\n csecondsDigit_2 = currentSeconds;\n }\n else {\n csecondsDigit_1 = parseInt(currentSeconds.toString().charAt(0), 10);\n csecondsDigit_2 = parseInt(currentSeconds.toString().charAt(1), 10);\n }\n\n tickCurrentTime = setTimeout(tickCurrentTimeEngine, timerCurrentTimeMiliSecs);\n\n return;\n }","function Time() {}","get time () { throw \"Game system not supported\"; }","_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }","_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }","function TimeUtils() {}","getTime(){return this.time;}","function Engine() {\n }","onTimeChanged () {\n this.view.renderTimeAndDate();\n }","function tickTime() {\n // the magic object with all the time data\n // the present passing current moment\n let pc = {\n thisMoment: {},\n current: {},\n msInA: {},\n utt: {},\n passage: {},\n display: {}\n };\n\n // get the current time\n pc.thisMoment = {};\n pc.thisMoment = new Date();\n\n // slice current time into units\n pc.current = {\n ms: pc.thisMoment.getMilliseconds(),\n second: pc.thisMoment.getSeconds(),\n minute: pc.thisMoment.getMinutes(),\n hour: pc.thisMoment.getHours(),\n day: pc.thisMoment.getDay(),\n date: pc.thisMoment.getDate(),\n week: weekOfYear(pc.thisMoment),\n month: pc.thisMoment.getMonth(),\n year: pc.thisMoment.getFullYear()\n };\n\n // TODO: display day of week and month name\n let dayOfWeek = DAYS[pc.current.day];\n let monthName = MONTHS[pc.current.month];\n\n // returns the week no. out of the year\n function weekOfYear(d) {\n d.setHours(0, 0, 0);\n d.setDate(d.getDate() + 4 - (d.getDay() || 7));\n return Math.ceil(((d - new Date(d.getFullYear(), 0, 1)) / 8.64e7 + 1) / 7);\n }\n\n // set the slice conversions based on pc.thisMoment\n pc.msInA.ms = 1;\n pc.msInA.second = 1000;\n pc.msInA.minute = pc.msInA.second * 60;\n pc.msInA.hour = pc.msInA.minute * 60;\n pc.msInA.day = pc.msInA.hour * 24;\n pc.msInA.week = pc.msInA.day * 7;\n pc.msInA.month = pc.msInA.day * MONTH_DAYS[pc.current.month - 1];\n pc.msInA.year = pc.msInA.day * daysThisYear(pc.current.year);\n\n // handle leap years\n function daysThisYear(year) {\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n MONTH_DAYS[1] = 29;\n return 366;\n } else {\n return 365;\n }\n }\n\n // utt means UpToThis\n // calculates the count in ms of each unit that has passed\n pc.utt.ms = pc.current.ms;\n pc.utt.second = pc.current.second * pc.msInA.second + pc.utt.ms;\n pc.utt.minute = pc.current.minute * pc.msInA.minute + pc.utt.second;\n pc.utt.hour = pc.current.hour * pc.msInA.hour + pc.utt.minute;\n pc.utt.day = pc.current.day * pc.msInA.day + pc.utt.hour;\n pc.utt.week = pc.current.week * pc.msInA.week + pc.utt.day;\n pc.utt.date = pc.current.date * pc.msInA.day + pc.utt.hour;\n pc.utt.month = pc.current.month + 1 * pc.msInA.month + pc.utt.date;\n pc.utt.year = pc.current.year * pc.msInA.year + pc.utt.month;\n\n // calculates the proportion/ratio of each unit that has passed\n // used to display percentages\n pc.passage = {\n ms: pc.current.ms / 100,\n second: pc.current.ms / pc.msInA.second,\n minute: pc.utt.second / pc.msInA.minute,\n hour: pc.utt.minute / pc.msInA.hour,\n day: pc.utt.hour / pc.msInA.day,\n week: pc.utt.day / pc.msInA.week,\n month: pc.utt.date / pc.msInA.month,\n year: pc.utt.month / pc.msInA.year\n };\n\n // tidies up the current clock readouts for display\n pc.display = {\n ms: pc.utt.ms,\n second: pc.current.second,\n minute: pc.current.minute.toString().padStart(2, \"0\"),\n hour: pc.current.hour.toString().padStart(2, \"0\"),\n day: pc.current.date,\n week: pc.current.week,\n month: pc.current.month.toString().padStart(2, \"0\"),\n year: pc.current.year\n };\n\n if (debug) {\n console.dir(pc);\n }\n\n // returns the ratios and the clock readouts\n return { psg: pc.passage, dsp: pc.display };\n}","overTime(){\n\t\t//\n\t}","function updateTime() {\n\n}","function task4 () {\n\n function Clock (options) {\n this._template = options.template\n }\n \n Clock.prototype.render = function() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = this._template.replace('h', hours)\n .replace('m', min)\n .replace('s', sec);\n console.log(output);\n };\n\n Clock.prototype.stop = function () {\n clearInterval(this._timer)\n }\n\n Clock.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), 1000)\n };\n\n\n\n // Descendant\n\n function RelativeClock(options) {\n Clock.apply(this, arguments) // coffee script super() :)\n this._precision = options.precision || 1000\n };\n\n RelativeClock.prototype = Object.create(Clock.prototype);\n RelativeClock.prototype.constructor = RelativeClock;\n\n RelativeClock.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), this._precision)\n };\n\n var rc = new RelativeClock({\n template: \"h:m:s\",\n precision: 10000\n })\n rc.start()\n}","function classTime(C_E,desc,day,start,fin,loc,start_date){\n this.C_E = C_E;\n this.desc = desc;\n this.day = day;\n this.start = start;\n this.fin = fin;\n this.loc = loc;\n this.start_date = start_date;\n}","function __time($obj) {\r\n if (window.STATICCLASS_CALENDAR==null) {\r\n window.STATICCLASS_CALENDAR = __loadScript(\"CalendarTime\", 1);\r\n }\r\n window.STATICCLASS_CALENDAR.perform($obj);\r\n}","function timeTest()\r\n{\r\n}","function startTime() {\n setTimer();\n}","constructor() {\n /** Indicates if the clock is endend. */\n this.endedLocal = false;\n /** The duration between start and end of the clock. */\n this.diff = null;\n this.startTimeLocal = new Date();\n this.hrtimeLocal = process.hrtime();\n }","function Stopwatch() {}","function task3 () {\n //\n function Clock(options) {\n var template = options.template;\n var timer;\n \n function render() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\n console.log(output);\n }\n this.stop = function() {\n clearInterval(timer);\n };\n this.start = function() {\n render();\n timer = setInterval(render, 1000);\n }\n }\n \n var cf = new Clock({\n template: 'h:m:s'\n });\n // cf.start();\n\n\n function ClockP (options) {\n this._template = options.template\n this._timer = null\n }\n\n ClockP.prototype.render = function() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = this._template.replace('h', hours)\n .replace('m', min)\n .replace('s', sec);\n console.log(output);\n };\n\n ClockP.prototype.stop = function () {\n clearInterval(this._timer)\n }\n\n ClockP.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), 1000)\n };\n\n var cp = new ClockP({\n template: 'h:m:s'\n });\n cp.start();\n\n}","applyWorkingTime(timeAxis) {\n const me = this,\n config = me._workingTime;\n\n if (config) {\n let hour = null;\n // Only use valid values\n if (\n config.fromHour >= 0 &&\n config.fromHour < 24 &&\n config.toHour > config.fromHour &&\n config.toHour <= 24 &&\n config.toHour - config.fromHour < 24\n ) {\n hour = { from: config.fromHour, to: config.toHour };\n }\n\n let day = null;\n // Only use valid values\n if (\n config.fromDay >= 0 &&\n config.fromDay < 7 &&\n config.toDay > config.fromDay &&\n config.toDay <= 7 &&\n config.toDay - config.fromDay < 7\n ) {\n day = { from: config.fromDay, to: config.toDay };\n }\n\n if (hour || day) {\n timeAxis.include = {\n hour,\n day\n };\n } else {\n // No valid rules, restore timeAxis\n timeAxis.include = null;\n }\n } else {\n // No rules, restore timeAxis\n timeAxis.include = null;\n }\n\n if (me.rendered) {\n // Refreshing header, which also recalculate tickSize and header data\n me.timeAxisColumn.refreshHeader();\n // Update column lines\n if (me.features.columnLines) {\n me.features.columnLines.drawLines();\n }\n\n // Animate event changes\n me.refreshWithTransition();\n }\n }","currentTime() {\n this.time24 = new Time();\n this.updateTime(false);\n }","function SimulationEngine() {\n\t\t\n\t}","function tickTheClock(){\n\n \n \n}","function engine() {\n \n run = false;\n leg = length;\n \n while(leg--) {\n \n itm = dictionary[leg];\n \n if(!itm) break;\n if(itm.isCSS) continue;\n \n if(itm.cycle()) {\n \n run = true;\n\n }\n else {\n \n itm.stop(false, itm.complete, false, true);\n \n }\n \n }\n \n if(request) {\n \n if(run) {\n \n request(engine);\n \n }\n else {\n \n cancel(engine);\n itm = trans = null;\n \n }\n \n }\n else {\n \n if(run) {\n \n if(!engineRunning) timer = setInterval(engine, intervalSpeed);\n \n }\n else {\n \n clearInterval(timer);\n itm = trans = null;\n \n }\n \n }\n \n engineRunning = run;\n \n }","function updateTime() {\n console.log(\"updateTime()\");\n store.timeModel.update();\n}","get_timeSet() {\n return this.liveFunc._timeSet;\n }","function Clock() {\n\n var daysInAMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n\n this.month = 1;\n this.day = 1;\n this.year = 2016;\n\n this.tick = function() {\n this.day += 1;\n\n if (this.day > daysInAMonth[this.month - 1]) {\n this.month += 1;\n this.day = 1;\n }\n\n }\n\n this.time = function() {\n \tvar month = this.month < 10 ? \"0\" + this.month : this.month;\n \tvar day = this.day < 10 ? \"0\" + this.day : this.day;\n console.log(`${this.year}-${month}-${day}`)\n }\n\n this.getTime = function() {\n var month = this.month < 10 ? \"0\" + this.month : this.month;\n \tvar day = this.day < 10 ? \"0\" + this.day : this.day;\n return `${this.year}-${month}-${day}`;\n }\n\n}","function onSystemTimeChanged() {\r\n updateTime();\r\n }","function setTime( t ){\n\n this.time = t;\n\n }","getTime(){\n this.time = millis();\n this.timeFromLast = this.time - this.timeUntilLast;\n\n this.lifeTime = this.time - this.startTime;\n \n \n }","get elapsedTime() {\n return this._t;\n }","function startTime()\n{\n //get how long does it take for the smallest unit to elapse to set timeouts\n var timeout = time.units[time.units.length-1];\n\n //put the name into the text\n $(\"[class^=timeName]\").html(time.name);\n\n //clocks\n localTime();\n currentFictional(timeout);\n countdownToBegin(timeout);\n\n //converters\n $(\"#eyToTimeY\").submit(function(event){\n event.preventDefault();\n $(\"#eyToTimeYResult\").text( earthYearsToTimeYears($(\"#eyToTimeYInput\").val()) );\n });\n\n //SUT year to Earth year\n $(\"#timeToEY\").submit(function(event){\n event.preventDefault();\n $(\"#timeToEYResult\").text( timeYearsToEarthYears($(\"#timeToEYInput\").val()) );\n });\n\n //setup date picker for Earth year\n $(\"#eDToTimeInput\").fdatepicker({format:\"yyyy-mm-dd\"});\n //Earth date to SUT\n $(\"#eDToTime\").submit(function(event){\n event.preventDefault();\n $(\"#eDToTimeResult\").text( earthDateToTime($(\"#eDToTimeInput\").val()) );\n });\n\n}","function timebase() {\n\t//timebased will interupt all other routines once started, until shutdown\n\t\n\t//TODO: turn timebase off completely by killing the interval function.\n\tif (timebase_status != \"running\") {\n\t\treturn;\n\t}\n\n\tvar current_hour = date.getHours();\n\tvar current_month = date.getMonth();\n\n\t//Daytime (7:00 - 19:00)\n\tif (current_hour >= 7 && current_hour < 18+season_sunset_offset) {\n\t\t//TODO: fade in from sunrise to sunrise+1hr\n\t\t\n\t\t//TODO: change hue/sat value in feedback loop from color zone sensor!\n\t\t\n\t\t//Turn on when active.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on');\n\t\t}\n\t//Nighttime (19:00 - 2:00)\n\t} else if (current_hour >= 18+season_sunset_offset || current_hour < 2) {\n\t\t//TODO: Flux full transition from 19:00 to 21:30\n\t\t\n\t\t//Turn on when active.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on');\n\t\t}\n\t}\n\t//Supernight (2:00 - 7:00)\n\telse if (current_hour >= 2 && current_hour < 7) {\n\t\t//Turn on when active.\n\t\t//TODO: only 10% brightness.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on'); //TODO: Per zone.\n\t\t}\n\t}\n\n\t//TODO: grab realtime sunrise/set data from internet\n\t//Sunrise accent effect\n\tif (0) {\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//Sunset accent effect\n\tif (0) {\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//TODO: grab data from ical file off the internet every day. \n\t//Calendar effects\n\tif (0) { //if event_start\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//check for securityMode\n\tif (hasActive(detectionData) && securityMode) {\n\t\t//disable it\n\t\tsecurityMode = false;\n\t\t//TODO: Flash welcome home accent pattern.\n\t}\n\n\t//Seasonal changes\n\t//Summer- push sunset back.\n\tif (current_month > 4 || current_month < 9) {\n\t\tseason_sunset_offset = 1.5;\n\t}\n\t\n\t//TODO: Update the light/history database here.\n\t//TODO: Check if database has no records for last 24 hours\n\t//Security Mode: simulate house\n\tif (0) {\n\t\tvar securityMode = true;\n\t\t//TODO: Implment security mode\n\t}\n\t//TODO: Parse duke api for warnings\n\tif (0) {\n\t\t//TODO: Check if it's an updated posting or not, and if so, flash accents red/yellow every 30s until disabled.\n\t}\n\n}","update(timeStep) {\n\n }","function LogicNodeTime() {\n\t\tLogicNode.call(this);\n\t\tthis.wantsProcessCall = true;\n\t\tthis.logicInterface = LogicNodeTime.logicInterface;\n\t\tthis.type = 'LogicNodeTime';\n\t\tthis._time = 0;\n\t\tthis._running = true;\n\t}","function calcEquationOfTime(t) {\n\t var epsilon = calcObliquityCorrection(t);\n\t var l0 = calcGeomMeanLongSun(t);\n\t var e = calcEccentricityEarthOrbit(t);\n\t var m = calcGeomMeanAnomalySun(t);\n\n\t var y = Math.tan(degToRad(epsilon) / 2.0);\n\t y *= y;\n\n\t var sin2l0 = Math.sin(2.0 * degToRad(l0));\n\t var sinm = Math.sin(degToRad(m));\n\t var cos2l0 = Math.cos(2.0 * degToRad(l0));\n\t var sin4l0 = Math.sin(4.0 * degToRad(l0));\n\t var sin2m = Math.sin(2.0 * degToRad(m));\n\n\t var Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;\n\t return radToDeg(Etime) * 4.0; // in minutes of time\n\t}","createTimer() {\n\t\t// set initial in seconds\n\t\tthis.initialTime = 0;\n\n\t\t// display text on Axis with formated Time\n\t\tthis.text = this.add.text(\n\t\t\t16,\n\t\t\t50,\n\t\t\t\"Time: \" + this.formatTime(this.initialTime)\n\t\t);\n\n\t\t// Each 1000 ms call onEvent\n\t\tthis.timedEvent = this.time.addEvent({\n\t\t\tdelay: 1000,\n\t\t\tcallback: this.onEvent,\n\t\t\tcallbackScope: this,\n\t\t\tloop: true,\n\t\t});\n\t}","function KalturaTimeWarnerService(client){\n\tthis.init(client);\n}","function TimeStamp() {}","function TimeStamp() {}","get startTime() { return this._startTime; }","applyWorkingTime(timeAxis) {\n const me = this,\n config = me._workingTime;\n\n if (config) {\n let hour = null; // Only use valid values\n\n if (config.fromHour >= 0 && config.fromHour < 24 && config.toHour > config.fromHour && config.toHour <= 24 && config.toHour - config.fromHour < 24) {\n hour = {\n from: config.fromHour,\n to: config.toHour\n };\n }\n\n let day = null; // Only use valid values\n\n if (config.fromDay >= 0 && config.fromDay < 7 && config.toDay > config.fromDay && config.toDay <= 7 && config.toDay - config.fromDay < 7) {\n day = {\n from: config.fromDay,\n to: config.toDay\n };\n }\n\n if (hour || day) {\n timeAxis.include = {\n hour,\n day\n };\n } else {\n // No valid rules, restore timeAxis\n timeAxis.include = null;\n }\n } else {\n // No rules, restore timeAxis\n timeAxis.include = null;\n }\n\n if (me.isPainted) {\n var _me$features$columnLi;\n\n // Refreshing header, which also recalculate tickSize and header data\n me.timeAxisColumn.refreshHeader(); // Update column lines\n\n (_me$features$columnLi = me.features.columnLines) === null || _me$features$columnLi === void 0 ? void 0 : _me$features$columnLi.refresh(); // Animate event changes\n\n me.refreshWithTransition();\n }\n }","changeStartTime(startTime){\n this.startTime = startTime;\n }","twelveClock () {\n const shiftAM = () => this.#hour < 4\n ? eveningGreet.run()\n : morningGreet.run()\n\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\n ? eveningGreet.run()\n : afternoonGreet.run()\n\n return this.#shift === 'AM'\n ? shiftAM()\n : shiftPM()\n }","get(){\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::get\");\t\n\t\treturn this.elapsed;\n\t}","liveTime() {\n\t\tthis.updateTime();\n\t\tthis.writeLog();\n\t}","onSleepingTime() {\n throw new NotImplementedException();\n }","function templateEngine () { }","function test_timepicker_should_pass_correct_timing_on_service_order() {}","function Time() {\n this._clock = void 0;\n this._timeScale = void 0;\n this._deltaTime = void 0;\n this._startTime = void 0;\n this._lastTickTime = void 0;\n this._clock = wechatAdapter.performance ? wechatAdapter.performance : Date;\n this._timeScale = 1.0;\n this._deltaTime = 0.0001;\n\n var now = this._clock.now();\n\n this._startTime = now;\n this._lastTickTime = now;\n }","getStartTime() {\n return this.startTime;\n }","function timecalc(hoursBack) {\r\n // Function to return current time for use to calculate the timeframe parameter for the parkingEvents query. \r\n // The function minus the number of hours back accuratly articulates to the api what \r\n // timeframe should be viewed.\r\n var date = new Date()\r\n return Date.UTC(date.getUTCFullYear(),date.getUTCMonth(), date.getUTCDate() , \r\n date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds())-(hoursBack*60*60*1000); \r\n }","timerTick(e) {\n console.log(\"This method should be overridden in child classes.\");\n }","constructor(schedule) {\n\n }","function morning() {\n // whole morning routine\n}","setTime(ts) {\nreturn this.timeStamp = ts;\n}","constructor(engine) {\n this.engine = engine;\n }","function getInitialTime() {\n changeTime();\n}","constructor (){\n\t\tsuper();\n\n\t\tthis.getTheTime = this.getTheTime.bind(this);\n\n\t\t/**\n\t\t * Setup the time variable to update every second\n\t\t */\n\t\t\n\t\tthis.state = {\n\t\t\ttime: null\n\t\t}\n\n\t\tthis.getTheTime();\n\t}","function OnTimeModule() {\n\t\tthis.name = \"OnTime.Module\";\n\t}","computeTime() {\n let year;\n const fields = this.fields;\n if (this.isSet(YEAR)) {\n year = fields[YEAR];\n } else {\n year = new Date().getFullYear();\n }\n let timeOfDay = 0;\n if (this.isSet(HOUR_OF_DAY)) {\n timeOfDay += fields[HOUR_OF_DAY];\n }\n timeOfDay *= 60;\n timeOfDay += fields[MINUTE] || 0;\n timeOfDay *= 60;\n timeOfDay += fields[SECONDS] || 0;\n timeOfDay *= 1000;\n timeOfDay += fields[MILLISECONDS] || 0;\n let fixedDate = 0;\n fields[YEAR] = year;\n fixedDate = fixedDate + this.getFixedDate();\n // millis represents local wall-clock time in milliseconds.\n let millis = (fixedDate - EPOCH_OFFSET) * ONE_DAY + timeOfDay;\n millis -= this.timezoneOffset * ONE_MINUTE;\n this.time = millis;\n this.computeFields();\n }","get time() {\n return this._time;\n }","function erlang(servers, time) {\n return (servers * time)/3600;\n}","_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}","constructor() {\n\n this.timedEntities = []; // Will hold list of entities being tracked\n this.activeEntity = null; // This is the entity we are currently timing\n this.intervalTimer = null; // Will hold reference after we start setInterval\n this.chartTimer = null; // Will hold referenec to the setInterval for updating the charts\n this.timingActive = false; // Are we currently running the timer?\n this.totalTicksActive = 0; // seconds that the timer has been running\n // Store the timestamp in ms of the last time a tick happened in case the\n // app gets backgrounded and JS execution stops. Can then add in the right\n // number of secconds after\n this.lastTickTime = -1;\n this.turnList = []; // Will hold a set of dictionaries defining each time the speaker changed.\n this.minTurnLength = 10; // seconds; the time before a turn is shown on the timeline\n\n this.meetingName = \"\";\n this.attributeNameGender = \"Gender\";\n this.attributeNameSecondary = \"Secondary Attribute\";\n this.attributeNameTertiary = \"Tertiary Attribute\";\n }","getPlayTime() {\n return this.time;\n }","scheduler() {\n this.maybeTickSongChart();\n\n // When nextNoteTime (in the future) is near (gap is determined by \n // scheduleAheadTime), schedule audio & visuals and advance to the next\n // note.\n while (this.nextNoteTime <\n (this.audioContext.currentTime + this.scheduleAheadTime)) {\n this.scheduleNote(this.current16thNote, this.nextNoteTime);\n this.nextNote();\n }\n }","initCurrentTimeLine() {\n const me = this,\n now = new Date();\n\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\n return;\n }\n\n me.currentTimeLine = new me.store.modelClass({\n // eslint-disable-next-line quote-props\n 'id': 'currentTime',\n cls: 'b-sch-current-time',\n startDate: now,\n name: DateHelper.format(now, me.currentDateFormat)\n });\n me.updateCurrentTimeLine = me.updateCurrentTimeLine.bind(me);\n me.currentTimeInterval = me.setInterval(me.updateCurrentTimeLine, me.updateCurrentTimeLineInterval);\n\n if (me.client.isPainted) {\n me.renderRanges();\n }\n }","get time() {}","now () {\n return this.t;\n }","function yFindRealTimeClock(func)\n{\n return YRealTimeClock.FindRealTimeClock(func);\n}","setTime(time) {\n this.time = time;\n return this;\n }","function timerWrapper () {}","get elapsedTime() {\n return this._elapsedTime\n }","function updateTime(){\n setTimeContent(\"timer\");\n}","function setTime(){\n let dt = new Date();\n currScene.timeInScene = dt.getTime();\n}","function timeUpdate() {\n timeEngaged += delta();\n}","tickCaller(game){\n game.tick();\n }","function localClock(){\n digitalClock(0,\"clock\");\n digitalClock(-7,\"clockNy\")\n digitalClock(8,\"tokyo\") \n}","eventTimer() {throw new Error('Must declare the function')}","function Schedule(options,element){return _super.call(this,options,element)||this;}","time(time) {\n if (time == null) {\n return this._time;\n }\n\n let dt = time - this._time;\n this.step(dt);\n return this;\n }","timer() {\n this.sethandRotation('hour');\n this.sethandRotation('minute');\n this.sethandRotation('second');\n }","tick() {\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::tick\");\t\n var timeNow = new Date().getTime();\n\n if (this.lastTime != 0)\n \tthis.elapsed = timeNow - this.lastTime;\n\n this.lastTime = timeNow;\n }","get time () {\n\t\treturn this._time;\n\t}","function time(){\n\t $('#Begtime').mobiscroll().time({\n\t theme: 'wp',\n\t display: 'inline',\n\t mode: 'scroller'\n\t });\n\t $('#Endtime').mobiscroll().time({\n\t theme: 'wp',\n\t display: 'inline',\n\t mode: 'scroller'\n\t });\n\t removeUnwanted(); \n\t insertClass(); \n\t getTimeFromInput(\"Begtime\");\n\t getTimeFromInput(\"Endtime\");\n\t}","function Timer() {}","init(...args) {\n\t\tthis._super(...args);\n\n\t\tthis.setupTime();\n\t}","_setTime() {\n switch(this.difficultyLevel) {\n case 1:\n // this.gameTime uses ms\n this.gameTime = 45000;\n break;\n case 2:\n this.gameTime = 100000;\n break;\n case 3:\n this.gameTime = 160000;\n break;\n case 4:\n this.gameTime = 220000;\n break;\n default:\n throw new Error('there is no time');\n }\n }","function TimeManager() {\n var self = this;\n\n this.init = function () {\n self.initTime = (new Date()).getTime() / 1000;\n self.offset = 0;\n self.speed = 1;\n self.query_params = self.get_query_param();\n if (self.query_params.hasOwnProperty('time')) {\n self.offset = parseInt(self.query_params.time);\n }\n else if (self.query_params.hasOwnProperty('from')) {\n self.offset = parseInt(self.query_params.from);\n }\n if (self.offset) {\n self.speed = 20;\n }\n\n if (self.query_params.hasOwnProperty('speed')) {\n self.speed = parseFloat(self.query_params.speed);\n }\n };\n\n this.getTime = function() {\n var realTime = self.getRealTime();\n if (self.offset) {\n return self.offset + (realTime - self.initTime) * self.speed;\n }\n\n return realTime;\n };\n\n this.getRealTime = function () {\n return (new Date()).getTime() / 1000;\n };\n\n // Extracts query params from url.\n this.get_query_param = function () {\n var query_string = {};\n var query = window.location.search.substring(1);\n var pairs = query.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split('=');\n\n // If first entry with this name.\n if (typeof query_string[pair[0]] === 'undefined') {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n }\n // If second entry with this name.\n else if (typeof query_string[pair[0]] === 'string') {\n query_string[pair[0]] = [\n query_string[pair[0]],\n decodeURIComponent(pair[1])\n ];\n }\n // If third or later entry with this name\n else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n }\n\n return query_string;\n };\n\n this.init();\n\n return this;\n}","update_() {\n var current = this.tlc_.getCurrent();\n this.scope_['time'] = current;\n var t = new Date(current);\n\n var coord = this.coord_ || MapContainer.getInstance().getMap().getView().getCenter();\n\n if (coord) {\n coord = olProj.toLonLat(coord, osMap.PROJECTION);\n\n this.scope_['coord'] = coord;\n var sets = [];\n\n // sun times\n var suntimes = SunCalc.getTimes(t, coord[1], coord[0]);\n var sunpos = SunCalc.getPosition(t, coord[1], coord[0]);\n\n // Determine dawn/dusk based on user preference\n var calcTitle;\n var dawnTime;\n var duskTime;\n\n switch (settings.getInstance().get(SettingKey.DUSK_MODE)) {\n case 'nautical':\n calcTitle = 'Nautical calculation';\n dawnTime = suntimes.nauticalDawn.getTime();\n duskTime = suntimes.nauticalDusk.getTime();\n break;\n case 'civilian':\n calcTitle = 'Civilian calculation';\n dawnTime = suntimes.dawn.getTime();\n duskTime = suntimes.dusk.getTime();\n break;\n case 'astronomical':\n default:\n calcTitle = 'Astronomical calculation';\n dawnTime = suntimes.nightEnd.getTime();\n duskTime = suntimes.night.getTime();\n break;\n }\n\n var times = [{\n 'label': 'Dawn',\n 'time': dawnTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Sunrise',\n 'time': suntimes.sunrise.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Solar Noon',\n 'time': suntimes.solarNoon.getTime(),\n 'color': '#FFD700'\n }, {\n 'label': 'Sunset',\n 'time': suntimes.sunset.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Dusk',\n 'time': duskTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Night',\n 'time': suntimes.night.getTime(),\n 'color': '#000080'\n }];\n\n this.scope_['sun'] = {\n 'altitude': sunpos.altitude * geo.R2D,\n 'azimuth': (geo.R2D * (sunpos.azimuth + Math.PI)) % 360\n };\n\n // moon times\n var moontimes = SunCalc.getMoonTimes(t, coord[1], coord[0]);\n var moonpos = SunCalc.getMoonPosition(t, coord[1], coord[0]);\n var moonlight = SunCalc.getMoonIllumination(t);\n\n this.scope_['moonAlwaysDown'] = moontimes.alwaysDown;\n this.scope_['moonAlwaysUp'] = moontimes.alwaysUp;\n\n if (moontimes.rise) {\n times.push({\n 'label': 'Moonrise',\n 'time': moontimes.rise.getTime(),\n 'color': '#ddd'\n });\n }\n\n if (moontimes.set) {\n times.push({\n 'label': 'Moonset',\n 'time': moontimes.set.getTime(),\n 'color': '#2F4F4F'\n });\n }\n\n var phase = '';\n for (var i = 0, n = PHASES.length; i < n; i++) {\n if (moonlight.phase >= PHASES[i].min && moonlight.phase < PHASES[i].max) {\n phase = PHASES[i].label;\n break;\n }\n }\n\n this.scope_['moon'] = {\n 'alwaysUp': moontimes.alwaysUp,\n 'alwaysDown': moontimes.alwaysDown,\n 'azimuth': (geo.R2D * (moonpos.azimuth + Math.PI)) % 360,\n 'altitude': moonpos.altitude * geo.R2D,\n 'brightness': Math.ceil(moonlight.fraction * 100) + '%',\n 'phase': phase\n };\n\n times = times.filter(filter);\n times.forEach(addTextColor);\n googArray.sortObjectsByKey(times, 'time');\n sets.push(times);\n\n this.scope_['times'] = times;\n ui.apply(this.scope_);\n }\n }","function playInst(inst, startTime, stopTime){\n\n var inst = inst;\n var startTime = startTime;\n var stopTime = stopTime;\n\n inst.startAtTime(globalNow+startTime);\n inst.stopAtTime(globalNow+stopTime);\n\n}","constructor() {\r\n super();\r\n /**\r\n * Previous measurement time\r\n * @private\r\n * @type {number}\r\n */\r\n this.oldTime_;\r\n }","getGameTime() {\n return this.time / 1200;\n }","onChange(e) {\n if (this.props.onChange) {\n this.props.onChange(e);\n }\n window.$('#' + this.id).timepicker('setTime', e.target.value);\n }","update(scene, time, delta) {\n // Tick the time (setting the milliseconds will automatically convert up into seconds/minutes/hours)\n this.time.setMilliseconds(this.time.getMilliseconds() + (delta * this.speed * CONSTANTS.SIMULATION_SPEED_FACTOR));\n\n // Update the sky's ambient color\n this.updateAmbientLightColor();\n\n // Check if we can emit an event to the event emitter to notify about the time of day\n // Only emits once, thats why we have the flags\n if (this.time.getHours() == 8 && !this.calledMorning) {\n this.events.emit(\"morning\");\n\n this.calledMorning = true;\n this.calledNoon = false;\n this.calledEvening = false;\n this.calledNight = false;\n } else if (this.time.getHours() == 12 && !this.calledNoon) {\n this.events.emit(\"noon\");\n\n this.calledMorning = false;\n this.calledNoon = true;\n this.calledEvening = false;\n this.calledNight = false; \n } else if (this.time.getHours() == 18 && !this.calledEvening) {\n this.events.emit(\"evening\");\n\n this.calledMorning = false;\n this.calledNoon = false;\n this.calledEvening = true;\n this.calledNight = false; \n } else if (this.time.getHours() == 21 && !this.calledNight) {\n this.events.emit(\"night\");\n\n this.calledMorning = false;\n this.calledNoon = false;\n this.calledEvening = false;\n this.calledNight = true; \n }\n }","function interval(){\r\n\ttry{\r\n\t\tthis.startTime = function (){\t\r\n\t\t\ttry{\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tvar today=new Date();\r\n\t\t\t\t\tvar h=today.getHours();\r\n\t\t\t\t\tvar m=today.getMinutes();\r\n\t\t\t\t\tvar startm = today.getMinutes();\r\n var s=today.getSeconds();\r\n\t\t\t\t\t// add a zero in front of numbers<10\r\n\t\t\t\t\tm=this.checkTime(m);\r\n\t\t\t\t\ts=this.checkTime(s);\r\n\r\n $('txt').innerHTML= h+\":\"+m+\":\"+s;\r\n\t\t\t\t\t$('clock').value = m;\t\t\r\n\t\t\t\t\tt=setTimeout('intervalObj.startTime()',500);\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.startTime()');\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add a zero in front of numbers<10\r\n\t\tthis.checkTime = function(i){\r\n\t\t\ttry{\r\n\t\t\t\tif (i<10){\r\n\t\t\t\t\ti=\"0\" + i;\r\n\t\t\t\t}\r\n\t\t\t\treturn i;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.checkTime()');\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t//End of clock function\r\n\t\t//To start the clock on web page.\r\n\t\t\r\n\t\tthis.call = function(){\r\n\t\t\ttry{\r\n\r\n\t\t\t\t$('text').value=$('txt').innerHTML;\r\n\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.call()');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//To stop the clock.\r\n\t\tthis.stopTime = function(){\r\n\t\t\ttry{\r\n\t\t\t\t$('txtTime').value=$('txt').innerHTML;\r\n document.getElementById(\"txt\").style.display = 'none';\r\n\r\n }catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.stopTime()');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//To calculate the total time difference.\r\n\t\tthis.calculateTotalTime = function() {\r\n\t\t\ttry{\r\n\t\t\t\tvar t1=$('text').value;\r\n\t\t\t\tvar t2=$('txtTime').value;\r\n\t\t\t\tvar arrt1 = t1.split(\":\");\r\n\t\t\t\tvar arrt2 = t2.split(\":\");\t\t\r\n\t\t\t\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\r\n\t\t\t\tvar timeDifference=this.convertTime(sub);\t\t\r\n\t\t\treturn timeDifference;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\r\n\t\t\t}\t\r\n\t\t}\r\n this.calculatebatsmanTime = function(t1,t2) {\r\n\t\t\ttry{\r\n\t\t\t\r\n\t\t\t\tvar arrt1 = t1.split(\":\");\r\n\t\t\t\tvar arrt2 = t2.split(\":\");\r\n\t\t\t\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\r\n\t\t\t\tvar timeDifference=this.convertTime(sub);\r\n\t\t\treturn timeDifference;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\r\n\t\t\t}\r\n\t\t}\r\n\r\n //To Convert time.\r\n\t\tthis.convertTime = function(sub){\r\n\t\t\ttry{\r\n\t\t\t\tvar hrs=parseInt(sub/3600);\t\t\r\n\t\t\t\tvar rem=(sub%3600);\r\n\t\t\t\tvar min=parseInt(rem/60);\r\n\t\t\t\tvar sec=(rem%60);\r\n\t\t\t\tmin=this.checkTime(min);\r\n\t\t\t\tsec=this.checkTime(sec);\r\n\t\t\t\tvar convertDifference=(hrs+\":\"+min+\":\"+sec);\r\n\t\t\treturn convertDifference;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.convertTime()');\r\n\t\t\t}\t\r\n\t\t}\t\t\r\n\t\t//To display the time period of interruptions and intervals.\r\n\t\t\r\n\t\tthis.DisplayInterval=function(flag){\r\n\t\r\n\t\t\tvar MATCH_TIME_ACC=42000;//700min.\r\n\t\t\tvar MATCH_INNING_ACC=21000;//350min.\r\n\t\r\n\t\t\ttry{\r\n\t\t\t\tif($('text').value==\"\" && $('txtTime').value==\"\"){\r\n\t\t\t\t\talert(\"You Did Not Start Timer\");\r\n\t\t\t\t}else if(flag==1){\t\t\r\n\t\t\t\t\talert(\"Interruption Time is:: \"+this.calculateTotalTime());\r\n\t\t\t\t}else if(flag==2){\t\r\n\t\t\t\t\t//Interval-Injury\r\n\t\t\t\t\tvar time=this.calculateTotalTime();\r\n\t\t\t\t\tvar arrtime = time.split(\":\");\r\n\t\t\t\t\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\r\n\t\t\t\t\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\r\n\t\t\t\t\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\r\n\t\t\t\t\r\n\t\t\t\t}else if(flag==3){\r\n\t\t\t\t\t\t//Interval-Drink\r\n\t\t\t\t\t\tvar time=this.calculateTotalTime();\r\n\t\t\t\t\t\tvar arrtime = time.split(\":\");\r\n\t\t\t\t\t\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\r\n\t\t\t\t\t\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\r\n\t\t\t\t\t\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\r\n\t\t\t\t\t\tMATCH_INNING_ACC=MATCH_INNING_ACC+sec;//Adding minits in match_inning Account\r\n\t\t\t\t\t\tvar inningTime=this.convertTime(MATCH_INNING_ACC);\r\n\t\t\t\t}else if(flag==4){\r\n\t\t\t\t\t\t//Interval-Lunch/Tea.\r\n\t\t\t\t\t\tthis.calculateTotalTime();\r\n\t\t\t\t}\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.DisplayInterval()');\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t\t\r\n\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval()');\r\n\t}\t\t\r\n}","function newRE(name) {\n\n // Object holding defaults for various saved fields.\n var virginData = {\n type: \"pk_rhythm_engine\",\n version: 1,\n morpher: {x: 36, y: 36},\n kits: [],\n voices: [],\n presets: [],\n clock: {struc: \"simple\", sig: 0, bar: 0, beat: 0, pos: 0, tempo_bpm: 90, cycleLength: 16, running: false}\n };\n\n // data will be saved and loaded to localStorage.\n var data = copy_object(virginData);\n\n var clockLastTime_secs = undefined;\n var lastTickTime_secs = 0;\n var kDelay_secs = 0.05;\n var clockJSN = undefined;\n\n // Load info about existing kits into the engine.\n function initData() {\n var k, ki;\n for (k in availableKitInfos) {\n ki = availableKitInfos[k];\n data.kits.push({\n name: ki.name,\n url: ki.url\n });\n }\n }\n\n initData();\n\n var kitNames = [];\n\n // Status of whether the clockTick() should do morphing calculations.\n var morphEnabled = 0;\n var morphNeedsUpdate = false;\n\n // Clock callbacks.\n var onGridTick = undefined;\n var onMorphUpdate = undefined;\n\n // Runs at about 60 ticks per second (linked to screen refresh rate).\n function clockTick() {\n var clock = data.clock;\n\n // Check whether the engine is running.\n if (!clock.running) {\n clockLastTime_secs = undefined;\n return;\n }\n\n var delta_secs = 0, dbeat, dbar;\n\n while (true) {\n if (clockLastTime_secs) {\n var now_secs = theAudioContext.currentTime;\n var sqpb = kTimeStruc[clock.struc].semiQuaversPerBar;\n var ticks_per_sec = clock.tempo_bpm * sqpb / 60;\n var nextTickTime_secs = lastTickTime_secs + 1 / ticks_per_sec;\n if (now_secs + kDelay_secs >= nextTickTime_secs) {\n dbeat = Math.floor(((clock.pos % sqpb) + 1) / sqpb);\n dbar = Math.floor((clock.beat + dbeat) / kTimeSig.D[clock.sig]);\n clock.bar = (clock.bar + dbar) % kTimeStruc[clock.struc].cycleLength;\n clock.beat = (clock.beat + dbeat) % kTimeSig.N[clock.sig];\n clock.pos = clock.pos + 1;\n lastTickTime_secs = nextTickTime_secs;\n } else {\n return;\n }\n } else {\n // Very first call.\n clockLastTime_secs = theAudioContext.currentTime;\n clock.bar = 0;\n clock.beat = 0;\n clock.pos = 0;\n lastTickTime_secs = clockLastTime_secs + kDelay_secs;\n }\n\n // If we're doing a morph, set all the relevant control values.\n updateMorph();\n\n // Perform all the voices for all the active presets.\n var i, N, v;\n for (i = 0, N = data.voices.length; i < N; ++i) {\n v = data.voices[i];\n if (v) {\n genBeat(v, clock, lastTickTime_secs);\n }\n }\n\n // Do the callback if specified.\n if (onGridTick) {\n onGridTick(clock);\n }\n }\n }\n\n var kVoiceControlsToMorph = [\n 'straight', 'offbeat', 'funk', 'phase', 'random', \n 'ramp', 'threshold', 'mean', 'cycleWeight', 'volume', 'pan'\n ];\n\n // Utility to calculate a weighted sum.\n // \n // weights is an array of weights. Entries can include 'undefined',\n // in which case they'll not be included in the weighted sum.\n //\n // value_getter is function (i) -> value\n // result_transform(value) is applied to the weighted sum before \n // returning the result value.\n function morphedValue(weights, value_getter, result_transform) {\n var result = 0, wsum = 0;\n var i, N, val;\n for (i = 0, N = weights.length; i < N; ++i) {\n if (weights[i] !== undefined) {\n val = value_getter(i);\n if (val !== undefined) {\n result += weights[i] * val;\n wsum += weights[i];\n }\n }\n }\n return result_transform ? result_transform(result / wsum) : result / wsum;\n }\n\n // Something about the morph status changed.\n // Update the parameters of all the voices to reflect\n // the change.\n function updateMorph() {\n var i, N;\n if (morphEnabled && morphNeedsUpdate && data.presets.length > 1) {\n\n // Compute morph distances for each preset.\n var morphWeights = [], dx, dy, ps;\n for (i = 0, N = data.presets.length; i < N; ++i) {\n ps = data.presets[i];\n if (ps && ps.useInMorph) {\n dx = data.morpher.x - data.presets[i].pos.x;\n dy = data.morpher.y - data.presets[i].pos.y;\n morphWeights[i] = 1 / (1 + Math.sqrt(dx * dx + dy * dy));\n }\n }\n\n // For each voice, compute the morph.\n var wsum = 0, wnorm = 1, p, pN, w, c, cN, v;\n\n // Normalize the morph weights.\n wsum = morphedValue(morphWeights, function (p) { return 1; });\n wnorm = 1 / wsum; // WARNING: Divide by zero?\n\n // For each voice and for each control in each voice, do the morph.\n for (i = 0, N = data.voices.length; i < N; ++i) {\n for (c = 0, cN = kVoiceControlsToMorph.length, v = data.voices[i]; c < cN; ++c) {\n v[kVoiceControlsToMorph[c]] = morphedValue(morphWeights, function (p) { \n var ps = data.presets[p];\n return i < ps.voices.length ? ps.voices[i][kVoiceControlsToMorph[c]] : undefined;\n });\n }\n }\n\n // Now morph the tempo. We morph the tempo in the log domain.\n data.clock.tempo_bpm = morphedValue(morphWeights, function (p) { return Math.log(data.presets[p].clock.tempo_bpm); }, Math.exp);\n\n // Morph the cycle length.\n data.clock.cycleLength = Math.round(morphedValue(morphWeights, function (p) { return data.presets[p].clock.cycleLength; }));\n \n if (onMorphUpdate) {\n setTimeout(onMorphUpdate, 0);\n }\n\n morphNeedsUpdate = false;\n --morphEnabled;\n }\n }\n\n // We store info about all the presets as a JSON string in\n // a single key in localStorage.\n var storageKey = 'com.nishabdam.PeteKellock.RhythmEngine.' + name + '.data';\n\n // Loads the previous engine state saved in localStorage.\n function load(delegate) {\n var dataStr = window.localStorage[storageKey];\n if (dataStr) {\n loadFromStr(dataStr, delegate);\n } else {\n alert(\"RhythmEngine: load error\");\n }\n }\n\n // Loads an engine state saved as a string from, possibly, an \n // external source.\n function loadFromStr(dataStr, delegate) {\n try {\n data = JSON.parse(dataStr);\n } catch (e) {\n setTimeout(function () {\n delegate.onError(\"Corrupt rhythm engine snapshot file.\");\n }, 0);\n return;\n }\n\n var work = {done: 0, total: 0};\n\n function reportProgress(changeInDone, changeInTotal, desc) {\n work.done += changeInDone;\n work.total += changeInTotal;\n if (delegate.progress) {\n delegate.progress(work.done, work.total, desc);\n }\n }\n\n reportProgress(0, data.kits.length * 10);\n\n kitNames = [];\n\n data.kits.forEach(function (kitInfo) {\n SampleManager.loadSampleSet(kitInfo.name, kitInfo.url, {\n didFetchMappings: function (name, mappings) {\n reportProgress(0, getKeys(mappings).length * 2);\n },\n didLoadSample: function (name, key) {\n reportProgress(1, 0);\n },\n didDecodeSample: function () {\n reportProgress(1, 0);\n },\n didFinishLoadingSampleSet: function (name, sset) {\n kitNames.push(name);\n\n // Save the drum names.\n kitInfo.drums = getKeys(sset);\n\n reportProgress(10, 0);\n\n if (kitNames.length === data.kits.length) {\n // We're done.\n delegate.didLoad();\n clockTick();\n }\n }\n });\n });\n }\n\n // This is for loading the JSON string if the user \n // gives it by choosing an external file.\n function loadExternal(fileData, delegate, dontSave) {\n if (checkSnapshotFileData(fileData, delegate)) {\n loadFromStr(fileData, {\n progress: delegate.progress,\n didLoad: function () {\n if (!dontSave) {\n save();\n }\n delegate.didLoad();\n }\n });\n }\n }\n\n // A simple check for the starting part of a snapshot file.\n // This relies on the fact that browser javascript engines\n // enumerate an object's keys in the same order in which they\n // were inserted into the object.\n function checkSnapshotFileData(fileData, delegate) {\n var valid = (fileData.indexOf('{\"type\":\"pk_rhythm_engine\"') === 0);\n if (!valid) {\n setTimeout(function () {\n delegate.onError(\"This is not a rhythm engine snapshot file.\");\n }, 0);\n }\n return valid;\n }\n\n // Loads settings from file with given name, located in\n // the \"settings\" folder.\n function loadFile(filename, delegate) {\n if (filename && typeof(filename) === 'string') {\n fs.root.getDirectory(\"settings\", {create: true},\n function (settingsDir) {\n settingsDir.getFile(filename, {create: false},\n function (fileEntry) {\n fileEntry.file(\n function (f) {\n var reader = new global.FileReader();\n\n reader.onloadend = function () {\n loadExternal(reader.result, delegate, true);\n };\n reader.onerror = delegate && delegate.onError;\n\n reader.readAsText(f);\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n } else {\n load(delegate);\n }\n }\n\n // Makes an array of strings giving the names of saved\n // settings and calls delegate.didListSettings(array)\n // upon success. delegate.onError is called if there is\n // some error.\n function listSavedSettings(delegate) {\n fs.root.getDirectory(\"settings\", {create: true},\n function (settingsDir) {\n var reader = settingsDir.createReader();\n var result = [];\n\n function readEntries() {\n reader.readEntries(\n function (entries) {\n var i, N;\n\n if (entries.length === 0) {\n // We're done.\n delegate.didListSettings(result.sort());\n } else {\n // More to go. Accumulate the names.\n for (i = 0, N = entries.length; i < N; ++i) {\n result.push(entries[i].name);\n }\n\n // Continue listing the directory.\n readEntries();\n }\n },\n delegate && delegate.onError\n );\n }\n\n readEntries();\n },\n delegate && delegate.onError\n );\n }\n\n // Saves all the presets in local storage.\n function save(filename, delegate) {\n var dataAsJSON = JSON.stringify(data);\n\n // First save a copy in the locaStorage for worst case scenario.\n window.localStorage[storageKey] = dataAsJSON;\n\n if (filename && typeof(filename) === 'string') {\n fs.root.getDirectory(\"settings\", {create: true},\n function (settingsDir) {\n settingsDir.getFile(filename, {create: true},\n function (f) {\n f.createWriter(\n function (writer) {\n writer.onwriteend = delegate && delegate.didSave;\n writer.onerror = delegate && delegate.onError;\n\n var bb = new global.BlobBuilder();\n bb.append(dataAsJSON);\n writer.write(bb.getBlob());\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n }\n }\n\n // Make a \"voice\" object exposing all the live-tweakable\n // parameters. The API user can just set these parameters\n // to hear immediate effect in the RE's output.\n function make_voice(kit, drum) {\n return {\n voice: {kit: kit, drum: drum},\n straight: 0.5,\n offbeat: 0.0,\n funk: 0.0,\n phase: 0,\n random: 0.0,\n ramp: 0.2,\n threshold: 0.5,\n mean: 0.5,\n cycleWeight: 0.2,\n volume: 1.0,\n pan: 0.0\n };\n }\n\n function validatePresetIndex(p, extra) {\n if (p < 0 || p >= data.presets.length + (extra ? extra : 0)) {\n throw new Error('Invalid preset index!');\n }\n }\n\n return {\n kits: data.kits, // Read-only.\n save: save,\n snapshot: function () { return JSON.stringify(data); },\n load: loadFile,\n list: listSavedSettings,\n import: loadExternal,\n\n // You can set a callback to be received on every grid tick so\n // that you can do something visual about it. The callback will\n // receive the current clock status as the sole argument.\n // The callback is expected to not modify the clock.\n get onGridTick() { return onGridTick; },\n set onGridTick(newCallback) { onGridTick = newCallback; },\n\n // You can set a callback for notification whenever the bulk\n // of sliders have been changed due to a morph update.\n get onMorphUpdate() { return onMorphUpdate; },\n set onMorphUpdate(newCallback) { onMorphUpdate = newCallback; },\n\n // Change the tempo by assigning to tempo_bpm field.\n get tempo_bpm() {\n return data.clock.tempo_bpm;\n },\n set tempo_bpm(new_tempo_bpm) {\n data.clock.tempo_bpm = Math.min(Math.max(10, new_tempo_bpm), 480);\n },\n\n // Info about the voices and facility to add more.\n numVoices: function () { return data.voices.length; },\n voice: function (i) { return data.voices[i]; },\n addVoice: function (kit, drum) {\n var voice = make_voice(kit || 'acoustic-kit', drum || 'kick');\n data.voices.push(voice);\n return voice;\n },\n\n // Info about presets and the ability to add/save to presets.\n numPresets: function () { return data.presets.length; },\n preset: function (p) { return data.presets[p]; },\n saveAsPreset: function (p) {\n validatePresetIndex(p, 1);\n\n p = Math.min(data.presets.length, p);\n\n // Either make a new preset or change a saved one.\n // We preserve a preset's morph weight if we're\n // changing one to a new snapshot.\n var old = (p < data.presets.length ? data.presets[p] : {pos: {x: 0, y: 0}});\n data.presets[p] = {\n useInMorph: old.useInMorph,\n pos: copy_object(old.pos),\n clock: copy_object(data.clock),\n voices: copy_object(data.voices)\n };\n },\n\n\n // Morphing functions. The initial state of the morpher is \"disabled\",\n // so as long as that is the case, none of the 2D position functions\n // have any effect. You first need to enable the morpher before\n // the other calls have any effect.\n enableMorph: function (flag) {\n morphEnabled += flag ? 1 : 0;\n if (flag) {\n morphNeedsUpdate = true;\n }\n },\n presetPos: function (p) { return data.presets[p].pos; },\n changePresetPos: function (p, x, y) {\n validatePresetIndex(p);\n var pos = data.presets[p].pos;\n pos.x = x;\n pos.y = y;\n morphNeedsUpdate = true;\n },\n morpherPos: function () { return data.morpher; },\n changeMorpherPos: function (x, y) {\n data.morpher.x = x;\n data.morpher.y = y;\n morphNeedsUpdate = true;\n },\n\n // Starting and stopping the engine. Both methods are\n // idempotent.\n get running() { return data.clock.running; },\n start: function () {\n if (!data.clock.running) {\n data.clock.running = true;\n clockLastTime_secs = undefined;\n clockJSN = theAudioContext.createJavaScriptNode(512, 0, 1);\n clockJSN.onaudioprocess = function (event) {\n clockTick();\n };\n clockJSN.connect(theAudioContext.destination);\n }\n },\n stop: function () {\n data.clock.running = false;\n if (clockJSN) {\n clockJSN.disconnect();\n clockJSN = undefined;\n }\n }\n };\n }","function tick() {\n\n\n\n}","set_time( t ){ this.current_time = t; this.draw_fg(); return this; }"],"string":"[\n \"function tickCurrentTimeEngine() {\\n\\n var d = new Date();\\n\\n currentHours = d.getHours();\\n currentMinutes = d.getMinutes();\\n currentSeconds = d.getSeconds();\\n\\n if (currentHours.toString().length == 1) {\\n choursDigit_1 = 0;\\n choursDigit_2 = currentHours;\\n }\\n else {\\n choursDigit_1 = parseInt(currentHours.toString().charAt(0), 10);\\n choursDigit_2 = parseInt(currentHours.toString().charAt(1), 10);\\n }\\n\\n if (currentMinutes.toString().length == 1) {\\n cminutesDigit_1 = 0;\\n cminutesDigit_2 = currentMinutes;\\n }\\n else {\\n cminutesDigit_1 = parseInt(currentMinutes.toString().charAt(0), 10);\\n cminutesDigit_2 = parseInt(currentMinutes.toString().charAt(1), 10);\\n }\\n\\n if (currentSeconds.toString().length == 1) {\\n csecondsDigit_1 = 0;\\n csecondsDigit_2 = currentSeconds;\\n }\\n else {\\n csecondsDigit_1 = parseInt(currentSeconds.toString().charAt(0), 10);\\n csecondsDigit_2 = parseInt(currentSeconds.toString().charAt(1), 10);\\n }\\n\\n tickCurrentTime = setTimeout(tickCurrentTimeEngine, timerCurrentTimeMiliSecs);\\n\\n return;\\n }\",\n \"function Time() {}\",\n \"get time () { throw \\\"Game system not supported\\\"; }\",\n \"_onTimeupdate () {\\n this.emit('timeupdate', this.getCurrentTime())\\n }\",\n \"_onTimeupdate () {\\n this.emit('timeupdate', this.getCurrentTime())\\n }\",\n \"function TimeUtils() {}\",\n \"getTime(){return this.time;}\",\n \"function Engine() {\\n }\",\n \"onTimeChanged () {\\n this.view.renderTimeAndDate();\\n }\",\n \"function tickTime() {\\n // the magic object with all the time data\\n // the present passing current moment\\n let pc = {\\n thisMoment: {},\\n current: {},\\n msInA: {},\\n utt: {},\\n passage: {},\\n display: {}\\n };\\n\\n // get the current time\\n pc.thisMoment = {};\\n pc.thisMoment = new Date();\\n\\n // slice current time into units\\n pc.current = {\\n ms: pc.thisMoment.getMilliseconds(),\\n second: pc.thisMoment.getSeconds(),\\n minute: pc.thisMoment.getMinutes(),\\n hour: pc.thisMoment.getHours(),\\n day: pc.thisMoment.getDay(),\\n date: pc.thisMoment.getDate(),\\n week: weekOfYear(pc.thisMoment),\\n month: pc.thisMoment.getMonth(),\\n year: pc.thisMoment.getFullYear()\\n };\\n\\n // TODO: display day of week and month name\\n let dayOfWeek = DAYS[pc.current.day];\\n let monthName = MONTHS[pc.current.month];\\n\\n // returns the week no. out of the year\\n function weekOfYear(d) {\\n d.setHours(0, 0, 0);\\n d.setDate(d.getDate() + 4 - (d.getDay() || 7));\\n return Math.ceil(((d - new Date(d.getFullYear(), 0, 1)) / 8.64e7 + 1) / 7);\\n }\\n\\n // set the slice conversions based on pc.thisMoment\\n pc.msInA.ms = 1;\\n pc.msInA.second = 1000;\\n pc.msInA.minute = pc.msInA.second * 60;\\n pc.msInA.hour = pc.msInA.minute * 60;\\n pc.msInA.day = pc.msInA.hour * 24;\\n pc.msInA.week = pc.msInA.day * 7;\\n pc.msInA.month = pc.msInA.day * MONTH_DAYS[pc.current.month - 1];\\n pc.msInA.year = pc.msInA.day * daysThisYear(pc.current.year);\\n\\n // handle leap years\\n function daysThisYear(year) {\\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\\n MONTH_DAYS[1] = 29;\\n return 366;\\n } else {\\n return 365;\\n }\\n }\\n\\n // utt means UpToThis\\n // calculates the count in ms of each unit that has passed\\n pc.utt.ms = pc.current.ms;\\n pc.utt.second = pc.current.second * pc.msInA.second + pc.utt.ms;\\n pc.utt.minute = pc.current.minute * pc.msInA.minute + pc.utt.second;\\n pc.utt.hour = pc.current.hour * pc.msInA.hour + pc.utt.minute;\\n pc.utt.day = pc.current.day * pc.msInA.day + pc.utt.hour;\\n pc.utt.week = pc.current.week * pc.msInA.week + pc.utt.day;\\n pc.utt.date = pc.current.date * pc.msInA.day + pc.utt.hour;\\n pc.utt.month = pc.current.month + 1 * pc.msInA.month + pc.utt.date;\\n pc.utt.year = pc.current.year * pc.msInA.year + pc.utt.month;\\n\\n // calculates the proportion/ratio of each unit that has passed\\n // used to display percentages\\n pc.passage = {\\n ms: pc.current.ms / 100,\\n second: pc.current.ms / pc.msInA.second,\\n minute: pc.utt.second / pc.msInA.minute,\\n hour: pc.utt.minute / pc.msInA.hour,\\n day: pc.utt.hour / pc.msInA.day,\\n week: pc.utt.day / pc.msInA.week,\\n month: pc.utt.date / pc.msInA.month,\\n year: pc.utt.month / pc.msInA.year\\n };\\n\\n // tidies up the current clock readouts for display\\n pc.display = {\\n ms: pc.utt.ms,\\n second: pc.current.second,\\n minute: pc.current.minute.toString().padStart(2, \\\"0\\\"),\\n hour: pc.current.hour.toString().padStart(2, \\\"0\\\"),\\n day: pc.current.date,\\n week: pc.current.week,\\n month: pc.current.month.toString().padStart(2, \\\"0\\\"),\\n year: pc.current.year\\n };\\n\\n if (debug) {\\n console.dir(pc);\\n }\\n\\n // returns the ratios and the clock readouts\\n return { psg: pc.passage, dsp: pc.display };\\n}\",\n \"overTime(){\\n\\t\\t//\\n\\t}\",\n \"function updateTime() {\\n\\n}\",\n \"function task4 () {\\n\\n function Clock (options) {\\n this._template = options.template\\n }\\n \\n Clock.prototype.render = function() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = this._template.replace('h', hours)\\n .replace('m', min)\\n .replace('s', sec);\\n console.log(output);\\n };\\n\\n Clock.prototype.stop = function () {\\n clearInterval(this._timer)\\n }\\n\\n Clock.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), 1000)\\n };\\n\\n\\n\\n // Descendant\\n\\n function RelativeClock(options) {\\n Clock.apply(this, arguments) // coffee script super() :)\\n this._precision = options.precision || 1000\\n };\\n\\n RelativeClock.prototype = Object.create(Clock.prototype);\\n RelativeClock.prototype.constructor = RelativeClock;\\n\\n RelativeClock.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), this._precision)\\n };\\n\\n var rc = new RelativeClock({\\n template: \\\"h:m:s\\\",\\n precision: 10000\\n })\\n rc.start()\\n}\",\n \"function classTime(C_E,desc,day,start,fin,loc,start_date){\\n this.C_E = C_E;\\n this.desc = desc;\\n this.day = day;\\n this.start = start;\\n this.fin = fin;\\n this.loc = loc;\\n this.start_date = start_date;\\n}\",\n \"function __time($obj) {\\r\\n if (window.STATICCLASS_CALENDAR==null) {\\r\\n window.STATICCLASS_CALENDAR = __loadScript(\\\"CalendarTime\\\", 1);\\r\\n }\\r\\n window.STATICCLASS_CALENDAR.perform($obj);\\r\\n}\",\n \"function timeTest()\\r\\n{\\r\\n}\",\n \"function startTime() {\\n setTimer();\\n}\",\n \"constructor() {\\n /** Indicates if the clock is endend. */\\n this.endedLocal = false;\\n /** The duration between start and end of the clock. */\\n this.diff = null;\\n this.startTimeLocal = new Date();\\n this.hrtimeLocal = process.hrtime();\\n }\",\n \"function Stopwatch() {}\",\n \"function task3 () {\\n //\\n function Clock(options) {\\n var template = options.template;\\n var timer;\\n \\n function render() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\\n console.log(output);\\n }\\n this.stop = function() {\\n clearInterval(timer);\\n };\\n this.start = function() {\\n render();\\n timer = setInterval(render, 1000);\\n }\\n }\\n \\n var cf = new Clock({\\n template: 'h:m:s'\\n });\\n // cf.start();\\n\\n\\n function ClockP (options) {\\n this._template = options.template\\n this._timer = null\\n }\\n\\n ClockP.prototype.render = function() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = this._template.replace('h', hours)\\n .replace('m', min)\\n .replace('s', sec);\\n console.log(output);\\n };\\n\\n ClockP.prototype.stop = function () {\\n clearInterval(this._timer)\\n }\\n\\n ClockP.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), 1000)\\n };\\n\\n var cp = new ClockP({\\n template: 'h:m:s'\\n });\\n cp.start();\\n\\n}\",\n \"applyWorkingTime(timeAxis) {\\n const me = this,\\n config = me._workingTime;\\n\\n if (config) {\\n let hour = null;\\n // Only use valid values\\n if (\\n config.fromHour >= 0 &&\\n config.fromHour < 24 &&\\n config.toHour > config.fromHour &&\\n config.toHour <= 24 &&\\n config.toHour - config.fromHour < 24\\n ) {\\n hour = { from: config.fromHour, to: config.toHour };\\n }\\n\\n let day = null;\\n // Only use valid values\\n if (\\n config.fromDay >= 0 &&\\n config.fromDay < 7 &&\\n config.toDay > config.fromDay &&\\n config.toDay <= 7 &&\\n config.toDay - config.fromDay < 7\\n ) {\\n day = { from: config.fromDay, to: config.toDay };\\n }\\n\\n if (hour || day) {\\n timeAxis.include = {\\n hour,\\n day\\n };\\n } else {\\n // No valid rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n } else {\\n // No rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n\\n if (me.rendered) {\\n // Refreshing header, which also recalculate tickSize and header data\\n me.timeAxisColumn.refreshHeader();\\n // Update column lines\\n if (me.features.columnLines) {\\n me.features.columnLines.drawLines();\\n }\\n\\n // Animate event changes\\n me.refreshWithTransition();\\n }\\n }\",\n \"currentTime() {\\n this.time24 = new Time();\\n this.updateTime(false);\\n }\",\n \"function SimulationEngine() {\\n\\t\\t\\n\\t}\",\n \"function tickTheClock(){\\n\\n \\n \\n}\",\n \"function engine() {\\n \\n run = false;\\n leg = length;\\n \\n while(leg--) {\\n \\n itm = dictionary[leg];\\n \\n if(!itm) break;\\n if(itm.isCSS) continue;\\n \\n if(itm.cycle()) {\\n \\n run = true;\\n\\n }\\n else {\\n \\n itm.stop(false, itm.complete, false, true);\\n \\n }\\n \\n }\\n \\n if(request) {\\n \\n if(run) {\\n \\n request(engine);\\n \\n }\\n else {\\n \\n cancel(engine);\\n itm = trans = null;\\n \\n }\\n \\n }\\n else {\\n \\n if(run) {\\n \\n if(!engineRunning) timer = setInterval(engine, intervalSpeed);\\n \\n }\\n else {\\n \\n clearInterval(timer);\\n itm = trans = null;\\n \\n }\\n \\n }\\n \\n engineRunning = run;\\n \\n }\",\n \"function updateTime() {\\n console.log(\\\"updateTime()\\\");\\n store.timeModel.update();\\n}\",\n \"get_timeSet() {\\n return this.liveFunc._timeSet;\\n }\",\n \"function Clock() {\\n\\n var daysInAMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\\n\\n this.month = 1;\\n this.day = 1;\\n this.year = 2016;\\n\\n this.tick = function() {\\n this.day += 1;\\n\\n if (this.day > daysInAMonth[this.month - 1]) {\\n this.month += 1;\\n this.day = 1;\\n }\\n\\n }\\n\\n this.time = function() {\\n \\tvar month = this.month < 10 ? \\\"0\\\" + this.month : this.month;\\n \\tvar day = this.day < 10 ? \\\"0\\\" + this.day : this.day;\\n console.log(`${this.year}-${month}-${day}`)\\n }\\n\\n this.getTime = function() {\\n var month = this.month < 10 ? \\\"0\\\" + this.month : this.month;\\n \\tvar day = this.day < 10 ? \\\"0\\\" + this.day : this.day;\\n return `${this.year}-${month}-${day}`;\\n }\\n\\n}\",\n \"function onSystemTimeChanged() {\\r\\n updateTime();\\r\\n }\",\n \"function setTime( t ){\\n\\n this.time = t;\\n\\n }\",\n \"getTime(){\\n this.time = millis();\\n this.timeFromLast = this.time - this.timeUntilLast;\\n\\n this.lifeTime = this.time - this.startTime;\\n \\n \\n }\",\n \"get elapsedTime() {\\n return this._t;\\n }\",\n \"function startTime()\\n{\\n //get how long does it take for the smallest unit to elapse to set timeouts\\n var timeout = time.units[time.units.length-1];\\n\\n //put the name into the text\\n $(\\\"[class^=timeName]\\\").html(time.name);\\n\\n //clocks\\n localTime();\\n currentFictional(timeout);\\n countdownToBegin(timeout);\\n\\n //converters\\n $(\\\"#eyToTimeY\\\").submit(function(event){\\n event.preventDefault();\\n $(\\\"#eyToTimeYResult\\\").text( earthYearsToTimeYears($(\\\"#eyToTimeYInput\\\").val()) );\\n });\\n\\n //SUT year to Earth year\\n $(\\\"#timeToEY\\\").submit(function(event){\\n event.preventDefault();\\n $(\\\"#timeToEYResult\\\").text( timeYearsToEarthYears($(\\\"#timeToEYInput\\\").val()) );\\n });\\n\\n //setup date picker for Earth year\\n $(\\\"#eDToTimeInput\\\").fdatepicker({format:\\\"yyyy-mm-dd\\\"});\\n //Earth date to SUT\\n $(\\\"#eDToTime\\\").submit(function(event){\\n event.preventDefault();\\n $(\\\"#eDToTimeResult\\\").text( earthDateToTime($(\\\"#eDToTimeInput\\\").val()) );\\n });\\n\\n}\",\n \"function timebase() {\\n\\t//timebased will interupt all other routines once started, until shutdown\\n\\t\\n\\t//TODO: turn timebase off completely by killing the interval function.\\n\\tif (timebase_status != \\\"running\\\") {\\n\\t\\treturn;\\n\\t}\\n\\n\\tvar current_hour = date.getHours();\\n\\tvar current_month = date.getMonth();\\n\\n\\t//Daytime (7:00 - 19:00)\\n\\tif (current_hour >= 7 && current_hour < 18+season_sunset_offset) {\\n\\t\\t//TODO: fade in from sunrise to sunrise+1hr\\n\\t\\t\\n\\t\\t//TODO: change hue/sat value in feedback loop from color zone sensor!\\n\\t\\t\\n\\t\\t//Turn on when active.\\n\\t\\tif (hasActive(detectionData)) {\\n\\t\\t\\tstateChange('on');\\n\\t\\t}\\n\\t//Nighttime (19:00 - 2:00)\\n\\t} else if (current_hour >= 18+season_sunset_offset || current_hour < 2) {\\n\\t\\t//TODO: Flux full transition from 19:00 to 21:30\\n\\t\\t\\n\\t\\t//Turn on when active.\\n\\t\\tif (hasActive(detectionData)) {\\n\\t\\t\\tstateChange('on');\\n\\t\\t}\\n\\t}\\n\\t//Supernight (2:00 - 7:00)\\n\\telse if (current_hour >= 2 && current_hour < 7) {\\n\\t\\t//Turn on when active.\\n\\t\\t//TODO: only 10% brightness.\\n\\t\\tif (hasActive(detectionData)) {\\n\\t\\t\\tstateChange('on'); //TODO: Per zone.\\n\\t\\t}\\n\\t}\\n\\n\\t//TODO: grab realtime sunrise/set data from internet\\n\\t//Sunrise accent effect\\n\\tif (0) {\\n\\t\\t//TODO: Flash accents red, yellow, blue\\n\\t}\\n\\n\\t//Sunset accent effect\\n\\tif (0) {\\n\\t\\t//TODO: Flash accents red, yellow, blue\\n\\t}\\n\\n\\t//TODO: grab data from ical file off the internet every day. \\n\\t//Calendar effects\\n\\tif (0) { //if event_start\\n\\t\\t//TODO: Flash accents red, yellow, blue\\n\\t}\\n\\n\\t//check for securityMode\\n\\tif (hasActive(detectionData) && securityMode) {\\n\\t\\t//disable it\\n\\t\\tsecurityMode = false;\\n\\t\\t//TODO: Flash welcome home accent pattern.\\n\\t}\\n\\n\\t//Seasonal changes\\n\\t//Summer- push sunset back.\\n\\tif (current_month > 4 || current_month < 9) {\\n\\t\\tseason_sunset_offset = 1.5;\\n\\t}\\n\\t\\n\\t//TODO: Update the light/history database here.\\n\\t//TODO: Check if database has no records for last 24 hours\\n\\t//Security Mode: simulate house\\n\\tif (0) {\\n\\t\\tvar securityMode = true;\\n\\t\\t//TODO: Implment security mode\\n\\t}\\n\\t//TODO: Parse duke api for warnings\\n\\tif (0) {\\n\\t\\t//TODO: Check if it's an updated posting or not, and if so, flash accents red/yellow every 30s until disabled.\\n\\t}\\n\\n}\",\n \"update(timeStep) {\\n\\n }\",\n \"function LogicNodeTime() {\\n\\t\\tLogicNode.call(this);\\n\\t\\tthis.wantsProcessCall = true;\\n\\t\\tthis.logicInterface = LogicNodeTime.logicInterface;\\n\\t\\tthis.type = 'LogicNodeTime';\\n\\t\\tthis._time = 0;\\n\\t\\tthis._running = true;\\n\\t}\",\n \"function calcEquationOfTime(t) {\\n\\t var epsilon = calcObliquityCorrection(t);\\n\\t var l0 = calcGeomMeanLongSun(t);\\n\\t var e = calcEccentricityEarthOrbit(t);\\n\\t var m = calcGeomMeanAnomalySun(t);\\n\\n\\t var y = Math.tan(degToRad(epsilon) / 2.0);\\n\\t y *= y;\\n\\n\\t var sin2l0 = Math.sin(2.0 * degToRad(l0));\\n\\t var sinm = Math.sin(degToRad(m));\\n\\t var cos2l0 = Math.cos(2.0 * degToRad(l0));\\n\\t var sin4l0 = Math.sin(4.0 * degToRad(l0));\\n\\t var sin2m = Math.sin(2.0 * degToRad(m));\\n\\n\\t var Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;\\n\\t return radToDeg(Etime) * 4.0; // in minutes of time\\n\\t}\",\n \"createTimer() {\\n\\t\\t// set initial in seconds\\n\\t\\tthis.initialTime = 0;\\n\\n\\t\\t// display text on Axis with formated Time\\n\\t\\tthis.text = this.add.text(\\n\\t\\t\\t16,\\n\\t\\t\\t50,\\n\\t\\t\\t\\\"Time: \\\" + this.formatTime(this.initialTime)\\n\\t\\t);\\n\\n\\t\\t// Each 1000 ms call onEvent\\n\\t\\tthis.timedEvent = this.time.addEvent({\\n\\t\\t\\tdelay: 1000,\\n\\t\\t\\tcallback: this.onEvent,\\n\\t\\t\\tcallbackScope: this,\\n\\t\\t\\tloop: true,\\n\\t\\t});\\n\\t}\",\n \"function KalturaTimeWarnerService(client){\\n\\tthis.init(client);\\n}\",\n \"function TimeStamp() {}\",\n \"function TimeStamp() {}\",\n \"get startTime() { return this._startTime; }\",\n \"applyWorkingTime(timeAxis) {\\n const me = this,\\n config = me._workingTime;\\n\\n if (config) {\\n let hour = null; // Only use valid values\\n\\n if (config.fromHour >= 0 && config.fromHour < 24 && config.toHour > config.fromHour && config.toHour <= 24 && config.toHour - config.fromHour < 24) {\\n hour = {\\n from: config.fromHour,\\n to: config.toHour\\n };\\n }\\n\\n let day = null; // Only use valid values\\n\\n if (config.fromDay >= 0 && config.fromDay < 7 && config.toDay > config.fromDay && config.toDay <= 7 && config.toDay - config.fromDay < 7) {\\n day = {\\n from: config.fromDay,\\n to: config.toDay\\n };\\n }\\n\\n if (hour || day) {\\n timeAxis.include = {\\n hour,\\n day\\n };\\n } else {\\n // No valid rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n } else {\\n // No rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n\\n if (me.isPainted) {\\n var _me$features$columnLi;\\n\\n // Refreshing header, which also recalculate tickSize and header data\\n me.timeAxisColumn.refreshHeader(); // Update column lines\\n\\n (_me$features$columnLi = me.features.columnLines) === null || _me$features$columnLi === void 0 ? void 0 : _me$features$columnLi.refresh(); // Animate event changes\\n\\n me.refreshWithTransition();\\n }\\n }\",\n \"changeStartTime(startTime){\\n this.startTime = startTime;\\n }\",\n \"twelveClock () {\\n const shiftAM = () => this.#hour < 4\\n ? eveningGreet.run()\\n : morningGreet.run()\\n\\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\\n ? eveningGreet.run()\\n : afternoonGreet.run()\\n\\n return this.#shift === 'AM'\\n ? shiftAM()\\n : shiftPM()\\n }\",\n \"get(){\\n\\t\\t// debug\\n\\t\\t// console.log(\\\"atomicGLClock::get\\\");\\t\\n\\t\\treturn this.elapsed;\\n\\t}\",\n \"liveTime() {\\n\\t\\tthis.updateTime();\\n\\t\\tthis.writeLog();\\n\\t}\",\n \"onSleepingTime() {\\n throw new NotImplementedException();\\n }\",\n \"function templateEngine () { }\",\n \"function test_timepicker_should_pass_correct_timing_on_service_order() {}\",\n \"function Time() {\\n this._clock = void 0;\\n this._timeScale = void 0;\\n this._deltaTime = void 0;\\n this._startTime = void 0;\\n this._lastTickTime = void 0;\\n this._clock = wechatAdapter.performance ? wechatAdapter.performance : Date;\\n this._timeScale = 1.0;\\n this._deltaTime = 0.0001;\\n\\n var now = this._clock.now();\\n\\n this._startTime = now;\\n this._lastTickTime = now;\\n }\",\n \"getStartTime() {\\n return this.startTime;\\n }\",\n \"function timecalc(hoursBack) {\\r\\n // Function to return current time for use to calculate the timeframe parameter for the parkingEvents query. \\r\\n // The function minus the number of hours back accuratly articulates to the api what \\r\\n // timeframe should be viewed.\\r\\n var date = new Date()\\r\\n return Date.UTC(date.getUTCFullYear(),date.getUTCMonth(), date.getUTCDate() , \\r\\n date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds())-(hoursBack*60*60*1000); \\r\\n }\",\n \"timerTick(e) {\\n console.log(\\\"This method should be overridden in child classes.\\\");\\n }\",\n \"constructor(schedule) {\\n\\n }\",\n \"function morning() {\\n // whole morning routine\\n}\",\n \"setTime(ts) {\\nreturn this.timeStamp = ts;\\n}\",\n \"constructor(engine) {\\n this.engine = engine;\\n }\",\n \"function getInitialTime() {\\n changeTime();\\n}\",\n \"constructor (){\\n\\t\\tsuper();\\n\\n\\t\\tthis.getTheTime = this.getTheTime.bind(this);\\n\\n\\t\\t/**\\n\\t\\t * Setup the time variable to update every second\\n\\t\\t */\\n\\t\\t\\n\\t\\tthis.state = {\\n\\t\\t\\ttime: null\\n\\t\\t}\\n\\n\\t\\tthis.getTheTime();\\n\\t}\",\n \"function OnTimeModule() {\\n\\t\\tthis.name = \\\"OnTime.Module\\\";\\n\\t}\",\n \"computeTime() {\\n let year;\\n const fields = this.fields;\\n if (this.isSet(YEAR)) {\\n year = fields[YEAR];\\n } else {\\n year = new Date().getFullYear();\\n }\\n let timeOfDay = 0;\\n if (this.isSet(HOUR_OF_DAY)) {\\n timeOfDay += fields[HOUR_OF_DAY];\\n }\\n timeOfDay *= 60;\\n timeOfDay += fields[MINUTE] || 0;\\n timeOfDay *= 60;\\n timeOfDay += fields[SECONDS] || 0;\\n timeOfDay *= 1000;\\n timeOfDay += fields[MILLISECONDS] || 0;\\n let fixedDate = 0;\\n fields[YEAR] = year;\\n fixedDate = fixedDate + this.getFixedDate();\\n // millis represents local wall-clock time in milliseconds.\\n let millis = (fixedDate - EPOCH_OFFSET) * ONE_DAY + timeOfDay;\\n millis -= this.timezoneOffset * ONE_MINUTE;\\n this.time = millis;\\n this.computeFields();\\n }\",\n \"get time() {\\n return this._time;\\n }\",\n \"function erlang(servers, time) {\\n return (servers * time)/3600;\\n}\",\n \"_specializedInitialisation()\\r\\n\\t{\\r\\n\\t\\tLogger.log(\\\"Specialisation for service AVTransport\\\", LogType.Info);\\r\\n\\t\\tvar relativeTime = this.getVariableByName(\\\"RelativeTimePosition\\\");\\r\\n\\t\\t//Implémentation pour OpenHome\\r\\n\\t\\tif (!relativeTime)\\r\\n\\t\\t\\trelativeTime = this.getVariableByName(\\\"A_ARG_TYPE_GetPositionInfo_RelTime\\\");\\r\\n\\t\\tvar transportState = this.getVariableByName(\\\"TransportState\\\");\\r\\n\\t\\t//Implémentation pour OpenHome\\r\\n\\t\\tif (!transportState)\\r\\n\\t\\t\\ttransportState = this.getVariableByName(\\\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\\\");\\r\\n\\r\\n\\t\\tif (transportState)\\r\\n\\t\\t{\\r\\n\\t\\t\\ttransportState.on('updated', (variable, newVal) =>\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tLogger.log(\\\"On transportStateUpdate : \\\" + newVal, LogType.DEBUG);\\r\\n\\t\\t\\t\\tvar actPosInfo = this.getActionByName(\\\"GetPositionInfo\\\");\\r\\n\\t\\t\\t\\tvar actMediaInfo = this.getActionByName(\\\"GetMediaInfo\\\");\\r\\n\\t\\t\\t\\t/*\\r\\n\\t\\t\\t\\t“STOPPED” R\\r\\n\\t\\t\\t\\t“PLAYING” R\\r\\n\\t\\t\\t\\t“TRANSITIONING” O\\r\\n\\t\\t\\t\\t”PAUSED_PLAYBACK” O\\r\\n\\t\\t\\t\\t“PAUSED_RECORDING” O\\r\\n\\t\\t\\t\\t“RECORDING” O\\r\\n\\t\\t\\t\\t“NO_MEDIA_PRESENT”\\r\\n\\t\\t\\t\\t */\\r\\n\\t\\t\\t\\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tif (this._intervalUpdateRelativeTime)\\r\\n\\t\\t\\t\\t\\t\\tclearInterval(this._intervalUpdateRelativeTime);\\r\\n\\t\\t\\t\\t\\tif (newVal == \\\"PLAYING\\\" || newVal == \\\"RECORDING\\\")\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{\\tInstanceID: 0\\t} );\\r\\n\\t\\t\\t\\t\\t\\t//Déclenche la maj toutes les 4 secondes\\r\\n\\t\\t\\t\\t\\t\\tthis._intervalUpdateRelativeTime = setInterval(() =>{\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t//Logger.log(\\\"On autoUpdate\\\", LogType.DEBUG);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{\\tInstanceID: 0\\t}\\t);\\r\\n\\t\\t\\t\\t\\t\\t\\t}, 4000);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t//else if (newVal == \\\"STOPPED\\\" || newVal == \\\"PAUSED_PLAYBACK\\\" || newVal == \\\"PAUSED_RECORDING\\\" || newVal == \\\"NO_MEDIA_PRESENT\\\")\\r\\n\\t\\t\\t\\t//{\\r\\n\\t\\t\\t\\t//\\r\\n\\t\\t\\t\\t//}\\r\\n\\t\\t\\t\\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\\r\\n\\t\\t\\t\\tif (newVal == \\\"TRANSITIONING\\\")\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tif (actPosInfo)\\r\\n\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{InstanceID: 0}\\t);\\r\\n\\t\\t\\t\\t\\tif (actMediaInfo)\\r\\n\\t\\t\\t\\t\\t\\tactMediaInfo.execute(\\t{InstanceID: 0} );\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif (newVal == \\\"STOPPED\\\")\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tif (actPosInfo)\\r\\n\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{\\tInstanceID: 0\\t});\\r\\n\\t\\t\\t\\t\\tif (actMediaInfo)\\r\\n\\t\\t\\t\\t\\t\\tactMediaInfo.execute(\\t{\\tInstanceID: 0 });\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\",\n \"constructor() {\\n\\n this.timedEntities = []; // Will hold list of entities being tracked\\n this.activeEntity = null; // This is the entity we are currently timing\\n this.intervalTimer = null; // Will hold reference after we start setInterval\\n this.chartTimer = null; // Will hold referenec to the setInterval for updating the charts\\n this.timingActive = false; // Are we currently running the timer?\\n this.totalTicksActive = 0; // seconds that the timer has been running\\n // Store the timestamp in ms of the last time a tick happened in case the\\n // app gets backgrounded and JS execution stops. Can then add in the right\\n // number of secconds after\\n this.lastTickTime = -1;\\n this.turnList = []; // Will hold a set of dictionaries defining each time the speaker changed.\\n this.minTurnLength = 10; // seconds; the time before a turn is shown on the timeline\\n\\n this.meetingName = \\\"\\\";\\n this.attributeNameGender = \\\"Gender\\\";\\n this.attributeNameSecondary = \\\"Secondary Attribute\\\";\\n this.attributeNameTertiary = \\\"Tertiary Attribute\\\";\\n }\",\n \"getPlayTime() {\\n return this.time;\\n }\",\n \"scheduler() {\\n this.maybeTickSongChart();\\n\\n // When nextNoteTime (in the future) is near (gap is determined by \\n // scheduleAheadTime), schedule audio & visuals and advance to the next\\n // note.\\n while (this.nextNoteTime <\\n (this.audioContext.currentTime + this.scheduleAheadTime)) {\\n this.scheduleNote(this.current16thNote, this.nextNoteTime);\\n this.nextNote();\\n }\\n }\",\n \"initCurrentTimeLine() {\\n const me = this,\\n now = new Date();\\n\\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\\n return;\\n }\\n\\n me.currentTimeLine = new me.store.modelClass({\\n // eslint-disable-next-line quote-props\\n 'id': 'currentTime',\\n cls: 'b-sch-current-time',\\n startDate: now,\\n name: DateHelper.format(now, me.currentDateFormat)\\n });\\n me.updateCurrentTimeLine = me.updateCurrentTimeLine.bind(me);\\n me.currentTimeInterval = me.setInterval(me.updateCurrentTimeLine, me.updateCurrentTimeLineInterval);\\n\\n if (me.client.isPainted) {\\n me.renderRanges();\\n }\\n }\",\n \"get time() {}\",\n \"now () {\\n return this.t;\\n }\",\n \"function yFindRealTimeClock(func)\\n{\\n return YRealTimeClock.FindRealTimeClock(func);\\n}\",\n \"setTime(time) {\\n this.time = time;\\n return this;\\n }\",\n \"function timerWrapper () {}\",\n \"get elapsedTime() {\\n return this._elapsedTime\\n }\",\n \"function updateTime(){\\n setTimeContent(\\\"timer\\\");\\n}\",\n \"function setTime(){\\n let dt = new Date();\\n currScene.timeInScene = dt.getTime();\\n}\",\n \"function timeUpdate() {\\n timeEngaged += delta();\\n}\",\n \"tickCaller(game){\\n game.tick();\\n }\",\n \"function localClock(){\\n digitalClock(0,\\\"clock\\\");\\n digitalClock(-7,\\\"clockNy\\\")\\n digitalClock(8,\\\"tokyo\\\") \\n}\",\n \"eventTimer() {throw new Error('Must declare the function')}\",\n \"function Schedule(options,element){return _super.call(this,options,element)||this;}\",\n \"time(time) {\\n if (time == null) {\\n return this._time;\\n }\\n\\n let dt = time - this._time;\\n this.step(dt);\\n return this;\\n }\",\n \"timer() {\\n this.sethandRotation('hour');\\n this.sethandRotation('minute');\\n this.sethandRotation('second');\\n }\",\n \"tick() {\\n\\t\\t// debug\\n\\t\\t// console.log(\\\"atomicGLClock::tick\\\");\\t\\n var timeNow = new Date().getTime();\\n\\n if (this.lastTime != 0)\\n \\tthis.elapsed = timeNow - this.lastTime;\\n\\n this.lastTime = timeNow;\\n }\",\n \"get time () {\\n\\t\\treturn this._time;\\n\\t}\",\n \"function time(){\\n\\t $('#Begtime').mobiscroll().time({\\n\\t theme: 'wp',\\n\\t display: 'inline',\\n\\t mode: 'scroller'\\n\\t });\\n\\t $('#Endtime').mobiscroll().time({\\n\\t theme: 'wp',\\n\\t display: 'inline',\\n\\t mode: 'scroller'\\n\\t });\\n\\t removeUnwanted(); \\n\\t insertClass(); \\n\\t getTimeFromInput(\\\"Begtime\\\");\\n\\t getTimeFromInput(\\\"Endtime\\\");\\n\\t}\",\n \"function Timer() {}\",\n \"init(...args) {\\n\\t\\tthis._super(...args);\\n\\n\\t\\tthis.setupTime();\\n\\t}\",\n \"_setTime() {\\n switch(this.difficultyLevel) {\\n case 1:\\n // this.gameTime uses ms\\n this.gameTime = 45000;\\n break;\\n case 2:\\n this.gameTime = 100000;\\n break;\\n case 3:\\n this.gameTime = 160000;\\n break;\\n case 4:\\n this.gameTime = 220000;\\n break;\\n default:\\n throw new Error('there is no time');\\n }\\n }\",\n \"function TimeManager() {\\n var self = this;\\n\\n this.init = function () {\\n self.initTime = (new Date()).getTime() / 1000;\\n self.offset = 0;\\n self.speed = 1;\\n self.query_params = self.get_query_param();\\n if (self.query_params.hasOwnProperty('time')) {\\n self.offset = parseInt(self.query_params.time);\\n }\\n else if (self.query_params.hasOwnProperty('from')) {\\n self.offset = parseInt(self.query_params.from);\\n }\\n if (self.offset) {\\n self.speed = 20;\\n }\\n\\n if (self.query_params.hasOwnProperty('speed')) {\\n self.speed = parseFloat(self.query_params.speed);\\n }\\n };\\n\\n this.getTime = function() {\\n var realTime = self.getRealTime();\\n if (self.offset) {\\n return self.offset + (realTime - self.initTime) * self.speed;\\n }\\n\\n return realTime;\\n };\\n\\n this.getRealTime = function () {\\n return (new Date()).getTime() / 1000;\\n };\\n\\n // Extracts query params from url.\\n this.get_query_param = function () {\\n var query_string = {};\\n var query = window.location.search.substring(1);\\n var pairs = query.split('&');\\n for (var i = 0; i < pairs.length; i++) {\\n var pair = pairs[i].split('=');\\n\\n // If first entry with this name.\\n if (typeof query_string[pair[0]] === 'undefined') {\\n query_string[pair[0]] = decodeURIComponent(pair[1]);\\n }\\n // If second entry with this name.\\n else if (typeof query_string[pair[0]] === 'string') {\\n query_string[pair[0]] = [\\n query_string[pair[0]],\\n decodeURIComponent(pair[1])\\n ];\\n }\\n // If third or later entry with this name\\n else {\\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\\n }\\n }\\n\\n return query_string;\\n };\\n\\n this.init();\\n\\n return this;\\n}\",\n \"update_() {\\n var current = this.tlc_.getCurrent();\\n this.scope_['time'] = current;\\n var t = new Date(current);\\n\\n var coord = this.coord_ || MapContainer.getInstance().getMap().getView().getCenter();\\n\\n if (coord) {\\n coord = olProj.toLonLat(coord, osMap.PROJECTION);\\n\\n this.scope_['coord'] = coord;\\n var sets = [];\\n\\n // sun times\\n var suntimes = SunCalc.getTimes(t, coord[1], coord[0]);\\n var sunpos = SunCalc.getPosition(t, coord[1], coord[0]);\\n\\n // Determine dawn/dusk based on user preference\\n var calcTitle;\\n var dawnTime;\\n var duskTime;\\n\\n switch (settings.getInstance().get(SettingKey.DUSK_MODE)) {\\n case 'nautical':\\n calcTitle = 'Nautical calculation';\\n dawnTime = suntimes.nauticalDawn.getTime();\\n duskTime = suntimes.nauticalDusk.getTime();\\n break;\\n case 'civilian':\\n calcTitle = 'Civilian calculation';\\n dawnTime = suntimes.dawn.getTime();\\n duskTime = suntimes.dusk.getTime();\\n break;\\n case 'astronomical':\\n default:\\n calcTitle = 'Astronomical calculation';\\n dawnTime = suntimes.nightEnd.getTime();\\n duskTime = suntimes.night.getTime();\\n break;\\n }\\n\\n var times = [{\\n 'label': 'Dawn',\\n 'time': dawnTime,\\n 'title': calcTitle,\\n 'color': '#87CEFA'\\n }, {\\n 'label': 'Sunrise',\\n 'time': suntimes.sunrise.getTime(),\\n 'color': '#FFA500'\\n }, {\\n 'label': 'Solar Noon',\\n 'time': suntimes.solarNoon.getTime(),\\n 'color': '#FFD700'\\n }, {\\n 'label': 'Sunset',\\n 'time': suntimes.sunset.getTime(),\\n 'color': '#FFA500'\\n }, {\\n 'label': 'Dusk',\\n 'time': duskTime,\\n 'title': calcTitle,\\n 'color': '#87CEFA'\\n }, {\\n 'label': 'Night',\\n 'time': suntimes.night.getTime(),\\n 'color': '#000080'\\n }];\\n\\n this.scope_['sun'] = {\\n 'altitude': sunpos.altitude * geo.R2D,\\n 'azimuth': (geo.R2D * (sunpos.azimuth + Math.PI)) % 360\\n };\\n\\n // moon times\\n var moontimes = SunCalc.getMoonTimes(t, coord[1], coord[0]);\\n var moonpos = SunCalc.getMoonPosition(t, coord[1], coord[0]);\\n var moonlight = SunCalc.getMoonIllumination(t);\\n\\n this.scope_['moonAlwaysDown'] = moontimes.alwaysDown;\\n this.scope_['moonAlwaysUp'] = moontimes.alwaysUp;\\n\\n if (moontimes.rise) {\\n times.push({\\n 'label': 'Moonrise',\\n 'time': moontimes.rise.getTime(),\\n 'color': '#ddd'\\n });\\n }\\n\\n if (moontimes.set) {\\n times.push({\\n 'label': 'Moonset',\\n 'time': moontimes.set.getTime(),\\n 'color': '#2F4F4F'\\n });\\n }\\n\\n var phase = '';\\n for (var i = 0, n = PHASES.length; i < n; i++) {\\n if (moonlight.phase >= PHASES[i].min && moonlight.phase < PHASES[i].max) {\\n phase = PHASES[i].label;\\n break;\\n }\\n }\\n\\n this.scope_['moon'] = {\\n 'alwaysUp': moontimes.alwaysUp,\\n 'alwaysDown': moontimes.alwaysDown,\\n 'azimuth': (geo.R2D * (moonpos.azimuth + Math.PI)) % 360,\\n 'altitude': moonpos.altitude * geo.R2D,\\n 'brightness': Math.ceil(moonlight.fraction * 100) + '%',\\n 'phase': phase\\n };\\n\\n times = times.filter(filter);\\n times.forEach(addTextColor);\\n googArray.sortObjectsByKey(times, 'time');\\n sets.push(times);\\n\\n this.scope_['times'] = times;\\n ui.apply(this.scope_);\\n }\\n }\",\n \"function playInst(inst, startTime, stopTime){\\n\\n var inst = inst;\\n var startTime = startTime;\\n var stopTime = stopTime;\\n\\n inst.startAtTime(globalNow+startTime);\\n inst.stopAtTime(globalNow+stopTime);\\n\\n}\",\n \"constructor() {\\r\\n super();\\r\\n /**\\r\\n * Previous measurement time\\r\\n * @private\\r\\n * @type {number}\\r\\n */\\r\\n this.oldTime_;\\r\\n }\",\n \"getGameTime() {\\n return this.time / 1200;\\n }\",\n \"onChange(e) {\\n if (this.props.onChange) {\\n this.props.onChange(e);\\n }\\n window.$('#' + this.id).timepicker('setTime', e.target.value);\\n }\",\n \"update(scene, time, delta) {\\n // Tick the time (setting the milliseconds will automatically convert up into seconds/minutes/hours)\\n this.time.setMilliseconds(this.time.getMilliseconds() + (delta * this.speed * CONSTANTS.SIMULATION_SPEED_FACTOR));\\n\\n // Update the sky's ambient color\\n this.updateAmbientLightColor();\\n\\n // Check if we can emit an event to the event emitter to notify about the time of day\\n // Only emits once, thats why we have the flags\\n if (this.time.getHours() == 8 && !this.calledMorning) {\\n this.events.emit(\\\"morning\\\");\\n\\n this.calledMorning = true;\\n this.calledNoon = false;\\n this.calledEvening = false;\\n this.calledNight = false;\\n } else if (this.time.getHours() == 12 && !this.calledNoon) {\\n this.events.emit(\\\"noon\\\");\\n\\n this.calledMorning = false;\\n this.calledNoon = true;\\n this.calledEvening = false;\\n this.calledNight = false; \\n } else if (this.time.getHours() == 18 && !this.calledEvening) {\\n this.events.emit(\\\"evening\\\");\\n\\n this.calledMorning = false;\\n this.calledNoon = false;\\n this.calledEvening = true;\\n this.calledNight = false; \\n } else if (this.time.getHours() == 21 && !this.calledNight) {\\n this.events.emit(\\\"night\\\");\\n\\n this.calledMorning = false;\\n this.calledNoon = false;\\n this.calledEvening = false;\\n this.calledNight = true; \\n }\\n }\",\n \"function interval(){\\r\\n\\ttry{\\r\\n\\t\\tthis.startTime = function (){\\t\\r\\n\\t\\t\\ttry{\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tvar today=new Date();\\r\\n\\t\\t\\t\\t\\tvar h=today.getHours();\\r\\n\\t\\t\\t\\t\\tvar m=today.getMinutes();\\r\\n\\t\\t\\t\\t\\tvar startm = today.getMinutes();\\r\\n var s=today.getSeconds();\\r\\n\\t\\t\\t\\t\\t// add a zero in front of numbers<10\\r\\n\\t\\t\\t\\t\\tm=this.checkTime(m);\\r\\n\\t\\t\\t\\t\\ts=this.checkTime(s);\\r\\n\\r\\n $('txt').innerHTML= h+\\\":\\\"+m+\\\":\\\"+s;\\r\\n\\t\\t\\t\\t\\t$('clock').value = m;\\t\\t\\r\\n\\t\\t\\t\\t\\tt=setTimeout('intervalObj.startTime()',500);\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.startTime()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t// add a zero in front of numbers<10\\r\\n\\t\\tthis.checkTime = function(i){\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tif (i<10){\\r\\n\\t\\t\\t\\t\\ti=\\\"0\\\" + i;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\treturn i;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.checkTime()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\r\\n\\t\\t//End of clock function\\r\\n\\t\\t//To start the clock on web page.\\r\\n\\t\\t\\r\\n\\t\\tthis.call = function(){\\r\\n\\t\\t\\ttry{\\r\\n\\r\\n\\t\\t\\t\\t$('text').value=$('txt').innerHTML;\\r\\n\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.call()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t//To stop the clock.\\r\\n\\t\\tthis.stopTime = function(){\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\t$('txtTime').value=$('txt').innerHTML;\\r\\n document.getElementById(\\\"txt\\\").style.display = 'none';\\r\\n\\r\\n }catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.stopTime()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t//To calculate the total time difference.\\r\\n\\t\\tthis.calculateTotalTime = function() {\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tvar t1=$('text').value;\\r\\n\\t\\t\\t\\tvar t2=$('txtTime').value;\\r\\n\\t\\t\\t\\tvar arrt1 = t1.split(\\\":\\\");\\r\\n\\t\\t\\t\\tvar arrt2 = t2.split(\\\":\\\");\\t\\t\\r\\n\\t\\t\\t\\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\\r\\n\\t\\t\\t\\tvar timeDifference=this.convertTime(sub);\\t\\t\\r\\n\\t\\t\\treturn timeDifference;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\r\\n this.calculatebatsmanTime = function(t1,t2) {\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tvar arrt1 = t1.split(\\\":\\\");\\r\\n\\t\\t\\t\\tvar arrt2 = t2.split(\\\":\\\");\\r\\n\\t\\t\\t\\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\\r\\n\\t\\t\\t\\tvar timeDifference=this.convertTime(sub);\\r\\n\\t\\t\\treturn timeDifference;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n //To Convert time.\\r\\n\\t\\tthis.convertTime = function(sub){\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tvar hrs=parseInt(sub/3600);\\t\\t\\r\\n\\t\\t\\t\\tvar rem=(sub%3600);\\r\\n\\t\\t\\t\\tvar min=parseInt(rem/60);\\r\\n\\t\\t\\t\\tvar sec=(rem%60);\\r\\n\\t\\t\\t\\tmin=this.checkTime(min);\\r\\n\\t\\t\\t\\tsec=this.checkTime(sec);\\r\\n\\t\\t\\t\\tvar convertDifference=(hrs+\\\":\\\"+min+\\\":\\\"+sec);\\r\\n\\t\\t\\treturn convertDifference;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.convertTime()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\t\\t\\r\\n\\t\\t//To display the time period of interruptions and intervals.\\r\\n\\t\\t\\r\\n\\t\\tthis.DisplayInterval=function(flag){\\r\\n\\t\\r\\n\\t\\t\\tvar MATCH_TIME_ACC=42000;//700min.\\r\\n\\t\\t\\tvar MATCH_INNING_ACC=21000;//350min.\\r\\n\\t\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tif($('text').value==\\\"\\\" && $('txtTime').value==\\\"\\\"){\\r\\n\\t\\t\\t\\t\\talert(\\\"You Did Not Start Timer\\\");\\r\\n\\t\\t\\t\\t}else if(flag==1){\\t\\t\\r\\n\\t\\t\\t\\t\\talert(\\\"Interruption Time is:: \\\"+this.calculateTotalTime());\\r\\n\\t\\t\\t\\t}else if(flag==2){\\t\\r\\n\\t\\t\\t\\t\\t//Interval-Injury\\r\\n\\t\\t\\t\\t\\tvar time=this.calculateTotalTime();\\r\\n\\t\\t\\t\\t\\tvar arrtime = time.split(\\\":\\\");\\r\\n\\t\\t\\t\\t\\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\\r\\n\\t\\t\\t\\t\\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\\r\\n\\t\\t\\t\\t\\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t}else if(flag==3){\\r\\n\\t\\t\\t\\t\\t\\t//Interval-Drink\\r\\n\\t\\t\\t\\t\\t\\tvar time=this.calculateTotalTime();\\r\\n\\t\\t\\t\\t\\t\\tvar arrtime = time.split(\\\":\\\");\\r\\n\\t\\t\\t\\t\\t\\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\\r\\n\\t\\t\\t\\t\\t\\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\\r\\n\\t\\t\\t\\t\\t\\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\\r\\n\\t\\t\\t\\t\\t\\tMATCH_INNING_ACC=MATCH_INNING_ACC+sec;//Adding minits in match_inning Account\\r\\n\\t\\t\\t\\t\\t\\tvar inningTime=this.convertTime(MATCH_INNING_ACC);\\r\\n\\t\\t\\t\\t}else if(flag==4){\\r\\n\\t\\t\\t\\t\\t\\t//Interval-Lunch/Tea.\\r\\n\\t\\t\\t\\t\\t\\tthis.calculateTotalTime();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.DisplayInterval()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\t\\r\\n\\t\\t\\r\\n\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval()');\\r\\n\\t}\\t\\t\\r\\n}\",\n \"function newRE(name) {\\n\\n // Object holding defaults for various saved fields.\\n var virginData = {\\n type: \\\"pk_rhythm_engine\\\",\\n version: 1,\\n morpher: {x: 36, y: 36},\\n kits: [],\\n voices: [],\\n presets: [],\\n clock: {struc: \\\"simple\\\", sig: 0, bar: 0, beat: 0, pos: 0, tempo_bpm: 90, cycleLength: 16, running: false}\\n };\\n\\n // data will be saved and loaded to localStorage.\\n var data = copy_object(virginData);\\n\\n var clockLastTime_secs = undefined;\\n var lastTickTime_secs = 0;\\n var kDelay_secs = 0.05;\\n var clockJSN = undefined;\\n\\n // Load info about existing kits into the engine.\\n function initData() {\\n var k, ki;\\n for (k in availableKitInfos) {\\n ki = availableKitInfos[k];\\n data.kits.push({\\n name: ki.name,\\n url: ki.url\\n });\\n }\\n }\\n\\n initData();\\n\\n var kitNames = [];\\n\\n // Status of whether the clockTick() should do morphing calculations.\\n var morphEnabled = 0;\\n var morphNeedsUpdate = false;\\n\\n // Clock callbacks.\\n var onGridTick = undefined;\\n var onMorphUpdate = undefined;\\n\\n // Runs at about 60 ticks per second (linked to screen refresh rate).\\n function clockTick() {\\n var clock = data.clock;\\n\\n // Check whether the engine is running.\\n if (!clock.running) {\\n clockLastTime_secs = undefined;\\n return;\\n }\\n\\n var delta_secs = 0, dbeat, dbar;\\n\\n while (true) {\\n if (clockLastTime_secs) {\\n var now_secs = theAudioContext.currentTime;\\n var sqpb = kTimeStruc[clock.struc].semiQuaversPerBar;\\n var ticks_per_sec = clock.tempo_bpm * sqpb / 60;\\n var nextTickTime_secs = lastTickTime_secs + 1 / ticks_per_sec;\\n if (now_secs + kDelay_secs >= nextTickTime_secs) {\\n dbeat = Math.floor(((clock.pos % sqpb) + 1) / sqpb);\\n dbar = Math.floor((clock.beat + dbeat) / kTimeSig.D[clock.sig]);\\n clock.bar = (clock.bar + dbar) % kTimeStruc[clock.struc].cycleLength;\\n clock.beat = (clock.beat + dbeat) % kTimeSig.N[clock.sig];\\n clock.pos = clock.pos + 1;\\n lastTickTime_secs = nextTickTime_secs;\\n } else {\\n return;\\n }\\n } else {\\n // Very first call.\\n clockLastTime_secs = theAudioContext.currentTime;\\n clock.bar = 0;\\n clock.beat = 0;\\n clock.pos = 0;\\n lastTickTime_secs = clockLastTime_secs + kDelay_secs;\\n }\\n\\n // If we're doing a morph, set all the relevant control values.\\n updateMorph();\\n\\n // Perform all the voices for all the active presets.\\n var i, N, v;\\n for (i = 0, N = data.voices.length; i < N; ++i) {\\n v = data.voices[i];\\n if (v) {\\n genBeat(v, clock, lastTickTime_secs);\\n }\\n }\\n\\n // Do the callback if specified.\\n if (onGridTick) {\\n onGridTick(clock);\\n }\\n }\\n }\\n\\n var kVoiceControlsToMorph = [\\n 'straight', 'offbeat', 'funk', 'phase', 'random', \\n 'ramp', 'threshold', 'mean', 'cycleWeight', 'volume', 'pan'\\n ];\\n\\n // Utility to calculate a weighted sum.\\n // \\n // weights is an array of weights. Entries can include 'undefined',\\n // in which case they'll not be included in the weighted sum.\\n //\\n // value_getter is function (i) -> value\\n // result_transform(value) is applied to the weighted sum before \\n // returning the result value.\\n function morphedValue(weights, value_getter, result_transform) {\\n var result = 0, wsum = 0;\\n var i, N, val;\\n for (i = 0, N = weights.length; i < N; ++i) {\\n if (weights[i] !== undefined) {\\n val = value_getter(i);\\n if (val !== undefined) {\\n result += weights[i] * val;\\n wsum += weights[i];\\n }\\n }\\n }\\n return result_transform ? result_transform(result / wsum) : result / wsum;\\n }\\n\\n // Something about the morph status changed.\\n // Update the parameters of all the voices to reflect\\n // the change.\\n function updateMorph() {\\n var i, N;\\n if (morphEnabled && morphNeedsUpdate && data.presets.length > 1) {\\n\\n // Compute morph distances for each preset.\\n var morphWeights = [], dx, dy, ps;\\n for (i = 0, N = data.presets.length; i < N; ++i) {\\n ps = data.presets[i];\\n if (ps && ps.useInMorph) {\\n dx = data.morpher.x - data.presets[i].pos.x;\\n dy = data.morpher.y - data.presets[i].pos.y;\\n morphWeights[i] = 1 / (1 + Math.sqrt(dx * dx + dy * dy));\\n }\\n }\\n\\n // For each voice, compute the morph.\\n var wsum = 0, wnorm = 1, p, pN, w, c, cN, v;\\n\\n // Normalize the morph weights.\\n wsum = morphedValue(morphWeights, function (p) { return 1; });\\n wnorm = 1 / wsum; // WARNING: Divide by zero?\\n\\n // For each voice and for each control in each voice, do the morph.\\n for (i = 0, N = data.voices.length; i < N; ++i) {\\n for (c = 0, cN = kVoiceControlsToMorph.length, v = data.voices[i]; c < cN; ++c) {\\n v[kVoiceControlsToMorph[c]] = morphedValue(morphWeights, function (p) { \\n var ps = data.presets[p];\\n return i < ps.voices.length ? ps.voices[i][kVoiceControlsToMorph[c]] : undefined;\\n });\\n }\\n }\\n\\n // Now morph the tempo. We morph the tempo in the log domain.\\n data.clock.tempo_bpm = morphedValue(morphWeights, function (p) { return Math.log(data.presets[p].clock.tempo_bpm); }, Math.exp);\\n\\n // Morph the cycle length.\\n data.clock.cycleLength = Math.round(morphedValue(morphWeights, function (p) { return data.presets[p].clock.cycleLength; }));\\n \\n if (onMorphUpdate) {\\n setTimeout(onMorphUpdate, 0);\\n }\\n\\n morphNeedsUpdate = false;\\n --morphEnabled;\\n }\\n }\\n\\n // We store info about all the presets as a JSON string in\\n // a single key in localStorage.\\n var storageKey = 'com.nishabdam.PeteKellock.RhythmEngine.' + name + '.data';\\n\\n // Loads the previous engine state saved in localStorage.\\n function load(delegate) {\\n var dataStr = window.localStorage[storageKey];\\n if (dataStr) {\\n loadFromStr(dataStr, delegate);\\n } else {\\n alert(\\\"RhythmEngine: load error\\\");\\n }\\n }\\n\\n // Loads an engine state saved as a string from, possibly, an \\n // external source.\\n function loadFromStr(dataStr, delegate) {\\n try {\\n data = JSON.parse(dataStr);\\n } catch (e) {\\n setTimeout(function () {\\n delegate.onError(\\\"Corrupt rhythm engine snapshot file.\\\");\\n }, 0);\\n return;\\n }\\n\\n var work = {done: 0, total: 0};\\n\\n function reportProgress(changeInDone, changeInTotal, desc) {\\n work.done += changeInDone;\\n work.total += changeInTotal;\\n if (delegate.progress) {\\n delegate.progress(work.done, work.total, desc);\\n }\\n }\\n\\n reportProgress(0, data.kits.length * 10);\\n\\n kitNames = [];\\n\\n data.kits.forEach(function (kitInfo) {\\n SampleManager.loadSampleSet(kitInfo.name, kitInfo.url, {\\n didFetchMappings: function (name, mappings) {\\n reportProgress(0, getKeys(mappings).length * 2);\\n },\\n didLoadSample: function (name, key) {\\n reportProgress(1, 0);\\n },\\n didDecodeSample: function () {\\n reportProgress(1, 0);\\n },\\n didFinishLoadingSampleSet: function (name, sset) {\\n kitNames.push(name);\\n\\n // Save the drum names.\\n kitInfo.drums = getKeys(sset);\\n\\n reportProgress(10, 0);\\n\\n if (kitNames.length === data.kits.length) {\\n // We're done.\\n delegate.didLoad();\\n clockTick();\\n }\\n }\\n });\\n });\\n }\\n\\n // This is for loading the JSON string if the user \\n // gives it by choosing an external file.\\n function loadExternal(fileData, delegate, dontSave) {\\n if (checkSnapshotFileData(fileData, delegate)) {\\n loadFromStr(fileData, {\\n progress: delegate.progress,\\n didLoad: function () {\\n if (!dontSave) {\\n save();\\n }\\n delegate.didLoad();\\n }\\n });\\n }\\n }\\n\\n // A simple check for the starting part of a snapshot file.\\n // This relies on the fact that browser javascript engines\\n // enumerate an object's keys in the same order in which they\\n // were inserted into the object.\\n function checkSnapshotFileData(fileData, delegate) {\\n var valid = (fileData.indexOf('{\\\"type\\\":\\\"pk_rhythm_engine\\\"') === 0);\\n if (!valid) {\\n setTimeout(function () {\\n delegate.onError(\\\"This is not a rhythm engine snapshot file.\\\");\\n }, 0);\\n }\\n return valid;\\n }\\n\\n // Loads settings from file with given name, located in\\n // the \\\"settings\\\" folder.\\n function loadFile(filename, delegate) {\\n if (filename && typeof(filename) === 'string') {\\n fs.root.getDirectory(\\\"settings\\\", {create: true},\\n function (settingsDir) {\\n settingsDir.getFile(filename, {create: false},\\n function (fileEntry) {\\n fileEntry.file(\\n function (f) {\\n var reader = new global.FileReader();\\n\\n reader.onloadend = function () {\\n loadExternal(reader.result, delegate, true);\\n };\\n reader.onerror = delegate && delegate.onError;\\n\\n reader.readAsText(f);\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n } else {\\n load(delegate);\\n }\\n }\\n\\n // Makes an array of strings giving the names of saved\\n // settings and calls delegate.didListSettings(array)\\n // upon success. delegate.onError is called if there is\\n // some error.\\n function listSavedSettings(delegate) {\\n fs.root.getDirectory(\\\"settings\\\", {create: true},\\n function (settingsDir) {\\n var reader = settingsDir.createReader();\\n var result = [];\\n\\n function readEntries() {\\n reader.readEntries(\\n function (entries) {\\n var i, N;\\n\\n if (entries.length === 0) {\\n // We're done.\\n delegate.didListSettings(result.sort());\\n } else {\\n // More to go. Accumulate the names.\\n for (i = 0, N = entries.length; i < N; ++i) {\\n result.push(entries[i].name);\\n }\\n\\n // Continue listing the directory.\\n readEntries();\\n }\\n },\\n delegate && delegate.onError\\n );\\n }\\n\\n readEntries();\\n },\\n delegate && delegate.onError\\n );\\n }\\n\\n // Saves all the presets in local storage.\\n function save(filename, delegate) {\\n var dataAsJSON = JSON.stringify(data);\\n\\n // First save a copy in the locaStorage for worst case scenario.\\n window.localStorage[storageKey] = dataAsJSON;\\n\\n if (filename && typeof(filename) === 'string') {\\n fs.root.getDirectory(\\\"settings\\\", {create: true},\\n function (settingsDir) {\\n settingsDir.getFile(filename, {create: true},\\n function (f) {\\n f.createWriter(\\n function (writer) {\\n writer.onwriteend = delegate && delegate.didSave;\\n writer.onerror = delegate && delegate.onError;\\n\\n var bb = new global.BlobBuilder();\\n bb.append(dataAsJSON);\\n writer.write(bb.getBlob());\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n }\\n }\\n\\n // Make a \\\"voice\\\" object exposing all the live-tweakable\\n // parameters. The API user can just set these parameters\\n // to hear immediate effect in the RE's output.\\n function make_voice(kit, drum) {\\n return {\\n voice: {kit: kit, drum: drum},\\n straight: 0.5,\\n offbeat: 0.0,\\n funk: 0.0,\\n phase: 0,\\n random: 0.0,\\n ramp: 0.2,\\n threshold: 0.5,\\n mean: 0.5,\\n cycleWeight: 0.2,\\n volume: 1.0,\\n pan: 0.0\\n };\\n }\\n\\n function validatePresetIndex(p, extra) {\\n if (p < 0 || p >= data.presets.length + (extra ? extra : 0)) {\\n throw new Error('Invalid preset index!');\\n }\\n }\\n\\n return {\\n kits: data.kits, // Read-only.\\n save: save,\\n snapshot: function () { return JSON.stringify(data); },\\n load: loadFile,\\n list: listSavedSettings,\\n import: loadExternal,\\n\\n // You can set a callback to be received on every grid tick so\\n // that you can do something visual about it. The callback will\\n // receive the current clock status as the sole argument.\\n // The callback is expected to not modify the clock.\\n get onGridTick() { return onGridTick; },\\n set onGridTick(newCallback) { onGridTick = newCallback; },\\n\\n // You can set a callback for notification whenever the bulk\\n // of sliders have been changed due to a morph update.\\n get onMorphUpdate() { return onMorphUpdate; },\\n set onMorphUpdate(newCallback) { onMorphUpdate = newCallback; },\\n\\n // Change the tempo by assigning to tempo_bpm field.\\n get tempo_bpm() {\\n return data.clock.tempo_bpm;\\n },\\n set tempo_bpm(new_tempo_bpm) {\\n data.clock.tempo_bpm = Math.min(Math.max(10, new_tempo_bpm), 480);\\n },\\n\\n // Info about the voices and facility to add more.\\n numVoices: function () { return data.voices.length; },\\n voice: function (i) { return data.voices[i]; },\\n addVoice: function (kit, drum) {\\n var voice = make_voice(kit || 'acoustic-kit', drum || 'kick');\\n data.voices.push(voice);\\n return voice;\\n },\\n\\n // Info about presets and the ability to add/save to presets.\\n numPresets: function () { return data.presets.length; },\\n preset: function (p) { return data.presets[p]; },\\n saveAsPreset: function (p) {\\n validatePresetIndex(p, 1);\\n\\n p = Math.min(data.presets.length, p);\\n\\n // Either make a new preset or change a saved one.\\n // We preserve a preset's morph weight if we're\\n // changing one to a new snapshot.\\n var old = (p < data.presets.length ? data.presets[p] : {pos: {x: 0, y: 0}});\\n data.presets[p] = {\\n useInMorph: old.useInMorph,\\n pos: copy_object(old.pos),\\n clock: copy_object(data.clock),\\n voices: copy_object(data.voices)\\n };\\n },\\n\\n\\n // Morphing functions. The initial state of the morpher is \\\"disabled\\\",\\n // so as long as that is the case, none of the 2D position functions\\n // have any effect. You first need to enable the morpher before\\n // the other calls have any effect.\\n enableMorph: function (flag) {\\n morphEnabled += flag ? 1 : 0;\\n if (flag) {\\n morphNeedsUpdate = true;\\n }\\n },\\n presetPos: function (p) { return data.presets[p].pos; },\\n changePresetPos: function (p, x, y) {\\n validatePresetIndex(p);\\n var pos = data.presets[p].pos;\\n pos.x = x;\\n pos.y = y;\\n morphNeedsUpdate = true;\\n },\\n morpherPos: function () { return data.morpher; },\\n changeMorpherPos: function (x, y) {\\n data.morpher.x = x;\\n data.morpher.y = y;\\n morphNeedsUpdate = true;\\n },\\n\\n // Starting and stopping the engine. Both methods are\\n // idempotent.\\n get running() { return data.clock.running; },\\n start: function () {\\n if (!data.clock.running) {\\n data.clock.running = true;\\n clockLastTime_secs = undefined;\\n clockJSN = theAudioContext.createJavaScriptNode(512, 0, 1);\\n clockJSN.onaudioprocess = function (event) {\\n clockTick();\\n };\\n clockJSN.connect(theAudioContext.destination);\\n }\\n },\\n stop: function () {\\n data.clock.running = false;\\n if (clockJSN) {\\n clockJSN.disconnect();\\n clockJSN = undefined;\\n }\\n }\\n };\\n }\",\n \"function tick() {\\n\\n\\n\\n}\",\n \"set_time( t ){ this.current_time = t; this.draw_fg(); return this; }\"\n]"},"negative_scores":{"kind":"list like","value":["0.60922885","0.5949018","0.5756867","0.57554275","0.57554275","0.57131803","0.56148666","0.55186754","0.5505017","0.5497742","0.5468396","0.5467718","0.54543716","0.54002976","0.5386592","0.53503424","0.5311419","0.5294002","0.52667093","0.52347416","0.52346486","0.52319324","0.52224326","0.5218331","0.52155006","0.52090085","0.52009827","0.518131","0.5158937","0.5155084","0.51521915","0.5150471","0.5145293","0.51423","0.5131727","0.51138747","0.51013","0.50987947","0.50969833","0.5088159","0.5088159","0.5073959","0.5072545","0.5072029","0.5069908","0.5065038","0.50513786","0.5046419","0.50382197","0.5037763","0.5023638","0.50190544","0.50105804","0.5004575","0.5001762","0.49851534","0.4979641","0.49763665","0.4975456","0.49714097","0.4965082","0.49637097","0.49571905","0.49566728","0.49532384","0.4935089","0.49201417","0.49167356","0.4915479","0.4911556","0.4906906","0.4891314","0.48878008","0.48868215","0.4885634","0.48840037","0.48780647","0.48744377","0.48667896","0.486577","0.48640993","0.4862349","0.48617733","0.485853","0.4852473","0.48504347","0.4843918","0.4842883","0.4842342","0.48332587","0.48298734","0.48298386","0.48223764","0.481757","0.4812695","0.4811885","0.48088992","0.48063743","0.4806254","0.4799488","0.47986594"],"string":"[\n \"0.60922885\",\n \"0.5949018\",\n \"0.5756867\",\n \"0.57554275\",\n \"0.57554275\",\n \"0.57131803\",\n \"0.56148666\",\n \"0.55186754\",\n \"0.5505017\",\n \"0.5497742\",\n \"0.5468396\",\n \"0.5467718\",\n \"0.54543716\",\n \"0.54002976\",\n \"0.5386592\",\n \"0.53503424\",\n \"0.5311419\",\n \"0.5294002\",\n \"0.52667093\",\n \"0.52347416\",\n \"0.52346486\",\n \"0.52319324\",\n \"0.52224326\",\n \"0.5218331\",\n \"0.52155006\",\n \"0.52090085\",\n \"0.52009827\",\n \"0.518131\",\n \"0.5158937\",\n \"0.5155084\",\n \"0.51521915\",\n \"0.5150471\",\n \"0.5145293\",\n \"0.51423\",\n \"0.5131727\",\n \"0.51138747\",\n \"0.51013\",\n \"0.50987947\",\n \"0.50969833\",\n \"0.5088159\",\n \"0.5088159\",\n \"0.5073959\",\n \"0.5072545\",\n \"0.5072029\",\n \"0.5069908\",\n \"0.5065038\",\n \"0.50513786\",\n \"0.5046419\",\n \"0.50382197\",\n \"0.5037763\",\n \"0.5023638\",\n \"0.50190544\",\n \"0.50105804\",\n \"0.5004575\",\n \"0.5001762\",\n \"0.49851534\",\n \"0.4979641\",\n \"0.49763665\",\n \"0.4975456\",\n \"0.49714097\",\n \"0.4965082\",\n \"0.49637097\",\n \"0.49571905\",\n \"0.49566728\",\n \"0.49532384\",\n \"0.4935089\",\n \"0.49201417\",\n \"0.49167356\",\n \"0.4915479\",\n \"0.4911556\",\n \"0.4906906\",\n \"0.4891314\",\n \"0.48878008\",\n \"0.48868215\",\n \"0.4885634\",\n \"0.48840037\",\n \"0.48780647\",\n \"0.48744377\",\n \"0.48667896\",\n \"0.486577\",\n \"0.48640993\",\n \"0.4862349\",\n \"0.48617733\",\n \"0.485853\",\n \"0.4852473\",\n \"0.48504347\",\n \"0.4843918\",\n \"0.4842883\",\n \"0.4842342\",\n \"0.48332587\",\n \"0.48298734\",\n \"0.48298386\",\n \"0.48223764\",\n \"0.481757\",\n \"0.4812695\",\n \"0.4811885\",\n \"0.48088992\",\n \"0.48063743\",\n \"0.4806254\",\n \"0.4799488\",\n \"0.47986594\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":26,"cells":{"query":{"kind":"string","value":"TimeEngine method (transported interface)"},"document":{"kind":"string","value":"advancePosition(time, position, speed) {\n this.trigger(time);\n\n if (speed < 0)\n return position - this.__period;\n\n return position + this.__period;\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 tickCurrentTimeEngine() {\n\n var d = new Date();\n\n currentHours = d.getHours();\n currentMinutes = d.getMinutes();\n currentSeconds = d.getSeconds();\n\n if (currentHours.toString().length == 1) {\n choursDigit_1 = 0;\n choursDigit_2 = currentHours;\n }\n else {\n choursDigit_1 = parseInt(currentHours.toString().charAt(0), 10);\n choursDigit_2 = parseInt(currentHours.toString().charAt(1), 10);\n }\n\n if (currentMinutes.toString().length == 1) {\n cminutesDigit_1 = 0;\n cminutesDigit_2 = currentMinutes;\n }\n else {\n cminutesDigit_1 = parseInt(currentMinutes.toString().charAt(0), 10);\n cminutesDigit_2 = parseInt(currentMinutes.toString().charAt(1), 10);\n }\n\n if (currentSeconds.toString().length == 1) {\n csecondsDigit_1 = 0;\n csecondsDigit_2 = currentSeconds;\n }\n else {\n csecondsDigit_1 = parseInt(currentSeconds.toString().charAt(0), 10);\n csecondsDigit_2 = parseInt(currentSeconds.toString().charAt(1), 10);\n }\n\n tickCurrentTime = setTimeout(tickCurrentTimeEngine, timerCurrentTimeMiliSecs);\n\n return;\n }","function Time() {}","get time () { throw \"Game system not supported\"; }","_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }","_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }","function TimeUtils() {}","getTime(){return this.time;}","function Engine() {\n }","onTimeChanged () {\n this.view.renderTimeAndDate();\n }","function tickTime() {\n // the magic object with all the time data\n // the present passing current moment\n let pc = {\n thisMoment: {},\n current: {},\n msInA: {},\n utt: {},\n passage: {},\n display: {}\n };\n\n // get the current time\n pc.thisMoment = {};\n pc.thisMoment = new Date();\n\n // slice current time into units\n pc.current = {\n ms: pc.thisMoment.getMilliseconds(),\n second: pc.thisMoment.getSeconds(),\n minute: pc.thisMoment.getMinutes(),\n hour: pc.thisMoment.getHours(),\n day: pc.thisMoment.getDay(),\n date: pc.thisMoment.getDate(),\n week: weekOfYear(pc.thisMoment),\n month: pc.thisMoment.getMonth(),\n year: pc.thisMoment.getFullYear()\n };\n\n // TODO: display day of week and month name\n let dayOfWeek = DAYS[pc.current.day];\n let monthName = MONTHS[pc.current.month];\n\n // returns the week no. out of the year\n function weekOfYear(d) {\n d.setHours(0, 0, 0);\n d.setDate(d.getDate() + 4 - (d.getDay() || 7));\n return Math.ceil(((d - new Date(d.getFullYear(), 0, 1)) / 8.64e7 + 1) / 7);\n }\n\n // set the slice conversions based on pc.thisMoment\n pc.msInA.ms = 1;\n pc.msInA.second = 1000;\n pc.msInA.minute = pc.msInA.second * 60;\n pc.msInA.hour = pc.msInA.minute * 60;\n pc.msInA.day = pc.msInA.hour * 24;\n pc.msInA.week = pc.msInA.day * 7;\n pc.msInA.month = pc.msInA.day * MONTH_DAYS[pc.current.month - 1];\n pc.msInA.year = pc.msInA.day * daysThisYear(pc.current.year);\n\n // handle leap years\n function daysThisYear(year) {\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n MONTH_DAYS[1] = 29;\n return 366;\n } else {\n return 365;\n }\n }\n\n // utt means UpToThis\n // calculates the count in ms of each unit that has passed\n pc.utt.ms = pc.current.ms;\n pc.utt.second = pc.current.second * pc.msInA.second + pc.utt.ms;\n pc.utt.minute = pc.current.minute * pc.msInA.minute + pc.utt.second;\n pc.utt.hour = pc.current.hour * pc.msInA.hour + pc.utt.minute;\n pc.utt.day = pc.current.day * pc.msInA.day + pc.utt.hour;\n pc.utt.week = pc.current.week * pc.msInA.week + pc.utt.day;\n pc.utt.date = pc.current.date * pc.msInA.day + pc.utt.hour;\n pc.utt.month = pc.current.month + 1 * pc.msInA.month + pc.utt.date;\n pc.utt.year = pc.current.year * pc.msInA.year + pc.utt.month;\n\n // calculates the proportion/ratio of each unit that has passed\n // used to display percentages\n pc.passage = {\n ms: pc.current.ms / 100,\n second: pc.current.ms / pc.msInA.second,\n minute: pc.utt.second / pc.msInA.minute,\n hour: pc.utt.minute / pc.msInA.hour,\n day: pc.utt.hour / pc.msInA.day,\n week: pc.utt.day / pc.msInA.week,\n month: pc.utt.date / pc.msInA.month,\n year: pc.utt.month / pc.msInA.year\n };\n\n // tidies up the current clock readouts for display\n pc.display = {\n ms: pc.utt.ms,\n second: pc.current.second,\n minute: pc.current.minute.toString().padStart(2, \"0\"),\n hour: pc.current.hour.toString().padStart(2, \"0\"),\n day: pc.current.date,\n week: pc.current.week,\n month: pc.current.month.toString().padStart(2, \"0\"),\n year: pc.current.year\n };\n\n if (debug) {\n console.dir(pc);\n }\n\n // returns the ratios and the clock readouts\n return { psg: pc.passage, dsp: pc.display };\n}","overTime(){\n\t\t//\n\t}","function updateTime() {\n\n}","function task4 () {\n\n function Clock (options) {\n this._template = options.template\n }\n \n Clock.prototype.render = function() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = this._template.replace('h', hours)\n .replace('m', min)\n .replace('s', sec);\n console.log(output);\n };\n\n Clock.prototype.stop = function () {\n clearInterval(this._timer)\n }\n\n Clock.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), 1000)\n };\n\n\n\n // Descendant\n\n function RelativeClock(options) {\n Clock.apply(this, arguments) // coffee script super() :)\n this._precision = options.precision || 1000\n };\n\n RelativeClock.prototype = Object.create(Clock.prototype);\n RelativeClock.prototype.constructor = RelativeClock;\n\n RelativeClock.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), this._precision)\n };\n\n var rc = new RelativeClock({\n template: \"h:m:s\",\n precision: 10000\n })\n rc.start()\n}","function classTime(C_E,desc,day,start,fin,loc,start_date){\n this.C_E = C_E;\n this.desc = desc;\n this.day = day;\n this.start = start;\n this.fin = fin;\n this.loc = loc;\n this.start_date = start_date;\n}","function __time($obj) {\r\n if (window.STATICCLASS_CALENDAR==null) {\r\n window.STATICCLASS_CALENDAR = __loadScript(\"CalendarTime\", 1);\r\n }\r\n window.STATICCLASS_CALENDAR.perform($obj);\r\n}","function timeTest()\r\n{\r\n}","function startTime() {\n setTimer();\n}","constructor() {\n /** Indicates if the clock is endend. */\n this.endedLocal = false;\n /** The duration between start and end of the clock. */\n this.diff = null;\n this.startTimeLocal = new Date();\n this.hrtimeLocal = process.hrtime();\n }","function Stopwatch() {}","applyWorkingTime(timeAxis) {\n const me = this,\n config = me._workingTime;\n\n if (config) {\n let hour = null;\n // Only use valid values\n if (\n config.fromHour >= 0 &&\n config.fromHour < 24 &&\n config.toHour > config.fromHour &&\n config.toHour <= 24 &&\n config.toHour - config.fromHour < 24\n ) {\n hour = { from: config.fromHour, to: config.toHour };\n }\n\n let day = null;\n // Only use valid values\n if (\n config.fromDay >= 0 &&\n config.fromDay < 7 &&\n config.toDay > config.fromDay &&\n config.toDay <= 7 &&\n config.toDay - config.fromDay < 7\n ) {\n day = { from: config.fromDay, to: config.toDay };\n }\n\n if (hour || day) {\n timeAxis.include = {\n hour,\n day\n };\n } else {\n // No valid rules, restore timeAxis\n timeAxis.include = null;\n }\n } else {\n // No rules, restore timeAxis\n timeAxis.include = null;\n }\n\n if (me.rendered) {\n // Refreshing header, which also recalculate tickSize and header data\n me.timeAxisColumn.refreshHeader();\n // Update column lines\n if (me.features.columnLines) {\n me.features.columnLines.drawLines();\n }\n\n // Animate event changes\n me.refreshWithTransition();\n }\n }","function task3 () {\n //\n function Clock(options) {\n var template = options.template;\n var timer;\n \n function render() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\n console.log(output);\n }\n this.stop = function() {\n clearInterval(timer);\n };\n this.start = function() {\n render();\n timer = setInterval(render, 1000);\n }\n }\n \n var cf = new Clock({\n template: 'h:m:s'\n });\n // cf.start();\n\n\n function ClockP (options) {\n this._template = options.template\n this._timer = null\n }\n\n ClockP.prototype.render = function() {\n var date = new Date();\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n var output = this._template.replace('h', hours)\n .replace('m', min)\n .replace('s', sec);\n console.log(output);\n };\n\n ClockP.prototype.stop = function () {\n clearInterval(this._timer)\n }\n\n ClockP.prototype.start = function() {\n this.render()\n this._timer = setInterval(this.render.bind(this), 1000)\n };\n\n var cp = new ClockP({\n template: 'h:m:s'\n });\n cp.start();\n\n}","currentTime() {\n this.time24 = new Time();\n this.updateTime(false);\n }","function SimulationEngine() {\n\t\t\n\t}","function tickTheClock(){\n\n \n \n}","function engine() {\n \n run = false;\n leg = length;\n \n while(leg--) {\n \n itm = dictionary[leg];\n \n if(!itm) break;\n if(itm.isCSS) continue;\n \n if(itm.cycle()) {\n \n run = true;\n\n }\n else {\n \n itm.stop(false, itm.complete, false, true);\n \n }\n \n }\n \n if(request) {\n \n if(run) {\n \n request(engine);\n \n }\n else {\n \n cancel(engine);\n itm = trans = null;\n \n }\n \n }\n else {\n \n if(run) {\n \n if(!engineRunning) timer = setInterval(engine, intervalSpeed);\n \n }\n else {\n \n clearInterval(timer);\n itm = trans = null;\n \n }\n \n }\n \n engineRunning = run;\n \n }","function updateTime() {\n console.log(\"updateTime()\");\n store.timeModel.update();\n}","get_timeSet() {\n return this.liveFunc._timeSet;\n }","function Clock() {\n\n var daysInAMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n\n this.month = 1;\n this.day = 1;\n this.year = 2016;\n\n this.tick = function() {\n this.day += 1;\n\n if (this.day > daysInAMonth[this.month - 1]) {\n this.month += 1;\n this.day = 1;\n }\n\n }\n\n this.time = function() {\n \tvar month = this.month < 10 ? \"0\" + this.month : this.month;\n \tvar day = this.day < 10 ? \"0\" + this.day : this.day;\n console.log(`${this.year}-${month}-${day}`)\n }\n\n this.getTime = function() {\n var month = this.month < 10 ? \"0\" + this.month : this.month;\n \tvar day = this.day < 10 ? \"0\" + this.day : this.day;\n return `${this.year}-${month}-${day}`;\n }\n\n}","function onSystemTimeChanged() {\r\n updateTime();\r\n }","function setTime( t ){\n\n this.time = t;\n\n }","getTime(){\n this.time = millis();\n this.timeFromLast = this.time - this.timeUntilLast;\n\n this.lifeTime = this.time - this.startTime;\n \n \n }","get elapsedTime() {\n return this._t;\n }","function startTime()\n{\n //get how long does it take for the smallest unit to elapse to set timeouts\n var timeout = time.units[time.units.length-1];\n\n //put the name into the text\n $(\"[class^=timeName]\").html(time.name);\n\n //clocks\n localTime();\n currentFictional(timeout);\n countdownToBegin(timeout);\n\n //converters\n $(\"#eyToTimeY\").submit(function(event){\n event.preventDefault();\n $(\"#eyToTimeYResult\").text( earthYearsToTimeYears($(\"#eyToTimeYInput\").val()) );\n });\n\n //SUT year to Earth year\n $(\"#timeToEY\").submit(function(event){\n event.preventDefault();\n $(\"#timeToEYResult\").text( timeYearsToEarthYears($(\"#timeToEYInput\").val()) );\n });\n\n //setup date picker for Earth year\n $(\"#eDToTimeInput\").fdatepicker({format:\"yyyy-mm-dd\"});\n //Earth date to SUT\n $(\"#eDToTime\").submit(function(event){\n event.preventDefault();\n $(\"#eDToTimeResult\").text( earthDateToTime($(\"#eDToTimeInput\").val()) );\n });\n\n}","function timebase() {\n\t//timebased will interupt all other routines once started, until shutdown\n\t\n\t//TODO: turn timebase off completely by killing the interval function.\n\tif (timebase_status != \"running\") {\n\t\treturn;\n\t}\n\n\tvar current_hour = date.getHours();\n\tvar current_month = date.getMonth();\n\n\t//Daytime (7:00 - 19:00)\n\tif (current_hour >= 7 && current_hour < 18+season_sunset_offset) {\n\t\t//TODO: fade in from sunrise to sunrise+1hr\n\t\t\n\t\t//TODO: change hue/sat value in feedback loop from color zone sensor!\n\t\t\n\t\t//Turn on when active.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on');\n\t\t}\n\t//Nighttime (19:00 - 2:00)\n\t} else if (current_hour >= 18+season_sunset_offset || current_hour < 2) {\n\t\t//TODO: Flux full transition from 19:00 to 21:30\n\t\t\n\t\t//Turn on when active.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on');\n\t\t}\n\t}\n\t//Supernight (2:00 - 7:00)\n\telse if (current_hour >= 2 && current_hour < 7) {\n\t\t//Turn on when active.\n\t\t//TODO: only 10% brightness.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on'); //TODO: Per zone.\n\t\t}\n\t}\n\n\t//TODO: grab realtime sunrise/set data from internet\n\t//Sunrise accent effect\n\tif (0) {\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//Sunset accent effect\n\tif (0) {\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//TODO: grab data from ical file off the internet every day. \n\t//Calendar effects\n\tif (0) { //if event_start\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//check for securityMode\n\tif (hasActive(detectionData) && securityMode) {\n\t\t//disable it\n\t\tsecurityMode = false;\n\t\t//TODO: Flash welcome home accent pattern.\n\t}\n\n\t//Seasonal changes\n\t//Summer- push sunset back.\n\tif (current_month > 4 || current_month < 9) {\n\t\tseason_sunset_offset = 1.5;\n\t}\n\t\n\t//TODO: Update the light/history database here.\n\t//TODO: Check if database has no records for last 24 hours\n\t//Security Mode: simulate house\n\tif (0) {\n\t\tvar securityMode = true;\n\t\t//TODO: Implment security mode\n\t}\n\t//TODO: Parse duke api for warnings\n\tif (0) {\n\t\t//TODO: Check if it's an updated posting or not, and if so, flash accents red/yellow every 30s until disabled.\n\t}\n\n}","update(timeStep) {\n\n }","function LogicNodeTime() {\n\t\tLogicNode.call(this);\n\t\tthis.wantsProcessCall = true;\n\t\tthis.logicInterface = LogicNodeTime.logicInterface;\n\t\tthis.type = 'LogicNodeTime';\n\t\tthis._time = 0;\n\t\tthis._running = true;\n\t}","function calcEquationOfTime(t) {\n\t var epsilon = calcObliquityCorrection(t);\n\t var l0 = calcGeomMeanLongSun(t);\n\t var e = calcEccentricityEarthOrbit(t);\n\t var m = calcGeomMeanAnomalySun(t);\n\n\t var y = Math.tan(degToRad(epsilon) / 2.0);\n\t y *= y;\n\n\t var sin2l0 = Math.sin(2.0 * degToRad(l0));\n\t var sinm = Math.sin(degToRad(m));\n\t var cos2l0 = Math.cos(2.0 * degToRad(l0));\n\t var sin4l0 = Math.sin(4.0 * degToRad(l0));\n\t var sin2m = Math.sin(2.0 * degToRad(m));\n\n\t var Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;\n\t return radToDeg(Etime) * 4.0; // in minutes of time\n\t}","function KalturaTimeWarnerService(client){\n\tthis.init(client);\n}","createTimer() {\n\t\t// set initial in seconds\n\t\tthis.initialTime = 0;\n\n\t\t// display text on Axis with formated Time\n\t\tthis.text = this.add.text(\n\t\t\t16,\n\t\t\t50,\n\t\t\t\"Time: \" + this.formatTime(this.initialTime)\n\t\t);\n\n\t\t// Each 1000 ms call onEvent\n\t\tthis.timedEvent = this.time.addEvent({\n\t\t\tdelay: 1000,\n\t\t\tcallback: this.onEvent,\n\t\t\tcallbackScope: this,\n\t\t\tloop: true,\n\t\t});\n\t}","function TimeStamp() {}","function TimeStamp() {}","get startTime() { return this._startTime; }","applyWorkingTime(timeAxis) {\n const me = this,\n config = me._workingTime;\n\n if (config) {\n let hour = null; // Only use valid values\n\n if (config.fromHour >= 0 && config.fromHour < 24 && config.toHour > config.fromHour && config.toHour <= 24 && config.toHour - config.fromHour < 24) {\n hour = {\n from: config.fromHour,\n to: config.toHour\n };\n }\n\n let day = null; // Only use valid values\n\n if (config.fromDay >= 0 && config.fromDay < 7 && config.toDay > config.fromDay && config.toDay <= 7 && config.toDay - config.fromDay < 7) {\n day = {\n from: config.fromDay,\n to: config.toDay\n };\n }\n\n if (hour || day) {\n timeAxis.include = {\n hour,\n day\n };\n } else {\n // No valid rules, restore timeAxis\n timeAxis.include = null;\n }\n } else {\n // No rules, restore timeAxis\n timeAxis.include = null;\n }\n\n if (me.isPainted) {\n var _me$features$columnLi;\n\n // Refreshing header, which also recalculate tickSize and header data\n me.timeAxisColumn.refreshHeader(); // Update column lines\n\n (_me$features$columnLi = me.features.columnLines) === null || _me$features$columnLi === void 0 ? void 0 : _me$features$columnLi.refresh(); // Animate event changes\n\n me.refreshWithTransition();\n }\n }","changeStartTime(startTime){\n this.startTime = startTime;\n }","twelveClock () {\n const shiftAM = () => this.#hour < 4\n ? eveningGreet.run()\n : morningGreet.run()\n\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\n ? eveningGreet.run()\n : afternoonGreet.run()\n\n return this.#shift === 'AM'\n ? shiftAM()\n : shiftPM()\n }","get(){\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::get\");\t\n\t\treturn this.elapsed;\n\t}","liveTime() {\n\t\tthis.updateTime();\n\t\tthis.writeLog();\n\t}","onSleepingTime() {\n throw new NotImplementedException();\n }","function templateEngine () { }","function test_timepicker_should_pass_correct_timing_on_service_order() {}","function Time() {\n this._clock = void 0;\n this._timeScale = void 0;\n this._deltaTime = void 0;\n this._startTime = void 0;\n this._lastTickTime = void 0;\n this._clock = wechatAdapter.performance ? wechatAdapter.performance : Date;\n this._timeScale = 1.0;\n this._deltaTime = 0.0001;\n\n var now = this._clock.now();\n\n this._startTime = now;\n this._lastTickTime = now;\n }","getStartTime() {\n return this.startTime;\n }","function timecalc(hoursBack) {\r\n // Function to return current time for use to calculate the timeframe parameter for the parkingEvents query. \r\n // The function minus the number of hours back accuratly articulates to the api what \r\n // timeframe should be viewed.\r\n var date = new Date()\r\n return Date.UTC(date.getUTCFullYear(),date.getUTCMonth(), date.getUTCDate() , \r\n date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds())-(hoursBack*60*60*1000); \r\n }","timerTick(e) {\n console.log(\"This method should be overridden in child classes.\");\n }","constructor(schedule) {\n\n }","function morning() {\n // whole morning routine\n}","setTime(ts) {\nreturn this.timeStamp = ts;\n}","constructor(engine) {\n this.engine = engine;\n }","function getInitialTime() {\n changeTime();\n}","constructor (){\n\t\tsuper();\n\n\t\tthis.getTheTime = this.getTheTime.bind(this);\n\n\t\t/**\n\t\t * Setup the time variable to update every second\n\t\t */\n\t\t\n\t\tthis.state = {\n\t\t\ttime: null\n\t\t}\n\n\t\tthis.getTheTime();\n\t}","function OnTimeModule() {\n\t\tthis.name = \"OnTime.Module\";\n\t}","computeTime() {\n let year;\n const fields = this.fields;\n if (this.isSet(YEAR)) {\n year = fields[YEAR];\n } else {\n year = new Date().getFullYear();\n }\n let timeOfDay = 0;\n if (this.isSet(HOUR_OF_DAY)) {\n timeOfDay += fields[HOUR_OF_DAY];\n }\n timeOfDay *= 60;\n timeOfDay += fields[MINUTE] || 0;\n timeOfDay *= 60;\n timeOfDay += fields[SECONDS] || 0;\n timeOfDay *= 1000;\n timeOfDay += fields[MILLISECONDS] || 0;\n let fixedDate = 0;\n fields[YEAR] = year;\n fixedDate = fixedDate + this.getFixedDate();\n // millis represents local wall-clock time in milliseconds.\n let millis = (fixedDate - EPOCH_OFFSET) * ONE_DAY + timeOfDay;\n millis -= this.timezoneOffset * ONE_MINUTE;\n this.time = millis;\n this.computeFields();\n }","function erlang(servers, time) {\n return (servers * time)/3600;\n}","get time() {\n return this._time;\n }","_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}","constructor() {\n\n this.timedEntities = []; // Will hold list of entities being tracked\n this.activeEntity = null; // This is the entity we are currently timing\n this.intervalTimer = null; // Will hold reference after we start setInterval\n this.chartTimer = null; // Will hold referenec to the setInterval for updating the charts\n this.timingActive = false; // Are we currently running the timer?\n this.totalTicksActive = 0; // seconds that the timer has been running\n // Store the timestamp in ms of the last time a tick happened in case the\n // app gets backgrounded and JS execution stops. Can then add in the right\n // number of secconds after\n this.lastTickTime = -1;\n this.turnList = []; // Will hold a set of dictionaries defining each time the speaker changed.\n this.minTurnLength = 10; // seconds; the time before a turn is shown on the timeline\n\n this.meetingName = \"\";\n this.attributeNameGender = \"Gender\";\n this.attributeNameSecondary = \"Secondary Attribute\";\n this.attributeNameTertiary = \"Tertiary Attribute\";\n }","getPlayTime() {\n return this.time;\n }","scheduler() {\n this.maybeTickSongChart();\n\n // When nextNoteTime (in the future) is near (gap is determined by \n // scheduleAheadTime), schedule audio & visuals and advance to the next\n // note.\n while (this.nextNoteTime <\n (this.audioContext.currentTime + this.scheduleAheadTime)) {\n this.scheduleNote(this.current16thNote, this.nextNoteTime);\n this.nextNote();\n }\n }","initCurrentTimeLine() {\n const me = this,\n now = new Date();\n\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\n return;\n }\n\n me.currentTimeLine = new me.store.modelClass({\n // eslint-disable-next-line quote-props\n 'id': 'currentTime',\n cls: 'b-sch-current-time',\n startDate: now,\n name: DateHelper.format(now, me.currentDateFormat)\n });\n me.updateCurrentTimeLine = me.updateCurrentTimeLine.bind(me);\n me.currentTimeInterval = me.setInterval(me.updateCurrentTimeLine, me.updateCurrentTimeLineInterval);\n\n if (me.client.isPainted) {\n me.renderRanges();\n }\n }","get time() {}","now () {\n return this.t;\n }","function yFindRealTimeClock(func)\n{\n return YRealTimeClock.FindRealTimeClock(func);\n}","setTime(time) {\n this.time = time;\n return this;\n }","get elapsedTime() {\n return this._elapsedTime\n }","function timerWrapper () {}","function updateTime(){\n setTimeContent(\"timer\");\n}","function setTime(){\n let dt = new Date();\n currScene.timeInScene = dt.getTime();\n}","function timeUpdate() {\n timeEngaged += delta();\n}","function localClock(){\n digitalClock(0,\"clock\");\n digitalClock(-7,\"clockNy\")\n digitalClock(8,\"tokyo\") \n}","tickCaller(game){\n game.tick();\n }","eventTimer() {throw new Error('Must declare the function')}","time(time) {\n if (time == null) {\n return this._time;\n }\n\n let dt = time - this._time;\n this.step(dt);\n return this;\n }","function Schedule(options,element){return _super.call(this,options,element)||this;}","timer() {\n this.sethandRotation('hour');\n this.sethandRotation('minute');\n this.sethandRotation('second');\n }","tick() {\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::tick\");\t\n var timeNow = new Date().getTime();\n\n if (this.lastTime != 0)\n \tthis.elapsed = timeNow - this.lastTime;\n\n this.lastTime = timeNow;\n }","get time () {\n\t\treturn this._time;\n\t}","function time(){\n\t $('#Begtime').mobiscroll().time({\n\t theme: 'wp',\n\t display: 'inline',\n\t mode: 'scroller'\n\t });\n\t $('#Endtime').mobiscroll().time({\n\t theme: 'wp',\n\t display: 'inline',\n\t mode: 'scroller'\n\t });\n\t removeUnwanted(); \n\t insertClass(); \n\t getTimeFromInput(\"Begtime\");\n\t getTimeFromInput(\"Endtime\");\n\t}","function Timer() {}","init(...args) {\n\t\tthis._super(...args);\n\n\t\tthis.setupTime();\n\t}","_setTime() {\n switch(this.difficultyLevel) {\n case 1:\n // this.gameTime uses ms\n this.gameTime = 45000;\n break;\n case 2:\n this.gameTime = 100000;\n break;\n case 3:\n this.gameTime = 160000;\n break;\n case 4:\n this.gameTime = 220000;\n break;\n default:\n throw new Error('there is no time');\n }\n }","update_() {\n var current = this.tlc_.getCurrent();\n this.scope_['time'] = current;\n var t = new Date(current);\n\n var coord = this.coord_ || MapContainer.getInstance().getMap().getView().getCenter();\n\n if (coord) {\n coord = olProj.toLonLat(coord, osMap.PROJECTION);\n\n this.scope_['coord'] = coord;\n var sets = [];\n\n // sun times\n var suntimes = SunCalc.getTimes(t, coord[1], coord[0]);\n var sunpos = SunCalc.getPosition(t, coord[1], coord[0]);\n\n // Determine dawn/dusk based on user preference\n var calcTitle;\n var dawnTime;\n var duskTime;\n\n switch (settings.getInstance().get(SettingKey.DUSK_MODE)) {\n case 'nautical':\n calcTitle = 'Nautical calculation';\n dawnTime = suntimes.nauticalDawn.getTime();\n duskTime = suntimes.nauticalDusk.getTime();\n break;\n case 'civilian':\n calcTitle = 'Civilian calculation';\n dawnTime = suntimes.dawn.getTime();\n duskTime = suntimes.dusk.getTime();\n break;\n case 'astronomical':\n default:\n calcTitle = 'Astronomical calculation';\n dawnTime = suntimes.nightEnd.getTime();\n duskTime = suntimes.night.getTime();\n break;\n }\n\n var times = [{\n 'label': 'Dawn',\n 'time': dawnTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Sunrise',\n 'time': suntimes.sunrise.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Solar Noon',\n 'time': suntimes.solarNoon.getTime(),\n 'color': '#FFD700'\n }, {\n 'label': 'Sunset',\n 'time': suntimes.sunset.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Dusk',\n 'time': duskTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Night',\n 'time': suntimes.night.getTime(),\n 'color': '#000080'\n }];\n\n this.scope_['sun'] = {\n 'altitude': sunpos.altitude * geo.R2D,\n 'azimuth': (geo.R2D * (sunpos.azimuth + Math.PI)) % 360\n };\n\n // moon times\n var moontimes = SunCalc.getMoonTimes(t, coord[1], coord[0]);\n var moonpos = SunCalc.getMoonPosition(t, coord[1], coord[0]);\n var moonlight = SunCalc.getMoonIllumination(t);\n\n this.scope_['moonAlwaysDown'] = moontimes.alwaysDown;\n this.scope_['moonAlwaysUp'] = moontimes.alwaysUp;\n\n if (moontimes.rise) {\n times.push({\n 'label': 'Moonrise',\n 'time': moontimes.rise.getTime(),\n 'color': '#ddd'\n });\n }\n\n if (moontimes.set) {\n times.push({\n 'label': 'Moonset',\n 'time': moontimes.set.getTime(),\n 'color': '#2F4F4F'\n });\n }\n\n var phase = '';\n for (var i = 0, n = PHASES.length; i < n; i++) {\n if (moonlight.phase >= PHASES[i].min && moonlight.phase < PHASES[i].max) {\n phase = PHASES[i].label;\n break;\n }\n }\n\n this.scope_['moon'] = {\n 'alwaysUp': moontimes.alwaysUp,\n 'alwaysDown': moontimes.alwaysDown,\n 'azimuth': (geo.R2D * (moonpos.azimuth + Math.PI)) % 360,\n 'altitude': moonpos.altitude * geo.R2D,\n 'brightness': Math.ceil(moonlight.fraction * 100) + '%',\n 'phase': phase\n };\n\n times = times.filter(filter);\n times.forEach(addTextColor);\n googArray.sortObjectsByKey(times, 'time');\n sets.push(times);\n\n this.scope_['times'] = times;\n ui.apply(this.scope_);\n }\n }","function TimeManager() {\n var self = this;\n\n this.init = function () {\n self.initTime = (new Date()).getTime() / 1000;\n self.offset = 0;\n self.speed = 1;\n self.query_params = self.get_query_param();\n if (self.query_params.hasOwnProperty('time')) {\n self.offset = parseInt(self.query_params.time);\n }\n else if (self.query_params.hasOwnProperty('from')) {\n self.offset = parseInt(self.query_params.from);\n }\n if (self.offset) {\n self.speed = 20;\n }\n\n if (self.query_params.hasOwnProperty('speed')) {\n self.speed = parseFloat(self.query_params.speed);\n }\n };\n\n this.getTime = function() {\n var realTime = self.getRealTime();\n if (self.offset) {\n return self.offset + (realTime - self.initTime) * self.speed;\n }\n\n return realTime;\n };\n\n this.getRealTime = function () {\n return (new Date()).getTime() / 1000;\n };\n\n // Extracts query params from url.\n this.get_query_param = function () {\n var query_string = {};\n var query = window.location.search.substring(1);\n var pairs = query.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split('=');\n\n // If first entry with this name.\n if (typeof query_string[pair[0]] === 'undefined') {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n }\n // If second entry with this name.\n else if (typeof query_string[pair[0]] === 'string') {\n query_string[pair[0]] = [\n query_string[pair[0]],\n decodeURIComponent(pair[1])\n ];\n }\n // If third or later entry with this name\n else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n }\n\n return query_string;\n };\n\n this.init();\n\n return this;\n}","function playInst(inst, startTime, stopTime){\n\n var inst = inst;\n var startTime = startTime;\n var stopTime = stopTime;\n\n inst.startAtTime(globalNow+startTime);\n inst.stopAtTime(globalNow+stopTime);\n\n}","constructor() {\r\n super();\r\n /**\r\n * Previous measurement time\r\n * @private\r\n * @type {number}\r\n */\r\n this.oldTime_;\r\n }","getGameTime() {\n return this.time / 1200;\n }","onChange(e) {\n if (this.props.onChange) {\n this.props.onChange(e);\n }\n window.$('#' + this.id).timepicker('setTime', e.target.value);\n }","update(scene, time, delta) {\n // Tick the time (setting the milliseconds will automatically convert up into seconds/minutes/hours)\n this.time.setMilliseconds(this.time.getMilliseconds() + (delta * this.speed * CONSTANTS.SIMULATION_SPEED_FACTOR));\n\n // Update the sky's ambient color\n this.updateAmbientLightColor();\n\n // Check if we can emit an event to the event emitter to notify about the time of day\n // Only emits once, thats why we have the flags\n if (this.time.getHours() == 8 && !this.calledMorning) {\n this.events.emit(\"morning\");\n\n this.calledMorning = true;\n this.calledNoon = false;\n this.calledEvening = false;\n this.calledNight = false;\n } else if (this.time.getHours() == 12 && !this.calledNoon) {\n this.events.emit(\"noon\");\n\n this.calledMorning = false;\n this.calledNoon = true;\n this.calledEvening = false;\n this.calledNight = false; \n } else if (this.time.getHours() == 18 && !this.calledEvening) {\n this.events.emit(\"evening\");\n\n this.calledMorning = false;\n this.calledNoon = false;\n this.calledEvening = true;\n this.calledNight = false; \n } else if (this.time.getHours() == 21 && !this.calledNight) {\n this.events.emit(\"night\");\n\n this.calledMorning = false;\n this.calledNoon = false;\n this.calledEvening = false;\n this.calledNight = true; \n }\n }","function newRE(name) {\n\n // Object holding defaults for various saved fields.\n var virginData = {\n type: \"pk_rhythm_engine\",\n version: 1,\n morpher: {x: 36, y: 36},\n kits: [],\n voices: [],\n presets: [],\n clock: {struc: \"simple\", sig: 0, bar: 0, beat: 0, pos: 0, tempo_bpm: 90, cycleLength: 16, running: false}\n };\n\n // data will be saved and loaded to localStorage.\n var data = copy_object(virginData);\n\n var clockLastTime_secs = undefined;\n var lastTickTime_secs = 0;\n var kDelay_secs = 0.05;\n var clockJSN = undefined;\n\n // Load info about existing kits into the engine.\n function initData() {\n var k, ki;\n for (k in availableKitInfos) {\n ki = availableKitInfos[k];\n data.kits.push({\n name: ki.name,\n url: ki.url\n });\n }\n }\n\n initData();\n\n var kitNames = [];\n\n // Status of whether the clockTick() should do morphing calculations.\n var morphEnabled = 0;\n var morphNeedsUpdate = false;\n\n // Clock callbacks.\n var onGridTick = undefined;\n var onMorphUpdate = undefined;\n\n // Runs at about 60 ticks per second (linked to screen refresh rate).\n function clockTick() {\n var clock = data.clock;\n\n // Check whether the engine is running.\n if (!clock.running) {\n clockLastTime_secs = undefined;\n return;\n }\n\n var delta_secs = 0, dbeat, dbar;\n\n while (true) {\n if (clockLastTime_secs) {\n var now_secs = theAudioContext.currentTime;\n var sqpb = kTimeStruc[clock.struc].semiQuaversPerBar;\n var ticks_per_sec = clock.tempo_bpm * sqpb / 60;\n var nextTickTime_secs = lastTickTime_secs + 1 / ticks_per_sec;\n if (now_secs + kDelay_secs >= nextTickTime_secs) {\n dbeat = Math.floor(((clock.pos % sqpb) + 1) / sqpb);\n dbar = Math.floor((clock.beat + dbeat) / kTimeSig.D[clock.sig]);\n clock.bar = (clock.bar + dbar) % kTimeStruc[clock.struc].cycleLength;\n clock.beat = (clock.beat + dbeat) % kTimeSig.N[clock.sig];\n clock.pos = clock.pos + 1;\n lastTickTime_secs = nextTickTime_secs;\n } else {\n return;\n }\n } else {\n // Very first call.\n clockLastTime_secs = theAudioContext.currentTime;\n clock.bar = 0;\n clock.beat = 0;\n clock.pos = 0;\n lastTickTime_secs = clockLastTime_secs + kDelay_secs;\n }\n\n // If we're doing a morph, set all the relevant control values.\n updateMorph();\n\n // Perform all the voices for all the active presets.\n var i, N, v;\n for (i = 0, N = data.voices.length; i < N; ++i) {\n v = data.voices[i];\n if (v) {\n genBeat(v, clock, lastTickTime_secs);\n }\n }\n\n // Do the callback if specified.\n if (onGridTick) {\n onGridTick(clock);\n }\n }\n }\n\n var kVoiceControlsToMorph = [\n 'straight', 'offbeat', 'funk', 'phase', 'random', \n 'ramp', 'threshold', 'mean', 'cycleWeight', 'volume', 'pan'\n ];\n\n // Utility to calculate a weighted sum.\n // \n // weights is an array of weights. Entries can include 'undefined',\n // in which case they'll not be included in the weighted sum.\n //\n // value_getter is function (i) -> value\n // result_transform(value) is applied to the weighted sum before \n // returning the result value.\n function morphedValue(weights, value_getter, result_transform) {\n var result = 0, wsum = 0;\n var i, N, val;\n for (i = 0, N = weights.length; i < N; ++i) {\n if (weights[i] !== undefined) {\n val = value_getter(i);\n if (val !== undefined) {\n result += weights[i] * val;\n wsum += weights[i];\n }\n }\n }\n return result_transform ? result_transform(result / wsum) : result / wsum;\n }\n\n // Something about the morph status changed.\n // Update the parameters of all the voices to reflect\n // the change.\n function updateMorph() {\n var i, N;\n if (morphEnabled && morphNeedsUpdate && data.presets.length > 1) {\n\n // Compute morph distances for each preset.\n var morphWeights = [], dx, dy, ps;\n for (i = 0, N = data.presets.length; i < N; ++i) {\n ps = data.presets[i];\n if (ps && ps.useInMorph) {\n dx = data.morpher.x - data.presets[i].pos.x;\n dy = data.morpher.y - data.presets[i].pos.y;\n morphWeights[i] = 1 / (1 + Math.sqrt(dx * dx + dy * dy));\n }\n }\n\n // For each voice, compute the morph.\n var wsum = 0, wnorm = 1, p, pN, w, c, cN, v;\n\n // Normalize the morph weights.\n wsum = morphedValue(morphWeights, function (p) { return 1; });\n wnorm = 1 / wsum; // WARNING: Divide by zero?\n\n // For each voice and for each control in each voice, do the morph.\n for (i = 0, N = data.voices.length; i < N; ++i) {\n for (c = 0, cN = kVoiceControlsToMorph.length, v = data.voices[i]; c < cN; ++c) {\n v[kVoiceControlsToMorph[c]] = morphedValue(morphWeights, function (p) { \n var ps = data.presets[p];\n return i < ps.voices.length ? ps.voices[i][kVoiceControlsToMorph[c]] : undefined;\n });\n }\n }\n\n // Now morph the tempo. We morph the tempo in the log domain.\n data.clock.tempo_bpm = morphedValue(morphWeights, function (p) { return Math.log(data.presets[p].clock.tempo_bpm); }, Math.exp);\n\n // Morph the cycle length.\n data.clock.cycleLength = Math.round(morphedValue(morphWeights, function (p) { return data.presets[p].clock.cycleLength; }));\n \n if (onMorphUpdate) {\n setTimeout(onMorphUpdate, 0);\n }\n\n morphNeedsUpdate = false;\n --morphEnabled;\n }\n }\n\n // We store info about all the presets as a JSON string in\n // a single key in localStorage.\n var storageKey = 'com.nishabdam.PeteKellock.RhythmEngine.' + name + '.data';\n\n // Loads the previous engine state saved in localStorage.\n function load(delegate) {\n var dataStr = window.localStorage[storageKey];\n if (dataStr) {\n loadFromStr(dataStr, delegate);\n } else {\n alert(\"RhythmEngine: load error\");\n }\n }\n\n // Loads an engine state saved as a string from, possibly, an \n // external source.\n function loadFromStr(dataStr, delegate) {\n try {\n data = JSON.parse(dataStr);\n } catch (e) {\n setTimeout(function () {\n delegate.onError(\"Corrupt rhythm engine snapshot file.\");\n }, 0);\n return;\n }\n\n var work = {done: 0, total: 0};\n\n function reportProgress(changeInDone, changeInTotal, desc) {\n work.done += changeInDone;\n work.total += changeInTotal;\n if (delegate.progress) {\n delegate.progress(work.done, work.total, desc);\n }\n }\n\n reportProgress(0, data.kits.length * 10);\n\n kitNames = [];\n\n data.kits.forEach(function (kitInfo) {\n SampleManager.loadSampleSet(kitInfo.name, kitInfo.url, {\n didFetchMappings: function (name, mappings) {\n reportProgress(0, getKeys(mappings).length * 2);\n },\n didLoadSample: function (name, key) {\n reportProgress(1, 0);\n },\n didDecodeSample: function () {\n reportProgress(1, 0);\n },\n didFinishLoadingSampleSet: function (name, sset) {\n kitNames.push(name);\n\n // Save the drum names.\n kitInfo.drums = getKeys(sset);\n\n reportProgress(10, 0);\n\n if (kitNames.length === data.kits.length) {\n // We're done.\n delegate.didLoad();\n clockTick();\n }\n }\n });\n });\n }\n\n // This is for loading the JSON string if the user \n // gives it by choosing an external file.\n function loadExternal(fileData, delegate, dontSave) {\n if (checkSnapshotFileData(fileData, delegate)) {\n loadFromStr(fileData, {\n progress: delegate.progress,\n didLoad: function () {\n if (!dontSave) {\n save();\n }\n delegate.didLoad();\n }\n });\n }\n }\n\n // A simple check for the starting part of a snapshot file.\n // This relies on the fact that browser javascript engines\n // enumerate an object's keys in the same order in which they\n // were inserted into the object.\n function checkSnapshotFileData(fileData, delegate) {\n var valid = (fileData.indexOf('{\"type\":\"pk_rhythm_engine\"') === 0);\n if (!valid) {\n setTimeout(function () {\n delegate.onError(\"This is not a rhythm engine snapshot file.\");\n }, 0);\n }\n return valid;\n }\n\n // Loads settings from file with given name, located in\n // the \"settings\" folder.\n function loadFile(filename, delegate) {\n if (filename && typeof(filename) === 'string') {\n fs.root.getDirectory(\"settings\", {create: true},\n function (settingsDir) {\n settingsDir.getFile(filename, {create: false},\n function (fileEntry) {\n fileEntry.file(\n function (f) {\n var reader = new global.FileReader();\n\n reader.onloadend = function () {\n loadExternal(reader.result, delegate, true);\n };\n reader.onerror = delegate && delegate.onError;\n\n reader.readAsText(f);\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n } else {\n load(delegate);\n }\n }\n\n // Makes an array of strings giving the names of saved\n // settings and calls delegate.didListSettings(array)\n // upon success. delegate.onError is called if there is\n // some error.\n function listSavedSettings(delegate) {\n fs.root.getDirectory(\"settings\", {create: true},\n function (settingsDir) {\n var reader = settingsDir.createReader();\n var result = [];\n\n function readEntries() {\n reader.readEntries(\n function (entries) {\n var i, N;\n\n if (entries.length === 0) {\n // We're done.\n delegate.didListSettings(result.sort());\n } else {\n // More to go. Accumulate the names.\n for (i = 0, N = entries.length; i < N; ++i) {\n result.push(entries[i].name);\n }\n\n // Continue listing the directory.\n readEntries();\n }\n },\n delegate && delegate.onError\n );\n }\n\n readEntries();\n },\n delegate && delegate.onError\n );\n }\n\n // Saves all the presets in local storage.\n function save(filename, delegate) {\n var dataAsJSON = JSON.stringify(data);\n\n // First save a copy in the locaStorage for worst case scenario.\n window.localStorage[storageKey] = dataAsJSON;\n\n if (filename && typeof(filename) === 'string') {\n fs.root.getDirectory(\"settings\", {create: true},\n function (settingsDir) {\n settingsDir.getFile(filename, {create: true},\n function (f) {\n f.createWriter(\n function (writer) {\n writer.onwriteend = delegate && delegate.didSave;\n writer.onerror = delegate && delegate.onError;\n\n var bb = new global.BlobBuilder();\n bb.append(dataAsJSON);\n writer.write(bb.getBlob());\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n },\n delegate && delegate.onError\n );\n }\n }\n\n // Make a \"voice\" object exposing all the live-tweakable\n // parameters. The API user can just set these parameters\n // to hear immediate effect in the RE's output.\n function make_voice(kit, drum) {\n return {\n voice: {kit: kit, drum: drum},\n straight: 0.5,\n offbeat: 0.0,\n funk: 0.0,\n phase: 0,\n random: 0.0,\n ramp: 0.2,\n threshold: 0.5,\n mean: 0.5,\n cycleWeight: 0.2,\n volume: 1.0,\n pan: 0.0\n };\n }\n\n function validatePresetIndex(p, extra) {\n if (p < 0 || p >= data.presets.length + (extra ? extra : 0)) {\n throw new Error('Invalid preset index!');\n }\n }\n\n return {\n kits: data.kits, // Read-only.\n save: save,\n snapshot: function () { return JSON.stringify(data); },\n load: loadFile,\n list: listSavedSettings,\n import: loadExternal,\n\n // You can set a callback to be received on every grid tick so\n // that you can do something visual about it. The callback will\n // receive the current clock status as the sole argument.\n // The callback is expected to not modify the clock.\n get onGridTick() { return onGridTick; },\n set onGridTick(newCallback) { onGridTick = newCallback; },\n\n // You can set a callback for notification whenever the bulk\n // of sliders have been changed due to a morph update.\n get onMorphUpdate() { return onMorphUpdate; },\n set onMorphUpdate(newCallback) { onMorphUpdate = newCallback; },\n\n // Change the tempo by assigning to tempo_bpm field.\n get tempo_bpm() {\n return data.clock.tempo_bpm;\n },\n set tempo_bpm(new_tempo_bpm) {\n data.clock.tempo_bpm = Math.min(Math.max(10, new_tempo_bpm), 480);\n },\n\n // Info about the voices and facility to add more.\n numVoices: function () { return data.voices.length; },\n voice: function (i) { return data.voices[i]; },\n addVoice: function (kit, drum) {\n var voice = make_voice(kit || 'acoustic-kit', drum || 'kick');\n data.voices.push(voice);\n return voice;\n },\n\n // Info about presets and the ability to add/save to presets.\n numPresets: function () { return data.presets.length; },\n preset: function (p) { return data.presets[p]; },\n saveAsPreset: function (p) {\n validatePresetIndex(p, 1);\n\n p = Math.min(data.presets.length, p);\n\n // Either make a new preset or change a saved one.\n // We preserve a preset's morph weight if we're\n // changing one to a new snapshot.\n var old = (p < data.presets.length ? data.presets[p] : {pos: {x: 0, y: 0}});\n data.presets[p] = {\n useInMorph: old.useInMorph,\n pos: copy_object(old.pos),\n clock: copy_object(data.clock),\n voices: copy_object(data.voices)\n };\n },\n\n\n // Morphing functions. The initial state of the morpher is \"disabled\",\n // so as long as that is the case, none of the 2D position functions\n // have any effect. You first need to enable the morpher before\n // the other calls have any effect.\n enableMorph: function (flag) {\n morphEnabled += flag ? 1 : 0;\n if (flag) {\n morphNeedsUpdate = true;\n }\n },\n presetPos: function (p) { return data.presets[p].pos; },\n changePresetPos: function (p, x, y) {\n validatePresetIndex(p);\n var pos = data.presets[p].pos;\n pos.x = x;\n pos.y = y;\n morphNeedsUpdate = true;\n },\n morpherPos: function () { return data.morpher; },\n changeMorpherPos: function (x, y) {\n data.morpher.x = x;\n data.morpher.y = y;\n morphNeedsUpdate = true;\n },\n\n // Starting and stopping the engine. Both methods are\n // idempotent.\n get running() { return data.clock.running; },\n start: function () {\n if (!data.clock.running) {\n data.clock.running = true;\n clockLastTime_secs = undefined;\n clockJSN = theAudioContext.createJavaScriptNode(512, 0, 1);\n clockJSN.onaudioprocess = function (event) {\n clockTick();\n };\n clockJSN.connect(theAudioContext.destination);\n }\n },\n stop: function () {\n data.clock.running = false;\n if (clockJSN) {\n clockJSN.disconnect();\n clockJSN = undefined;\n }\n }\n };\n }","function interval(){\r\n\ttry{\r\n\t\tthis.startTime = function (){\t\r\n\t\t\ttry{\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tvar today=new Date();\r\n\t\t\t\t\tvar h=today.getHours();\r\n\t\t\t\t\tvar m=today.getMinutes();\r\n\t\t\t\t\tvar startm = today.getMinutes();\r\n var s=today.getSeconds();\r\n\t\t\t\t\t// add a zero in front of numbers<10\r\n\t\t\t\t\tm=this.checkTime(m);\r\n\t\t\t\t\ts=this.checkTime(s);\r\n\r\n $('txt').innerHTML= h+\":\"+m+\":\"+s;\r\n\t\t\t\t\t$('clock').value = m;\t\t\r\n\t\t\t\t\tt=setTimeout('intervalObj.startTime()',500);\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.startTime()');\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add a zero in front of numbers<10\r\n\t\tthis.checkTime = function(i){\r\n\t\t\ttry{\r\n\t\t\t\tif (i<10){\r\n\t\t\t\t\ti=\"0\" + i;\r\n\t\t\t\t}\r\n\t\t\t\treturn i;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.checkTime()');\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t//End of clock function\r\n\t\t//To start the clock on web page.\r\n\t\t\r\n\t\tthis.call = function(){\r\n\t\t\ttry{\r\n\r\n\t\t\t\t$('text').value=$('txt').innerHTML;\r\n\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.call()');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//To stop the clock.\r\n\t\tthis.stopTime = function(){\r\n\t\t\ttry{\r\n\t\t\t\t$('txtTime').value=$('txt').innerHTML;\r\n document.getElementById(\"txt\").style.display = 'none';\r\n\r\n }catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.stopTime()');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//To calculate the total time difference.\r\n\t\tthis.calculateTotalTime = function() {\r\n\t\t\ttry{\r\n\t\t\t\tvar t1=$('text').value;\r\n\t\t\t\tvar t2=$('txtTime').value;\r\n\t\t\t\tvar arrt1 = t1.split(\":\");\r\n\t\t\t\tvar arrt2 = t2.split(\":\");\t\t\r\n\t\t\t\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\r\n\t\t\t\tvar timeDifference=this.convertTime(sub);\t\t\r\n\t\t\treturn timeDifference;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\r\n\t\t\t}\t\r\n\t\t}\r\n this.calculatebatsmanTime = function(t1,t2) {\r\n\t\t\ttry{\r\n\t\t\t\r\n\t\t\t\tvar arrt1 = t1.split(\":\");\r\n\t\t\t\tvar arrt2 = t2.split(\":\");\r\n\t\t\t\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\r\n\t\t\t\tvar timeDifference=this.convertTime(sub);\r\n\t\t\treturn timeDifference;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\r\n\t\t\t}\r\n\t\t}\r\n\r\n //To Convert time.\r\n\t\tthis.convertTime = function(sub){\r\n\t\t\ttry{\r\n\t\t\t\tvar hrs=parseInt(sub/3600);\t\t\r\n\t\t\t\tvar rem=(sub%3600);\r\n\t\t\t\tvar min=parseInt(rem/60);\r\n\t\t\t\tvar sec=(rem%60);\r\n\t\t\t\tmin=this.checkTime(min);\r\n\t\t\t\tsec=this.checkTime(sec);\r\n\t\t\t\tvar convertDifference=(hrs+\":\"+min+\":\"+sec);\r\n\t\t\treturn convertDifference;\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.convertTime()');\r\n\t\t\t}\t\r\n\t\t}\t\t\r\n\t\t//To display the time period of interruptions and intervals.\r\n\t\t\r\n\t\tthis.DisplayInterval=function(flag){\r\n\t\r\n\t\t\tvar MATCH_TIME_ACC=42000;//700min.\r\n\t\t\tvar MATCH_INNING_ACC=21000;//350min.\r\n\t\r\n\t\t\ttry{\r\n\t\t\t\tif($('text').value==\"\" && $('txtTime').value==\"\"){\r\n\t\t\t\t\talert(\"You Did Not Start Timer\");\r\n\t\t\t\t}else if(flag==1){\t\t\r\n\t\t\t\t\talert(\"Interruption Time is:: \"+this.calculateTotalTime());\r\n\t\t\t\t}else if(flag==2){\t\r\n\t\t\t\t\t//Interval-Injury\r\n\t\t\t\t\tvar time=this.calculateTotalTime();\r\n\t\t\t\t\tvar arrtime = time.split(\":\");\r\n\t\t\t\t\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\r\n\t\t\t\t\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\r\n\t\t\t\t\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\r\n\t\t\t\t\r\n\t\t\t\t}else if(flag==3){\r\n\t\t\t\t\t\t//Interval-Drink\r\n\t\t\t\t\t\tvar time=this.calculateTotalTime();\r\n\t\t\t\t\t\tvar arrtime = time.split(\":\");\r\n\t\t\t\t\t\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\r\n\t\t\t\t\t\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\r\n\t\t\t\t\t\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\r\n\t\t\t\t\t\tMATCH_INNING_ACC=MATCH_INNING_ACC+sec;//Adding minits in match_inning Account\r\n\t\t\t\t\t\tvar inningTime=this.convertTime(MATCH_INNING_ACC);\r\n\t\t\t\t}else if(flag==4){\r\n\t\t\t\t\t\t//Interval-Lunch/Tea.\r\n\t\t\t\t\t\tthis.calculateTotalTime();\r\n\t\t\t\t}\r\n\t\t\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval.DisplayInterval()');\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t\t\r\n\t}catch(err){\r\n\t\t\t\talert(err.description,'BCCI.js.interval()');\r\n\t}\t\t\r\n}","function tick() {\n\n\n\n}","set_time( t ){ this.current_time = t; this.draw_fg(); return this; }"],"string":"[\n \"function tickCurrentTimeEngine() {\\n\\n var d = new Date();\\n\\n currentHours = d.getHours();\\n currentMinutes = d.getMinutes();\\n currentSeconds = d.getSeconds();\\n\\n if (currentHours.toString().length == 1) {\\n choursDigit_1 = 0;\\n choursDigit_2 = currentHours;\\n }\\n else {\\n choursDigit_1 = parseInt(currentHours.toString().charAt(0), 10);\\n choursDigit_2 = parseInt(currentHours.toString().charAt(1), 10);\\n }\\n\\n if (currentMinutes.toString().length == 1) {\\n cminutesDigit_1 = 0;\\n cminutesDigit_2 = currentMinutes;\\n }\\n else {\\n cminutesDigit_1 = parseInt(currentMinutes.toString().charAt(0), 10);\\n cminutesDigit_2 = parseInt(currentMinutes.toString().charAt(1), 10);\\n }\\n\\n if (currentSeconds.toString().length == 1) {\\n csecondsDigit_1 = 0;\\n csecondsDigit_2 = currentSeconds;\\n }\\n else {\\n csecondsDigit_1 = parseInt(currentSeconds.toString().charAt(0), 10);\\n csecondsDigit_2 = parseInt(currentSeconds.toString().charAt(1), 10);\\n }\\n\\n tickCurrentTime = setTimeout(tickCurrentTimeEngine, timerCurrentTimeMiliSecs);\\n\\n return;\\n }\",\n \"function Time() {}\",\n \"get time () { throw \\\"Game system not supported\\\"; }\",\n \"_onTimeupdate () {\\n this.emit('timeupdate', this.getCurrentTime())\\n }\",\n \"_onTimeupdate () {\\n this.emit('timeupdate', this.getCurrentTime())\\n }\",\n \"function TimeUtils() {}\",\n \"getTime(){return this.time;}\",\n \"function Engine() {\\n }\",\n \"onTimeChanged () {\\n this.view.renderTimeAndDate();\\n }\",\n \"function tickTime() {\\n // the magic object with all the time data\\n // the present passing current moment\\n let pc = {\\n thisMoment: {},\\n current: {},\\n msInA: {},\\n utt: {},\\n passage: {},\\n display: {}\\n };\\n\\n // get the current time\\n pc.thisMoment = {};\\n pc.thisMoment = new Date();\\n\\n // slice current time into units\\n pc.current = {\\n ms: pc.thisMoment.getMilliseconds(),\\n second: pc.thisMoment.getSeconds(),\\n minute: pc.thisMoment.getMinutes(),\\n hour: pc.thisMoment.getHours(),\\n day: pc.thisMoment.getDay(),\\n date: pc.thisMoment.getDate(),\\n week: weekOfYear(pc.thisMoment),\\n month: pc.thisMoment.getMonth(),\\n year: pc.thisMoment.getFullYear()\\n };\\n\\n // TODO: display day of week and month name\\n let dayOfWeek = DAYS[pc.current.day];\\n let monthName = MONTHS[pc.current.month];\\n\\n // returns the week no. out of the year\\n function weekOfYear(d) {\\n d.setHours(0, 0, 0);\\n d.setDate(d.getDate() + 4 - (d.getDay() || 7));\\n return Math.ceil(((d - new Date(d.getFullYear(), 0, 1)) / 8.64e7 + 1) / 7);\\n }\\n\\n // set the slice conversions based on pc.thisMoment\\n pc.msInA.ms = 1;\\n pc.msInA.second = 1000;\\n pc.msInA.minute = pc.msInA.second * 60;\\n pc.msInA.hour = pc.msInA.minute * 60;\\n pc.msInA.day = pc.msInA.hour * 24;\\n pc.msInA.week = pc.msInA.day * 7;\\n pc.msInA.month = pc.msInA.day * MONTH_DAYS[pc.current.month - 1];\\n pc.msInA.year = pc.msInA.day * daysThisYear(pc.current.year);\\n\\n // handle leap years\\n function daysThisYear(year) {\\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\\n MONTH_DAYS[1] = 29;\\n return 366;\\n } else {\\n return 365;\\n }\\n }\\n\\n // utt means UpToThis\\n // calculates the count in ms of each unit that has passed\\n pc.utt.ms = pc.current.ms;\\n pc.utt.second = pc.current.second * pc.msInA.second + pc.utt.ms;\\n pc.utt.minute = pc.current.minute * pc.msInA.minute + pc.utt.second;\\n pc.utt.hour = pc.current.hour * pc.msInA.hour + pc.utt.minute;\\n pc.utt.day = pc.current.day * pc.msInA.day + pc.utt.hour;\\n pc.utt.week = pc.current.week * pc.msInA.week + pc.utt.day;\\n pc.utt.date = pc.current.date * pc.msInA.day + pc.utt.hour;\\n pc.utt.month = pc.current.month + 1 * pc.msInA.month + pc.utt.date;\\n pc.utt.year = pc.current.year * pc.msInA.year + pc.utt.month;\\n\\n // calculates the proportion/ratio of each unit that has passed\\n // used to display percentages\\n pc.passage = {\\n ms: pc.current.ms / 100,\\n second: pc.current.ms / pc.msInA.second,\\n minute: pc.utt.second / pc.msInA.minute,\\n hour: pc.utt.minute / pc.msInA.hour,\\n day: pc.utt.hour / pc.msInA.day,\\n week: pc.utt.day / pc.msInA.week,\\n month: pc.utt.date / pc.msInA.month,\\n year: pc.utt.month / pc.msInA.year\\n };\\n\\n // tidies up the current clock readouts for display\\n pc.display = {\\n ms: pc.utt.ms,\\n second: pc.current.second,\\n minute: pc.current.minute.toString().padStart(2, \\\"0\\\"),\\n hour: pc.current.hour.toString().padStart(2, \\\"0\\\"),\\n day: pc.current.date,\\n week: pc.current.week,\\n month: pc.current.month.toString().padStart(2, \\\"0\\\"),\\n year: pc.current.year\\n };\\n\\n if (debug) {\\n console.dir(pc);\\n }\\n\\n // returns the ratios and the clock readouts\\n return { psg: pc.passage, dsp: pc.display };\\n}\",\n \"overTime(){\\n\\t\\t//\\n\\t}\",\n \"function updateTime() {\\n\\n}\",\n \"function task4 () {\\n\\n function Clock (options) {\\n this._template = options.template\\n }\\n \\n Clock.prototype.render = function() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = this._template.replace('h', hours)\\n .replace('m', min)\\n .replace('s', sec);\\n console.log(output);\\n };\\n\\n Clock.prototype.stop = function () {\\n clearInterval(this._timer)\\n }\\n\\n Clock.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), 1000)\\n };\\n\\n\\n\\n // Descendant\\n\\n function RelativeClock(options) {\\n Clock.apply(this, arguments) // coffee script super() :)\\n this._precision = options.precision || 1000\\n };\\n\\n RelativeClock.prototype = Object.create(Clock.prototype);\\n RelativeClock.prototype.constructor = RelativeClock;\\n\\n RelativeClock.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), this._precision)\\n };\\n\\n var rc = new RelativeClock({\\n template: \\\"h:m:s\\\",\\n precision: 10000\\n })\\n rc.start()\\n}\",\n \"function classTime(C_E,desc,day,start,fin,loc,start_date){\\n this.C_E = C_E;\\n this.desc = desc;\\n this.day = day;\\n this.start = start;\\n this.fin = fin;\\n this.loc = loc;\\n this.start_date = start_date;\\n}\",\n \"function __time($obj) {\\r\\n if (window.STATICCLASS_CALENDAR==null) {\\r\\n window.STATICCLASS_CALENDAR = __loadScript(\\\"CalendarTime\\\", 1);\\r\\n }\\r\\n window.STATICCLASS_CALENDAR.perform($obj);\\r\\n}\",\n \"function timeTest()\\r\\n{\\r\\n}\",\n \"function startTime() {\\n setTimer();\\n}\",\n \"constructor() {\\n /** Indicates if the clock is endend. */\\n this.endedLocal = false;\\n /** The duration between start and end of the clock. */\\n this.diff = null;\\n this.startTimeLocal = new Date();\\n this.hrtimeLocal = process.hrtime();\\n }\",\n \"function Stopwatch() {}\",\n \"applyWorkingTime(timeAxis) {\\n const me = this,\\n config = me._workingTime;\\n\\n if (config) {\\n let hour = null;\\n // Only use valid values\\n if (\\n config.fromHour >= 0 &&\\n config.fromHour < 24 &&\\n config.toHour > config.fromHour &&\\n config.toHour <= 24 &&\\n config.toHour - config.fromHour < 24\\n ) {\\n hour = { from: config.fromHour, to: config.toHour };\\n }\\n\\n let day = null;\\n // Only use valid values\\n if (\\n config.fromDay >= 0 &&\\n config.fromDay < 7 &&\\n config.toDay > config.fromDay &&\\n config.toDay <= 7 &&\\n config.toDay - config.fromDay < 7\\n ) {\\n day = { from: config.fromDay, to: config.toDay };\\n }\\n\\n if (hour || day) {\\n timeAxis.include = {\\n hour,\\n day\\n };\\n } else {\\n // No valid rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n } else {\\n // No rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n\\n if (me.rendered) {\\n // Refreshing header, which also recalculate tickSize and header data\\n me.timeAxisColumn.refreshHeader();\\n // Update column lines\\n if (me.features.columnLines) {\\n me.features.columnLines.drawLines();\\n }\\n\\n // Animate event changes\\n me.refreshWithTransition();\\n }\\n }\",\n \"function task3 () {\\n //\\n function Clock(options) {\\n var template = options.template;\\n var timer;\\n \\n function render() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\\n console.log(output);\\n }\\n this.stop = function() {\\n clearInterval(timer);\\n };\\n this.start = function() {\\n render();\\n timer = setInterval(render, 1000);\\n }\\n }\\n \\n var cf = new Clock({\\n template: 'h:m:s'\\n });\\n // cf.start();\\n\\n\\n function ClockP (options) {\\n this._template = options.template\\n this._timer = null\\n }\\n\\n ClockP.prototype.render = function() {\\n var date = new Date();\\n var hours = date.getHours();\\n if (hours < 10) hours = '0' + hours;\\n var min = date.getMinutes();\\n if (min < 10) min = '0' + min;\\n var sec = date.getSeconds();\\n if (sec < 10) sec = '0' + sec;\\n var output = this._template.replace('h', hours)\\n .replace('m', min)\\n .replace('s', sec);\\n console.log(output);\\n };\\n\\n ClockP.prototype.stop = function () {\\n clearInterval(this._timer)\\n }\\n\\n ClockP.prototype.start = function() {\\n this.render()\\n this._timer = setInterval(this.render.bind(this), 1000)\\n };\\n\\n var cp = new ClockP({\\n template: 'h:m:s'\\n });\\n cp.start();\\n\\n}\",\n \"currentTime() {\\n this.time24 = new Time();\\n this.updateTime(false);\\n }\",\n \"function SimulationEngine() {\\n\\t\\t\\n\\t}\",\n \"function tickTheClock(){\\n\\n \\n \\n}\",\n \"function engine() {\\n \\n run = false;\\n leg = length;\\n \\n while(leg--) {\\n \\n itm = dictionary[leg];\\n \\n if(!itm) break;\\n if(itm.isCSS) continue;\\n \\n if(itm.cycle()) {\\n \\n run = true;\\n\\n }\\n else {\\n \\n itm.stop(false, itm.complete, false, true);\\n \\n }\\n \\n }\\n \\n if(request) {\\n \\n if(run) {\\n \\n request(engine);\\n \\n }\\n else {\\n \\n cancel(engine);\\n itm = trans = null;\\n \\n }\\n \\n }\\n else {\\n \\n if(run) {\\n \\n if(!engineRunning) timer = setInterval(engine, intervalSpeed);\\n \\n }\\n else {\\n \\n clearInterval(timer);\\n itm = trans = null;\\n \\n }\\n \\n }\\n \\n engineRunning = run;\\n \\n }\",\n \"function updateTime() {\\n console.log(\\\"updateTime()\\\");\\n store.timeModel.update();\\n}\",\n \"get_timeSet() {\\n return this.liveFunc._timeSet;\\n }\",\n \"function Clock() {\\n\\n var daysInAMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\\n\\n this.month = 1;\\n this.day = 1;\\n this.year = 2016;\\n\\n this.tick = function() {\\n this.day += 1;\\n\\n if (this.day > daysInAMonth[this.month - 1]) {\\n this.month += 1;\\n this.day = 1;\\n }\\n\\n }\\n\\n this.time = function() {\\n \\tvar month = this.month < 10 ? \\\"0\\\" + this.month : this.month;\\n \\tvar day = this.day < 10 ? \\\"0\\\" + this.day : this.day;\\n console.log(`${this.year}-${month}-${day}`)\\n }\\n\\n this.getTime = function() {\\n var month = this.month < 10 ? \\\"0\\\" + this.month : this.month;\\n \\tvar day = this.day < 10 ? \\\"0\\\" + this.day : this.day;\\n return `${this.year}-${month}-${day}`;\\n }\\n\\n}\",\n \"function onSystemTimeChanged() {\\r\\n updateTime();\\r\\n }\",\n \"function setTime( t ){\\n\\n this.time = t;\\n\\n }\",\n \"getTime(){\\n this.time = millis();\\n this.timeFromLast = this.time - this.timeUntilLast;\\n\\n this.lifeTime = this.time - this.startTime;\\n \\n \\n }\",\n \"get elapsedTime() {\\n return this._t;\\n }\",\n \"function startTime()\\n{\\n //get how long does it take for the smallest unit to elapse to set timeouts\\n var timeout = time.units[time.units.length-1];\\n\\n //put the name into the text\\n $(\\\"[class^=timeName]\\\").html(time.name);\\n\\n //clocks\\n localTime();\\n currentFictional(timeout);\\n countdownToBegin(timeout);\\n\\n //converters\\n $(\\\"#eyToTimeY\\\").submit(function(event){\\n event.preventDefault();\\n $(\\\"#eyToTimeYResult\\\").text( earthYearsToTimeYears($(\\\"#eyToTimeYInput\\\").val()) );\\n });\\n\\n //SUT year to Earth year\\n $(\\\"#timeToEY\\\").submit(function(event){\\n event.preventDefault();\\n $(\\\"#timeToEYResult\\\").text( timeYearsToEarthYears($(\\\"#timeToEYInput\\\").val()) );\\n });\\n\\n //setup date picker for Earth year\\n $(\\\"#eDToTimeInput\\\").fdatepicker({format:\\\"yyyy-mm-dd\\\"});\\n //Earth date to SUT\\n $(\\\"#eDToTime\\\").submit(function(event){\\n event.preventDefault();\\n $(\\\"#eDToTimeResult\\\").text( earthDateToTime($(\\\"#eDToTimeInput\\\").val()) );\\n });\\n\\n}\",\n \"function timebase() {\\n\\t//timebased will interupt all other routines once started, until shutdown\\n\\t\\n\\t//TODO: turn timebase off completely by killing the interval function.\\n\\tif (timebase_status != \\\"running\\\") {\\n\\t\\treturn;\\n\\t}\\n\\n\\tvar current_hour = date.getHours();\\n\\tvar current_month = date.getMonth();\\n\\n\\t//Daytime (7:00 - 19:00)\\n\\tif (current_hour >= 7 && current_hour < 18+season_sunset_offset) {\\n\\t\\t//TODO: fade in from sunrise to sunrise+1hr\\n\\t\\t\\n\\t\\t//TODO: change hue/sat value in feedback loop from color zone sensor!\\n\\t\\t\\n\\t\\t//Turn on when active.\\n\\t\\tif (hasActive(detectionData)) {\\n\\t\\t\\tstateChange('on');\\n\\t\\t}\\n\\t//Nighttime (19:00 - 2:00)\\n\\t} else if (current_hour >= 18+season_sunset_offset || current_hour < 2) {\\n\\t\\t//TODO: Flux full transition from 19:00 to 21:30\\n\\t\\t\\n\\t\\t//Turn on when active.\\n\\t\\tif (hasActive(detectionData)) {\\n\\t\\t\\tstateChange('on');\\n\\t\\t}\\n\\t}\\n\\t//Supernight (2:00 - 7:00)\\n\\telse if (current_hour >= 2 && current_hour < 7) {\\n\\t\\t//Turn on when active.\\n\\t\\t//TODO: only 10% brightness.\\n\\t\\tif (hasActive(detectionData)) {\\n\\t\\t\\tstateChange('on'); //TODO: Per zone.\\n\\t\\t}\\n\\t}\\n\\n\\t//TODO: grab realtime sunrise/set data from internet\\n\\t//Sunrise accent effect\\n\\tif (0) {\\n\\t\\t//TODO: Flash accents red, yellow, blue\\n\\t}\\n\\n\\t//Sunset accent effect\\n\\tif (0) {\\n\\t\\t//TODO: Flash accents red, yellow, blue\\n\\t}\\n\\n\\t//TODO: grab data from ical file off the internet every day. \\n\\t//Calendar effects\\n\\tif (0) { //if event_start\\n\\t\\t//TODO: Flash accents red, yellow, blue\\n\\t}\\n\\n\\t//check for securityMode\\n\\tif (hasActive(detectionData) && securityMode) {\\n\\t\\t//disable it\\n\\t\\tsecurityMode = false;\\n\\t\\t//TODO: Flash welcome home accent pattern.\\n\\t}\\n\\n\\t//Seasonal changes\\n\\t//Summer- push sunset back.\\n\\tif (current_month > 4 || current_month < 9) {\\n\\t\\tseason_sunset_offset = 1.5;\\n\\t}\\n\\t\\n\\t//TODO: Update the light/history database here.\\n\\t//TODO: Check if database has no records for last 24 hours\\n\\t//Security Mode: simulate house\\n\\tif (0) {\\n\\t\\tvar securityMode = true;\\n\\t\\t//TODO: Implment security mode\\n\\t}\\n\\t//TODO: Parse duke api for warnings\\n\\tif (0) {\\n\\t\\t//TODO: Check if it's an updated posting or not, and if so, flash accents red/yellow every 30s until disabled.\\n\\t}\\n\\n}\",\n \"update(timeStep) {\\n\\n }\",\n \"function LogicNodeTime() {\\n\\t\\tLogicNode.call(this);\\n\\t\\tthis.wantsProcessCall = true;\\n\\t\\tthis.logicInterface = LogicNodeTime.logicInterface;\\n\\t\\tthis.type = 'LogicNodeTime';\\n\\t\\tthis._time = 0;\\n\\t\\tthis._running = true;\\n\\t}\",\n \"function calcEquationOfTime(t) {\\n\\t var epsilon = calcObliquityCorrection(t);\\n\\t var l0 = calcGeomMeanLongSun(t);\\n\\t var e = calcEccentricityEarthOrbit(t);\\n\\t var m = calcGeomMeanAnomalySun(t);\\n\\n\\t var y = Math.tan(degToRad(epsilon) / 2.0);\\n\\t y *= y;\\n\\n\\t var sin2l0 = Math.sin(2.0 * degToRad(l0));\\n\\t var sinm = Math.sin(degToRad(m));\\n\\t var cos2l0 = Math.cos(2.0 * degToRad(l0));\\n\\t var sin4l0 = Math.sin(4.0 * degToRad(l0));\\n\\t var sin2m = Math.sin(2.0 * degToRad(m));\\n\\n\\t var Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;\\n\\t return radToDeg(Etime) * 4.0; // in minutes of time\\n\\t}\",\n \"function KalturaTimeWarnerService(client){\\n\\tthis.init(client);\\n}\",\n \"createTimer() {\\n\\t\\t// set initial in seconds\\n\\t\\tthis.initialTime = 0;\\n\\n\\t\\t// display text on Axis with formated Time\\n\\t\\tthis.text = this.add.text(\\n\\t\\t\\t16,\\n\\t\\t\\t50,\\n\\t\\t\\t\\\"Time: \\\" + this.formatTime(this.initialTime)\\n\\t\\t);\\n\\n\\t\\t// Each 1000 ms call onEvent\\n\\t\\tthis.timedEvent = this.time.addEvent({\\n\\t\\t\\tdelay: 1000,\\n\\t\\t\\tcallback: this.onEvent,\\n\\t\\t\\tcallbackScope: this,\\n\\t\\t\\tloop: true,\\n\\t\\t});\\n\\t}\",\n \"function TimeStamp() {}\",\n \"function TimeStamp() {}\",\n \"get startTime() { return this._startTime; }\",\n \"applyWorkingTime(timeAxis) {\\n const me = this,\\n config = me._workingTime;\\n\\n if (config) {\\n let hour = null; // Only use valid values\\n\\n if (config.fromHour >= 0 && config.fromHour < 24 && config.toHour > config.fromHour && config.toHour <= 24 && config.toHour - config.fromHour < 24) {\\n hour = {\\n from: config.fromHour,\\n to: config.toHour\\n };\\n }\\n\\n let day = null; // Only use valid values\\n\\n if (config.fromDay >= 0 && config.fromDay < 7 && config.toDay > config.fromDay && config.toDay <= 7 && config.toDay - config.fromDay < 7) {\\n day = {\\n from: config.fromDay,\\n to: config.toDay\\n };\\n }\\n\\n if (hour || day) {\\n timeAxis.include = {\\n hour,\\n day\\n };\\n } else {\\n // No valid rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n } else {\\n // No rules, restore timeAxis\\n timeAxis.include = null;\\n }\\n\\n if (me.isPainted) {\\n var _me$features$columnLi;\\n\\n // Refreshing header, which also recalculate tickSize and header data\\n me.timeAxisColumn.refreshHeader(); // Update column lines\\n\\n (_me$features$columnLi = me.features.columnLines) === null || _me$features$columnLi === void 0 ? void 0 : _me$features$columnLi.refresh(); // Animate event changes\\n\\n me.refreshWithTransition();\\n }\\n }\",\n \"changeStartTime(startTime){\\n this.startTime = startTime;\\n }\",\n \"twelveClock () {\\n const shiftAM = () => this.#hour < 4\\n ? eveningGreet.run()\\n : morningGreet.run()\\n\\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\\n ? eveningGreet.run()\\n : afternoonGreet.run()\\n\\n return this.#shift === 'AM'\\n ? shiftAM()\\n : shiftPM()\\n }\",\n \"get(){\\n\\t\\t// debug\\n\\t\\t// console.log(\\\"atomicGLClock::get\\\");\\t\\n\\t\\treturn this.elapsed;\\n\\t}\",\n \"liveTime() {\\n\\t\\tthis.updateTime();\\n\\t\\tthis.writeLog();\\n\\t}\",\n \"onSleepingTime() {\\n throw new NotImplementedException();\\n }\",\n \"function templateEngine () { }\",\n \"function test_timepicker_should_pass_correct_timing_on_service_order() {}\",\n \"function Time() {\\n this._clock = void 0;\\n this._timeScale = void 0;\\n this._deltaTime = void 0;\\n this._startTime = void 0;\\n this._lastTickTime = void 0;\\n this._clock = wechatAdapter.performance ? wechatAdapter.performance : Date;\\n this._timeScale = 1.0;\\n this._deltaTime = 0.0001;\\n\\n var now = this._clock.now();\\n\\n this._startTime = now;\\n this._lastTickTime = now;\\n }\",\n \"getStartTime() {\\n return this.startTime;\\n }\",\n \"function timecalc(hoursBack) {\\r\\n // Function to return current time for use to calculate the timeframe parameter for the parkingEvents query. \\r\\n // The function minus the number of hours back accuratly articulates to the api what \\r\\n // timeframe should be viewed.\\r\\n var date = new Date()\\r\\n return Date.UTC(date.getUTCFullYear(),date.getUTCMonth(), date.getUTCDate() , \\r\\n date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds())-(hoursBack*60*60*1000); \\r\\n }\",\n \"timerTick(e) {\\n console.log(\\\"This method should be overridden in child classes.\\\");\\n }\",\n \"constructor(schedule) {\\n\\n }\",\n \"function morning() {\\n // whole morning routine\\n}\",\n \"setTime(ts) {\\nreturn this.timeStamp = ts;\\n}\",\n \"constructor(engine) {\\n this.engine = engine;\\n }\",\n \"function getInitialTime() {\\n changeTime();\\n}\",\n \"constructor (){\\n\\t\\tsuper();\\n\\n\\t\\tthis.getTheTime = this.getTheTime.bind(this);\\n\\n\\t\\t/**\\n\\t\\t * Setup the time variable to update every second\\n\\t\\t */\\n\\t\\t\\n\\t\\tthis.state = {\\n\\t\\t\\ttime: null\\n\\t\\t}\\n\\n\\t\\tthis.getTheTime();\\n\\t}\",\n \"function OnTimeModule() {\\n\\t\\tthis.name = \\\"OnTime.Module\\\";\\n\\t}\",\n \"computeTime() {\\n let year;\\n const fields = this.fields;\\n if (this.isSet(YEAR)) {\\n year = fields[YEAR];\\n } else {\\n year = new Date().getFullYear();\\n }\\n let timeOfDay = 0;\\n if (this.isSet(HOUR_OF_DAY)) {\\n timeOfDay += fields[HOUR_OF_DAY];\\n }\\n timeOfDay *= 60;\\n timeOfDay += fields[MINUTE] || 0;\\n timeOfDay *= 60;\\n timeOfDay += fields[SECONDS] || 0;\\n timeOfDay *= 1000;\\n timeOfDay += fields[MILLISECONDS] || 0;\\n let fixedDate = 0;\\n fields[YEAR] = year;\\n fixedDate = fixedDate + this.getFixedDate();\\n // millis represents local wall-clock time in milliseconds.\\n let millis = (fixedDate - EPOCH_OFFSET) * ONE_DAY + timeOfDay;\\n millis -= this.timezoneOffset * ONE_MINUTE;\\n this.time = millis;\\n this.computeFields();\\n }\",\n \"function erlang(servers, time) {\\n return (servers * time)/3600;\\n}\",\n \"get time() {\\n return this._time;\\n }\",\n \"_specializedInitialisation()\\r\\n\\t{\\r\\n\\t\\tLogger.log(\\\"Specialisation for service AVTransport\\\", LogType.Info);\\r\\n\\t\\tvar relativeTime = this.getVariableByName(\\\"RelativeTimePosition\\\");\\r\\n\\t\\t//Implémentation pour OpenHome\\r\\n\\t\\tif (!relativeTime)\\r\\n\\t\\t\\trelativeTime = this.getVariableByName(\\\"A_ARG_TYPE_GetPositionInfo_RelTime\\\");\\r\\n\\t\\tvar transportState = this.getVariableByName(\\\"TransportState\\\");\\r\\n\\t\\t//Implémentation pour OpenHome\\r\\n\\t\\tif (!transportState)\\r\\n\\t\\t\\ttransportState = this.getVariableByName(\\\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\\\");\\r\\n\\r\\n\\t\\tif (transportState)\\r\\n\\t\\t{\\r\\n\\t\\t\\ttransportState.on('updated', (variable, newVal) =>\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tLogger.log(\\\"On transportStateUpdate : \\\" + newVal, LogType.DEBUG);\\r\\n\\t\\t\\t\\tvar actPosInfo = this.getActionByName(\\\"GetPositionInfo\\\");\\r\\n\\t\\t\\t\\tvar actMediaInfo = this.getActionByName(\\\"GetMediaInfo\\\");\\r\\n\\t\\t\\t\\t/*\\r\\n\\t\\t\\t\\t“STOPPED” R\\r\\n\\t\\t\\t\\t“PLAYING” R\\r\\n\\t\\t\\t\\t“TRANSITIONING” O\\r\\n\\t\\t\\t\\t”PAUSED_PLAYBACK” O\\r\\n\\t\\t\\t\\t“PAUSED_RECORDING” O\\r\\n\\t\\t\\t\\t“RECORDING” O\\r\\n\\t\\t\\t\\t“NO_MEDIA_PRESENT”\\r\\n\\t\\t\\t\\t */\\r\\n\\t\\t\\t\\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tif (this._intervalUpdateRelativeTime)\\r\\n\\t\\t\\t\\t\\t\\tclearInterval(this._intervalUpdateRelativeTime);\\r\\n\\t\\t\\t\\t\\tif (newVal == \\\"PLAYING\\\" || newVal == \\\"RECORDING\\\")\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{\\tInstanceID: 0\\t} );\\r\\n\\t\\t\\t\\t\\t\\t//Déclenche la maj toutes les 4 secondes\\r\\n\\t\\t\\t\\t\\t\\tthis._intervalUpdateRelativeTime = setInterval(() =>{\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t//Logger.log(\\\"On autoUpdate\\\", LogType.DEBUG);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{\\tInstanceID: 0\\t}\\t);\\r\\n\\t\\t\\t\\t\\t\\t\\t}, 4000);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t//else if (newVal == \\\"STOPPED\\\" || newVal == \\\"PAUSED_PLAYBACK\\\" || newVal == \\\"PAUSED_RECORDING\\\" || newVal == \\\"NO_MEDIA_PRESENT\\\")\\r\\n\\t\\t\\t\\t//{\\r\\n\\t\\t\\t\\t//\\r\\n\\t\\t\\t\\t//}\\r\\n\\t\\t\\t\\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\\r\\n\\t\\t\\t\\tif (newVal == \\\"TRANSITIONING\\\")\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tif (actPosInfo)\\r\\n\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{InstanceID: 0}\\t);\\r\\n\\t\\t\\t\\t\\tif (actMediaInfo)\\r\\n\\t\\t\\t\\t\\t\\tactMediaInfo.execute(\\t{InstanceID: 0} );\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif (newVal == \\\"STOPPED\\\")\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tif (actPosInfo)\\r\\n\\t\\t\\t\\t\\t\\tactPosInfo.execute(\\t{\\tInstanceID: 0\\t});\\r\\n\\t\\t\\t\\t\\tif (actMediaInfo)\\r\\n\\t\\t\\t\\t\\t\\tactMediaInfo.execute(\\t{\\tInstanceID: 0 });\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\",\n \"constructor() {\\n\\n this.timedEntities = []; // Will hold list of entities being tracked\\n this.activeEntity = null; // This is the entity we are currently timing\\n this.intervalTimer = null; // Will hold reference after we start setInterval\\n this.chartTimer = null; // Will hold referenec to the setInterval for updating the charts\\n this.timingActive = false; // Are we currently running the timer?\\n this.totalTicksActive = 0; // seconds that the timer has been running\\n // Store the timestamp in ms of the last time a tick happened in case the\\n // app gets backgrounded and JS execution stops. Can then add in the right\\n // number of secconds after\\n this.lastTickTime = -1;\\n this.turnList = []; // Will hold a set of dictionaries defining each time the speaker changed.\\n this.minTurnLength = 10; // seconds; the time before a turn is shown on the timeline\\n\\n this.meetingName = \\\"\\\";\\n this.attributeNameGender = \\\"Gender\\\";\\n this.attributeNameSecondary = \\\"Secondary Attribute\\\";\\n this.attributeNameTertiary = \\\"Tertiary Attribute\\\";\\n }\",\n \"getPlayTime() {\\n return this.time;\\n }\",\n \"scheduler() {\\n this.maybeTickSongChart();\\n\\n // When nextNoteTime (in the future) is near (gap is determined by \\n // scheduleAheadTime), schedule audio & visuals and advance to the next\\n // note.\\n while (this.nextNoteTime <\\n (this.audioContext.currentTime + this.scheduleAheadTime)) {\\n this.scheduleNote(this.current16thNote, this.nextNoteTime);\\n this.nextNote();\\n }\\n }\",\n \"initCurrentTimeLine() {\\n const me = this,\\n now = new Date();\\n\\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\\n return;\\n }\\n\\n me.currentTimeLine = new me.store.modelClass({\\n // eslint-disable-next-line quote-props\\n 'id': 'currentTime',\\n cls: 'b-sch-current-time',\\n startDate: now,\\n name: DateHelper.format(now, me.currentDateFormat)\\n });\\n me.updateCurrentTimeLine = me.updateCurrentTimeLine.bind(me);\\n me.currentTimeInterval = me.setInterval(me.updateCurrentTimeLine, me.updateCurrentTimeLineInterval);\\n\\n if (me.client.isPainted) {\\n me.renderRanges();\\n }\\n }\",\n \"get time() {}\",\n \"now () {\\n return this.t;\\n }\",\n \"function yFindRealTimeClock(func)\\n{\\n return YRealTimeClock.FindRealTimeClock(func);\\n}\",\n \"setTime(time) {\\n this.time = time;\\n return this;\\n }\",\n \"get elapsedTime() {\\n return this._elapsedTime\\n }\",\n \"function timerWrapper () {}\",\n \"function updateTime(){\\n setTimeContent(\\\"timer\\\");\\n}\",\n \"function setTime(){\\n let dt = new Date();\\n currScene.timeInScene = dt.getTime();\\n}\",\n \"function timeUpdate() {\\n timeEngaged += delta();\\n}\",\n \"function localClock(){\\n digitalClock(0,\\\"clock\\\");\\n digitalClock(-7,\\\"clockNy\\\")\\n digitalClock(8,\\\"tokyo\\\") \\n}\",\n \"tickCaller(game){\\n game.tick();\\n }\",\n \"eventTimer() {throw new Error('Must declare the function')}\",\n \"time(time) {\\n if (time == null) {\\n return this._time;\\n }\\n\\n let dt = time - this._time;\\n this.step(dt);\\n return this;\\n }\",\n \"function Schedule(options,element){return _super.call(this,options,element)||this;}\",\n \"timer() {\\n this.sethandRotation('hour');\\n this.sethandRotation('minute');\\n this.sethandRotation('second');\\n }\",\n \"tick() {\\n\\t\\t// debug\\n\\t\\t// console.log(\\\"atomicGLClock::tick\\\");\\t\\n var timeNow = new Date().getTime();\\n\\n if (this.lastTime != 0)\\n \\tthis.elapsed = timeNow - this.lastTime;\\n\\n this.lastTime = timeNow;\\n }\",\n \"get time () {\\n\\t\\treturn this._time;\\n\\t}\",\n \"function time(){\\n\\t $('#Begtime').mobiscroll().time({\\n\\t theme: 'wp',\\n\\t display: 'inline',\\n\\t mode: 'scroller'\\n\\t });\\n\\t $('#Endtime').mobiscroll().time({\\n\\t theme: 'wp',\\n\\t display: 'inline',\\n\\t mode: 'scroller'\\n\\t });\\n\\t removeUnwanted(); \\n\\t insertClass(); \\n\\t getTimeFromInput(\\\"Begtime\\\");\\n\\t getTimeFromInput(\\\"Endtime\\\");\\n\\t}\",\n \"function Timer() {}\",\n \"init(...args) {\\n\\t\\tthis._super(...args);\\n\\n\\t\\tthis.setupTime();\\n\\t}\",\n \"_setTime() {\\n switch(this.difficultyLevel) {\\n case 1:\\n // this.gameTime uses ms\\n this.gameTime = 45000;\\n break;\\n case 2:\\n this.gameTime = 100000;\\n break;\\n case 3:\\n this.gameTime = 160000;\\n break;\\n case 4:\\n this.gameTime = 220000;\\n break;\\n default:\\n throw new Error('there is no time');\\n }\\n }\",\n \"update_() {\\n var current = this.tlc_.getCurrent();\\n this.scope_['time'] = current;\\n var t = new Date(current);\\n\\n var coord = this.coord_ || MapContainer.getInstance().getMap().getView().getCenter();\\n\\n if (coord) {\\n coord = olProj.toLonLat(coord, osMap.PROJECTION);\\n\\n this.scope_['coord'] = coord;\\n var sets = [];\\n\\n // sun times\\n var suntimes = SunCalc.getTimes(t, coord[1], coord[0]);\\n var sunpos = SunCalc.getPosition(t, coord[1], coord[0]);\\n\\n // Determine dawn/dusk based on user preference\\n var calcTitle;\\n var dawnTime;\\n var duskTime;\\n\\n switch (settings.getInstance().get(SettingKey.DUSK_MODE)) {\\n case 'nautical':\\n calcTitle = 'Nautical calculation';\\n dawnTime = suntimes.nauticalDawn.getTime();\\n duskTime = suntimes.nauticalDusk.getTime();\\n break;\\n case 'civilian':\\n calcTitle = 'Civilian calculation';\\n dawnTime = suntimes.dawn.getTime();\\n duskTime = suntimes.dusk.getTime();\\n break;\\n case 'astronomical':\\n default:\\n calcTitle = 'Astronomical calculation';\\n dawnTime = suntimes.nightEnd.getTime();\\n duskTime = suntimes.night.getTime();\\n break;\\n }\\n\\n var times = [{\\n 'label': 'Dawn',\\n 'time': dawnTime,\\n 'title': calcTitle,\\n 'color': '#87CEFA'\\n }, {\\n 'label': 'Sunrise',\\n 'time': suntimes.sunrise.getTime(),\\n 'color': '#FFA500'\\n }, {\\n 'label': 'Solar Noon',\\n 'time': suntimes.solarNoon.getTime(),\\n 'color': '#FFD700'\\n }, {\\n 'label': 'Sunset',\\n 'time': suntimes.sunset.getTime(),\\n 'color': '#FFA500'\\n }, {\\n 'label': 'Dusk',\\n 'time': duskTime,\\n 'title': calcTitle,\\n 'color': '#87CEFA'\\n }, {\\n 'label': 'Night',\\n 'time': suntimes.night.getTime(),\\n 'color': '#000080'\\n }];\\n\\n this.scope_['sun'] = {\\n 'altitude': sunpos.altitude * geo.R2D,\\n 'azimuth': (geo.R2D * (sunpos.azimuth + Math.PI)) % 360\\n };\\n\\n // moon times\\n var moontimes = SunCalc.getMoonTimes(t, coord[1], coord[0]);\\n var moonpos = SunCalc.getMoonPosition(t, coord[1], coord[0]);\\n var moonlight = SunCalc.getMoonIllumination(t);\\n\\n this.scope_['moonAlwaysDown'] = moontimes.alwaysDown;\\n this.scope_['moonAlwaysUp'] = moontimes.alwaysUp;\\n\\n if (moontimes.rise) {\\n times.push({\\n 'label': 'Moonrise',\\n 'time': moontimes.rise.getTime(),\\n 'color': '#ddd'\\n });\\n }\\n\\n if (moontimes.set) {\\n times.push({\\n 'label': 'Moonset',\\n 'time': moontimes.set.getTime(),\\n 'color': '#2F4F4F'\\n });\\n }\\n\\n var phase = '';\\n for (var i = 0, n = PHASES.length; i < n; i++) {\\n if (moonlight.phase >= PHASES[i].min && moonlight.phase < PHASES[i].max) {\\n phase = PHASES[i].label;\\n break;\\n }\\n }\\n\\n this.scope_['moon'] = {\\n 'alwaysUp': moontimes.alwaysUp,\\n 'alwaysDown': moontimes.alwaysDown,\\n 'azimuth': (geo.R2D * (moonpos.azimuth + Math.PI)) % 360,\\n 'altitude': moonpos.altitude * geo.R2D,\\n 'brightness': Math.ceil(moonlight.fraction * 100) + '%',\\n 'phase': phase\\n };\\n\\n times = times.filter(filter);\\n times.forEach(addTextColor);\\n googArray.sortObjectsByKey(times, 'time');\\n sets.push(times);\\n\\n this.scope_['times'] = times;\\n ui.apply(this.scope_);\\n }\\n }\",\n \"function TimeManager() {\\n var self = this;\\n\\n this.init = function () {\\n self.initTime = (new Date()).getTime() / 1000;\\n self.offset = 0;\\n self.speed = 1;\\n self.query_params = self.get_query_param();\\n if (self.query_params.hasOwnProperty('time')) {\\n self.offset = parseInt(self.query_params.time);\\n }\\n else if (self.query_params.hasOwnProperty('from')) {\\n self.offset = parseInt(self.query_params.from);\\n }\\n if (self.offset) {\\n self.speed = 20;\\n }\\n\\n if (self.query_params.hasOwnProperty('speed')) {\\n self.speed = parseFloat(self.query_params.speed);\\n }\\n };\\n\\n this.getTime = function() {\\n var realTime = self.getRealTime();\\n if (self.offset) {\\n return self.offset + (realTime - self.initTime) * self.speed;\\n }\\n\\n return realTime;\\n };\\n\\n this.getRealTime = function () {\\n return (new Date()).getTime() / 1000;\\n };\\n\\n // Extracts query params from url.\\n this.get_query_param = function () {\\n var query_string = {};\\n var query = window.location.search.substring(1);\\n var pairs = query.split('&');\\n for (var i = 0; i < pairs.length; i++) {\\n var pair = pairs[i].split('=');\\n\\n // If first entry with this name.\\n if (typeof query_string[pair[0]] === 'undefined') {\\n query_string[pair[0]] = decodeURIComponent(pair[1]);\\n }\\n // If second entry with this name.\\n else if (typeof query_string[pair[0]] === 'string') {\\n query_string[pair[0]] = [\\n query_string[pair[0]],\\n decodeURIComponent(pair[1])\\n ];\\n }\\n // If third or later entry with this name\\n else {\\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\\n }\\n }\\n\\n return query_string;\\n };\\n\\n this.init();\\n\\n return this;\\n}\",\n \"function playInst(inst, startTime, stopTime){\\n\\n var inst = inst;\\n var startTime = startTime;\\n var stopTime = stopTime;\\n\\n inst.startAtTime(globalNow+startTime);\\n inst.stopAtTime(globalNow+stopTime);\\n\\n}\",\n \"constructor() {\\r\\n super();\\r\\n /**\\r\\n * Previous measurement time\\r\\n * @private\\r\\n * @type {number}\\r\\n */\\r\\n this.oldTime_;\\r\\n }\",\n \"getGameTime() {\\n return this.time / 1200;\\n }\",\n \"onChange(e) {\\n if (this.props.onChange) {\\n this.props.onChange(e);\\n }\\n window.$('#' + this.id).timepicker('setTime', e.target.value);\\n }\",\n \"update(scene, time, delta) {\\n // Tick the time (setting the milliseconds will automatically convert up into seconds/minutes/hours)\\n this.time.setMilliseconds(this.time.getMilliseconds() + (delta * this.speed * CONSTANTS.SIMULATION_SPEED_FACTOR));\\n\\n // Update the sky's ambient color\\n this.updateAmbientLightColor();\\n\\n // Check if we can emit an event to the event emitter to notify about the time of day\\n // Only emits once, thats why we have the flags\\n if (this.time.getHours() == 8 && !this.calledMorning) {\\n this.events.emit(\\\"morning\\\");\\n\\n this.calledMorning = true;\\n this.calledNoon = false;\\n this.calledEvening = false;\\n this.calledNight = false;\\n } else if (this.time.getHours() == 12 && !this.calledNoon) {\\n this.events.emit(\\\"noon\\\");\\n\\n this.calledMorning = false;\\n this.calledNoon = true;\\n this.calledEvening = false;\\n this.calledNight = false; \\n } else if (this.time.getHours() == 18 && !this.calledEvening) {\\n this.events.emit(\\\"evening\\\");\\n\\n this.calledMorning = false;\\n this.calledNoon = false;\\n this.calledEvening = true;\\n this.calledNight = false; \\n } else if (this.time.getHours() == 21 && !this.calledNight) {\\n this.events.emit(\\\"night\\\");\\n\\n this.calledMorning = false;\\n this.calledNoon = false;\\n this.calledEvening = false;\\n this.calledNight = true; \\n }\\n }\",\n \"function newRE(name) {\\n\\n // Object holding defaults for various saved fields.\\n var virginData = {\\n type: \\\"pk_rhythm_engine\\\",\\n version: 1,\\n morpher: {x: 36, y: 36},\\n kits: [],\\n voices: [],\\n presets: [],\\n clock: {struc: \\\"simple\\\", sig: 0, bar: 0, beat: 0, pos: 0, tempo_bpm: 90, cycleLength: 16, running: false}\\n };\\n\\n // data will be saved and loaded to localStorage.\\n var data = copy_object(virginData);\\n\\n var clockLastTime_secs = undefined;\\n var lastTickTime_secs = 0;\\n var kDelay_secs = 0.05;\\n var clockJSN = undefined;\\n\\n // Load info about existing kits into the engine.\\n function initData() {\\n var k, ki;\\n for (k in availableKitInfos) {\\n ki = availableKitInfos[k];\\n data.kits.push({\\n name: ki.name,\\n url: ki.url\\n });\\n }\\n }\\n\\n initData();\\n\\n var kitNames = [];\\n\\n // Status of whether the clockTick() should do morphing calculations.\\n var morphEnabled = 0;\\n var morphNeedsUpdate = false;\\n\\n // Clock callbacks.\\n var onGridTick = undefined;\\n var onMorphUpdate = undefined;\\n\\n // Runs at about 60 ticks per second (linked to screen refresh rate).\\n function clockTick() {\\n var clock = data.clock;\\n\\n // Check whether the engine is running.\\n if (!clock.running) {\\n clockLastTime_secs = undefined;\\n return;\\n }\\n\\n var delta_secs = 0, dbeat, dbar;\\n\\n while (true) {\\n if (clockLastTime_secs) {\\n var now_secs = theAudioContext.currentTime;\\n var sqpb = kTimeStruc[clock.struc].semiQuaversPerBar;\\n var ticks_per_sec = clock.tempo_bpm * sqpb / 60;\\n var nextTickTime_secs = lastTickTime_secs + 1 / ticks_per_sec;\\n if (now_secs + kDelay_secs >= nextTickTime_secs) {\\n dbeat = Math.floor(((clock.pos % sqpb) + 1) / sqpb);\\n dbar = Math.floor((clock.beat + dbeat) / kTimeSig.D[clock.sig]);\\n clock.bar = (clock.bar + dbar) % kTimeStruc[clock.struc].cycleLength;\\n clock.beat = (clock.beat + dbeat) % kTimeSig.N[clock.sig];\\n clock.pos = clock.pos + 1;\\n lastTickTime_secs = nextTickTime_secs;\\n } else {\\n return;\\n }\\n } else {\\n // Very first call.\\n clockLastTime_secs = theAudioContext.currentTime;\\n clock.bar = 0;\\n clock.beat = 0;\\n clock.pos = 0;\\n lastTickTime_secs = clockLastTime_secs + kDelay_secs;\\n }\\n\\n // If we're doing a morph, set all the relevant control values.\\n updateMorph();\\n\\n // Perform all the voices for all the active presets.\\n var i, N, v;\\n for (i = 0, N = data.voices.length; i < N; ++i) {\\n v = data.voices[i];\\n if (v) {\\n genBeat(v, clock, lastTickTime_secs);\\n }\\n }\\n\\n // Do the callback if specified.\\n if (onGridTick) {\\n onGridTick(clock);\\n }\\n }\\n }\\n\\n var kVoiceControlsToMorph = [\\n 'straight', 'offbeat', 'funk', 'phase', 'random', \\n 'ramp', 'threshold', 'mean', 'cycleWeight', 'volume', 'pan'\\n ];\\n\\n // Utility to calculate a weighted sum.\\n // \\n // weights is an array of weights. Entries can include 'undefined',\\n // in which case they'll not be included in the weighted sum.\\n //\\n // value_getter is function (i) -> value\\n // result_transform(value) is applied to the weighted sum before \\n // returning the result value.\\n function morphedValue(weights, value_getter, result_transform) {\\n var result = 0, wsum = 0;\\n var i, N, val;\\n for (i = 0, N = weights.length; i < N; ++i) {\\n if (weights[i] !== undefined) {\\n val = value_getter(i);\\n if (val !== undefined) {\\n result += weights[i] * val;\\n wsum += weights[i];\\n }\\n }\\n }\\n return result_transform ? result_transform(result / wsum) : result / wsum;\\n }\\n\\n // Something about the morph status changed.\\n // Update the parameters of all the voices to reflect\\n // the change.\\n function updateMorph() {\\n var i, N;\\n if (morphEnabled && morphNeedsUpdate && data.presets.length > 1) {\\n\\n // Compute morph distances for each preset.\\n var morphWeights = [], dx, dy, ps;\\n for (i = 0, N = data.presets.length; i < N; ++i) {\\n ps = data.presets[i];\\n if (ps && ps.useInMorph) {\\n dx = data.morpher.x - data.presets[i].pos.x;\\n dy = data.morpher.y - data.presets[i].pos.y;\\n morphWeights[i] = 1 / (1 + Math.sqrt(dx * dx + dy * dy));\\n }\\n }\\n\\n // For each voice, compute the morph.\\n var wsum = 0, wnorm = 1, p, pN, w, c, cN, v;\\n\\n // Normalize the morph weights.\\n wsum = morphedValue(morphWeights, function (p) { return 1; });\\n wnorm = 1 / wsum; // WARNING: Divide by zero?\\n\\n // For each voice and for each control in each voice, do the morph.\\n for (i = 0, N = data.voices.length; i < N; ++i) {\\n for (c = 0, cN = kVoiceControlsToMorph.length, v = data.voices[i]; c < cN; ++c) {\\n v[kVoiceControlsToMorph[c]] = morphedValue(morphWeights, function (p) { \\n var ps = data.presets[p];\\n return i < ps.voices.length ? ps.voices[i][kVoiceControlsToMorph[c]] : undefined;\\n });\\n }\\n }\\n\\n // Now morph the tempo. We morph the tempo in the log domain.\\n data.clock.tempo_bpm = morphedValue(morphWeights, function (p) { return Math.log(data.presets[p].clock.tempo_bpm); }, Math.exp);\\n\\n // Morph the cycle length.\\n data.clock.cycleLength = Math.round(morphedValue(morphWeights, function (p) { return data.presets[p].clock.cycleLength; }));\\n \\n if (onMorphUpdate) {\\n setTimeout(onMorphUpdate, 0);\\n }\\n\\n morphNeedsUpdate = false;\\n --morphEnabled;\\n }\\n }\\n\\n // We store info about all the presets as a JSON string in\\n // a single key in localStorage.\\n var storageKey = 'com.nishabdam.PeteKellock.RhythmEngine.' + name + '.data';\\n\\n // Loads the previous engine state saved in localStorage.\\n function load(delegate) {\\n var dataStr = window.localStorage[storageKey];\\n if (dataStr) {\\n loadFromStr(dataStr, delegate);\\n } else {\\n alert(\\\"RhythmEngine: load error\\\");\\n }\\n }\\n\\n // Loads an engine state saved as a string from, possibly, an \\n // external source.\\n function loadFromStr(dataStr, delegate) {\\n try {\\n data = JSON.parse(dataStr);\\n } catch (e) {\\n setTimeout(function () {\\n delegate.onError(\\\"Corrupt rhythm engine snapshot file.\\\");\\n }, 0);\\n return;\\n }\\n\\n var work = {done: 0, total: 0};\\n\\n function reportProgress(changeInDone, changeInTotal, desc) {\\n work.done += changeInDone;\\n work.total += changeInTotal;\\n if (delegate.progress) {\\n delegate.progress(work.done, work.total, desc);\\n }\\n }\\n\\n reportProgress(0, data.kits.length * 10);\\n\\n kitNames = [];\\n\\n data.kits.forEach(function (kitInfo) {\\n SampleManager.loadSampleSet(kitInfo.name, kitInfo.url, {\\n didFetchMappings: function (name, mappings) {\\n reportProgress(0, getKeys(mappings).length * 2);\\n },\\n didLoadSample: function (name, key) {\\n reportProgress(1, 0);\\n },\\n didDecodeSample: function () {\\n reportProgress(1, 0);\\n },\\n didFinishLoadingSampleSet: function (name, sset) {\\n kitNames.push(name);\\n\\n // Save the drum names.\\n kitInfo.drums = getKeys(sset);\\n\\n reportProgress(10, 0);\\n\\n if (kitNames.length === data.kits.length) {\\n // We're done.\\n delegate.didLoad();\\n clockTick();\\n }\\n }\\n });\\n });\\n }\\n\\n // This is for loading the JSON string if the user \\n // gives it by choosing an external file.\\n function loadExternal(fileData, delegate, dontSave) {\\n if (checkSnapshotFileData(fileData, delegate)) {\\n loadFromStr(fileData, {\\n progress: delegate.progress,\\n didLoad: function () {\\n if (!dontSave) {\\n save();\\n }\\n delegate.didLoad();\\n }\\n });\\n }\\n }\\n\\n // A simple check for the starting part of a snapshot file.\\n // This relies on the fact that browser javascript engines\\n // enumerate an object's keys in the same order in which they\\n // were inserted into the object.\\n function checkSnapshotFileData(fileData, delegate) {\\n var valid = (fileData.indexOf('{\\\"type\\\":\\\"pk_rhythm_engine\\\"') === 0);\\n if (!valid) {\\n setTimeout(function () {\\n delegate.onError(\\\"This is not a rhythm engine snapshot file.\\\");\\n }, 0);\\n }\\n return valid;\\n }\\n\\n // Loads settings from file with given name, located in\\n // the \\\"settings\\\" folder.\\n function loadFile(filename, delegate) {\\n if (filename && typeof(filename) === 'string') {\\n fs.root.getDirectory(\\\"settings\\\", {create: true},\\n function (settingsDir) {\\n settingsDir.getFile(filename, {create: false},\\n function (fileEntry) {\\n fileEntry.file(\\n function (f) {\\n var reader = new global.FileReader();\\n\\n reader.onloadend = function () {\\n loadExternal(reader.result, delegate, true);\\n };\\n reader.onerror = delegate && delegate.onError;\\n\\n reader.readAsText(f);\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n } else {\\n load(delegate);\\n }\\n }\\n\\n // Makes an array of strings giving the names of saved\\n // settings and calls delegate.didListSettings(array)\\n // upon success. delegate.onError is called if there is\\n // some error.\\n function listSavedSettings(delegate) {\\n fs.root.getDirectory(\\\"settings\\\", {create: true},\\n function (settingsDir) {\\n var reader = settingsDir.createReader();\\n var result = [];\\n\\n function readEntries() {\\n reader.readEntries(\\n function (entries) {\\n var i, N;\\n\\n if (entries.length === 0) {\\n // We're done.\\n delegate.didListSettings(result.sort());\\n } else {\\n // More to go. Accumulate the names.\\n for (i = 0, N = entries.length; i < N; ++i) {\\n result.push(entries[i].name);\\n }\\n\\n // Continue listing the directory.\\n readEntries();\\n }\\n },\\n delegate && delegate.onError\\n );\\n }\\n\\n readEntries();\\n },\\n delegate && delegate.onError\\n );\\n }\\n\\n // Saves all the presets in local storage.\\n function save(filename, delegate) {\\n var dataAsJSON = JSON.stringify(data);\\n\\n // First save a copy in the locaStorage for worst case scenario.\\n window.localStorage[storageKey] = dataAsJSON;\\n\\n if (filename && typeof(filename) === 'string') {\\n fs.root.getDirectory(\\\"settings\\\", {create: true},\\n function (settingsDir) {\\n settingsDir.getFile(filename, {create: true},\\n function (f) {\\n f.createWriter(\\n function (writer) {\\n writer.onwriteend = delegate && delegate.didSave;\\n writer.onerror = delegate && delegate.onError;\\n\\n var bb = new global.BlobBuilder();\\n bb.append(dataAsJSON);\\n writer.write(bb.getBlob());\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n },\\n delegate && delegate.onError\\n );\\n }\\n }\\n\\n // Make a \\\"voice\\\" object exposing all the live-tweakable\\n // parameters. The API user can just set these parameters\\n // to hear immediate effect in the RE's output.\\n function make_voice(kit, drum) {\\n return {\\n voice: {kit: kit, drum: drum},\\n straight: 0.5,\\n offbeat: 0.0,\\n funk: 0.0,\\n phase: 0,\\n random: 0.0,\\n ramp: 0.2,\\n threshold: 0.5,\\n mean: 0.5,\\n cycleWeight: 0.2,\\n volume: 1.0,\\n pan: 0.0\\n };\\n }\\n\\n function validatePresetIndex(p, extra) {\\n if (p < 0 || p >= data.presets.length + (extra ? extra : 0)) {\\n throw new Error('Invalid preset index!');\\n }\\n }\\n\\n return {\\n kits: data.kits, // Read-only.\\n save: save,\\n snapshot: function () { return JSON.stringify(data); },\\n load: loadFile,\\n list: listSavedSettings,\\n import: loadExternal,\\n\\n // You can set a callback to be received on every grid tick so\\n // that you can do something visual about it. The callback will\\n // receive the current clock status as the sole argument.\\n // The callback is expected to not modify the clock.\\n get onGridTick() { return onGridTick; },\\n set onGridTick(newCallback) { onGridTick = newCallback; },\\n\\n // You can set a callback for notification whenever the bulk\\n // of sliders have been changed due to a morph update.\\n get onMorphUpdate() { return onMorphUpdate; },\\n set onMorphUpdate(newCallback) { onMorphUpdate = newCallback; },\\n\\n // Change the tempo by assigning to tempo_bpm field.\\n get tempo_bpm() {\\n return data.clock.tempo_bpm;\\n },\\n set tempo_bpm(new_tempo_bpm) {\\n data.clock.tempo_bpm = Math.min(Math.max(10, new_tempo_bpm), 480);\\n },\\n\\n // Info about the voices and facility to add more.\\n numVoices: function () { return data.voices.length; },\\n voice: function (i) { return data.voices[i]; },\\n addVoice: function (kit, drum) {\\n var voice = make_voice(kit || 'acoustic-kit', drum || 'kick');\\n data.voices.push(voice);\\n return voice;\\n },\\n\\n // Info about presets and the ability to add/save to presets.\\n numPresets: function () { return data.presets.length; },\\n preset: function (p) { return data.presets[p]; },\\n saveAsPreset: function (p) {\\n validatePresetIndex(p, 1);\\n\\n p = Math.min(data.presets.length, p);\\n\\n // Either make a new preset or change a saved one.\\n // We preserve a preset's morph weight if we're\\n // changing one to a new snapshot.\\n var old = (p < data.presets.length ? data.presets[p] : {pos: {x: 0, y: 0}});\\n data.presets[p] = {\\n useInMorph: old.useInMorph,\\n pos: copy_object(old.pos),\\n clock: copy_object(data.clock),\\n voices: copy_object(data.voices)\\n };\\n },\\n\\n\\n // Morphing functions. The initial state of the morpher is \\\"disabled\\\",\\n // so as long as that is the case, none of the 2D position functions\\n // have any effect. You first need to enable the morpher before\\n // the other calls have any effect.\\n enableMorph: function (flag) {\\n morphEnabled += flag ? 1 : 0;\\n if (flag) {\\n morphNeedsUpdate = true;\\n }\\n },\\n presetPos: function (p) { return data.presets[p].pos; },\\n changePresetPos: function (p, x, y) {\\n validatePresetIndex(p);\\n var pos = data.presets[p].pos;\\n pos.x = x;\\n pos.y = y;\\n morphNeedsUpdate = true;\\n },\\n morpherPos: function () { return data.morpher; },\\n changeMorpherPos: function (x, y) {\\n data.morpher.x = x;\\n data.morpher.y = y;\\n morphNeedsUpdate = true;\\n },\\n\\n // Starting and stopping the engine. Both methods are\\n // idempotent.\\n get running() { return data.clock.running; },\\n start: function () {\\n if (!data.clock.running) {\\n data.clock.running = true;\\n clockLastTime_secs = undefined;\\n clockJSN = theAudioContext.createJavaScriptNode(512, 0, 1);\\n clockJSN.onaudioprocess = function (event) {\\n clockTick();\\n };\\n clockJSN.connect(theAudioContext.destination);\\n }\\n },\\n stop: function () {\\n data.clock.running = false;\\n if (clockJSN) {\\n clockJSN.disconnect();\\n clockJSN = undefined;\\n }\\n }\\n };\\n }\",\n \"function interval(){\\r\\n\\ttry{\\r\\n\\t\\tthis.startTime = function (){\\t\\r\\n\\t\\t\\ttry{\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tvar today=new Date();\\r\\n\\t\\t\\t\\t\\tvar h=today.getHours();\\r\\n\\t\\t\\t\\t\\tvar m=today.getMinutes();\\r\\n\\t\\t\\t\\t\\tvar startm = today.getMinutes();\\r\\n var s=today.getSeconds();\\r\\n\\t\\t\\t\\t\\t// add a zero in front of numbers<10\\r\\n\\t\\t\\t\\t\\tm=this.checkTime(m);\\r\\n\\t\\t\\t\\t\\ts=this.checkTime(s);\\r\\n\\r\\n $('txt').innerHTML= h+\\\":\\\"+m+\\\":\\\"+s;\\r\\n\\t\\t\\t\\t\\t$('clock').value = m;\\t\\t\\r\\n\\t\\t\\t\\t\\tt=setTimeout('intervalObj.startTime()',500);\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.startTime()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t// add a zero in front of numbers<10\\r\\n\\t\\tthis.checkTime = function(i){\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tif (i<10){\\r\\n\\t\\t\\t\\t\\ti=\\\"0\\\" + i;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\treturn i;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.checkTime()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\r\\n\\t\\t//End of clock function\\r\\n\\t\\t//To start the clock on web page.\\r\\n\\t\\t\\r\\n\\t\\tthis.call = function(){\\r\\n\\t\\t\\ttry{\\r\\n\\r\\n\\t\\t\\t\\t$('text').value=$('txt').innerHTML;\\r\\n\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.call()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t//To stop the clock.\\r\\n\\t\\tthis.stopTime = function(){\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\t$('txtTime').value=$('txt').innerHTML;\\r\\n document.getElementById(\\\"txt\\\").style.display = 'none';\\r\\n\\r\\n }catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.stopTime()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t//To calculate the total time difference.\\r\\n\\t\\tthis.calculateTotalTime = function() {\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tvar t1=$('text').value;\\r\\n\\t\\t\\t\\tvar t2=$('txtTime').value;\\r\\n\\t\\t\\t\\tvar arrt1 = t1.split(\\\":\\\");\\r\\n\\t\\t\\t\\tvar arrt2 = t2.split(\\\":\\\");\\t\\t\\r\\n\\t\\t\\t\\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\\r\\n\\t\\t\\t\\tvar timeDifference=this.convertTime(sub);\\t\\t\\r\\n\\t\\t\\treturn timeDifference;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\r\\n this.calculatebatsmanTime = function(t1,t2) {\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\tvar arrt1 = t1.split(\\\":\\\");\\r\\n\\t\\t\\t\\tvar arrt2 = t2.split(\\\":\\\");\\r\\n\\t\\t\\t\\tvar sub=(((arrt2[0]*3600)+(arrt2[1]*60)+(arrt2[2])*1)-((arrt1[0]*3600)+(arrt1[1]*60)+(arrt1[2])*1));\\r\\n\\t\\t\\t\\tvar timeDifference=this.convertTime(sub);\\r\\n\\t\\t\\treturn timeDifference;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.calculateTotalTime()');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n //To Convert time.\\r\\n\\t\\tthis.convertTime = function(sub){\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tvar hrs=parseInt(sub/3600);\\t\\t\\r\\n\\t\\t\\t\\tvar rem=(sub%3600);\\r\\n\\t\\t\\t\\tvar min=parseInt(rem/60);\\r\\n\\t\\t\\t\\tvar sec=(rem%60);\\r\\n\\t\\t\\t\\tmin=this.checkTime(min);\\r\\n\\t\\t\\t\\tsec=this.checkTime(sec);\\r\\n\\t\\t\\t\\tvar convertDifference=(hrs+\\\":\\\"+min+\\\":\\\"+sec);\\r\\n\\t\\t\\treturn convertDifference;\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.convertTime()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\t\\t\\r\\n\\t\\t//To display the time period of interruptions and intervals.\\r\\n\\t\\t\\r\\n\\t\\tthis.DisplayInterval=function(flag){\\r\\n\\t\\r\\n\\t\\t\\tvar MATCH_TIME_ACC=42000;//700min.\\r\\n\\t\\t\\tvar MATCH_INNING_ACC=21000;//350min.\\r\\n\\t\\r\\n\\t\\t\\ttry{\\r\\n\\t\\t\\t\\tif($('text').value==\\\"\\\" && $('txtTime').value==\\\"\\\"){\\r\\n\\t\\t\\t\\t\\talert(\\\"You Did Not Start Timer\\\");\\r\\n\\t\\t\\t\\t}else if(flag==1){\\t\\t\\r\\n\\t\\t\\t\\t\\talert(\\\"Interruption Time is:: \\\"+this.calculateTotalTime());\\r\\n\\t\\t\\t\\t}else if(flag==2){\\t\\r\\n\\t\\t\\t\\t\\t//Interval-Injury\\r\\n\\t\\t\\t\\t\\tvar time=this.calculateTotalTime();\\r\\n\\t\\t\\t\\t\\tvar arrtime = time.split(\\\":\\\");\\r\\n\\t\\t\\t\\t\\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\\r\\n\\t\\t\\t\\t\\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\\r\\n\\t\\t\\t\\t\\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t}else if(flag==3){\\r\\n\\t\\t\\t\\t\\t\\t//Interval-Drink\\r\\n\\t\\t\\t\\t\\t\\tvar time=this.calculateTotalTime();\\r\\n\\t\\t\\t\\t\\t\\tvar arrtime = time.split(\\\":\\\");\\r\\n\\t\\t\\t\\t\\t\\tvar sec=(arrtime[0]*3600)+(arrtime[1]*60)+(arrtime[2]*1);\\r\\n\\t\\t\\t\\t\\t\\tMATCH_TIME_ACC=MATCH_TIME_ACC+sec;//Adding minits in match_time account.\\r\\n\\t\\t\\t\\t\\t\\tvar matchTime=this.convertTime(MATCH_TIME_ACC);\\r\\n\\t\\t\\t\\t\\t\\tMATCH_INNING_ACC=MATCH_INNING_ACC+sec;//Adding minits in match_inning Account\\r\\n\\t\\t\\t\\t\\t\\tvar inningTime=this.convertTime(MATCH_INNING_ACC);\\r\\n\\t\\t\\t\\t}else if(flag==4){\\r\\n\\t\\t\\t\\t\\t\\t//Interval-Lunch/Tea.\\r\\n\\t\\t\\t\\t\\t\\tthis.calculateTotalTime();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval.DisplayInterval()');\\r\\n\\t\\t\\t}\\t\\r\\n\\t\\t}\\t\\r\\n\\t\\t\\r\\n\\t}catch(err){\\r\\n\\t\\t\\t\\talert(err.description,'BCCI.js.interval()');\\r\\n\\t}\\t\\t\\r\\n}\",\n \"function tick() {\\n\\n\\n\\n}\",\n \"set_time( t ){ this.current_time = t; this.draw_fg(); return this; }\"\n]"},"negative_scores":{"kind":"list like","value":["0.60914993","0.5946908","0.575641","0.57523924","0.57523924","0.57110393","0.5612518","0.5518446","0.5502605","0.5496253","0.54666376","0.54654276","0.5452242","0.53977484","0.5385463","0.5348433","0.53089094","0.5291369","0.52643234","0.5233921","0.5232764","0.52305794","0.5220939","0.5216883","0.5214839","0.5207572","0.5198916","0.51798856","0.51566845","0.515222","0.51496196","0.51485324","0.5144256","0.5140738","0.5129704","0.51106876","0.51010126","0.5095933","0.5095795","0.5086692","0.5086692","0.50718004","0.50716335","0.50697833","0.50695676","0.5063659","0.5048897","0.5043801","0.50374174","0.50353235","0.5021129","0.5016889","0.50091654","0.500235","0.4998731","0.49837714","0.49772945","0.49770126","0.49737597","0.49668872","0.49625754","0.4962097","0.4956865","0.49551082","0.49509278","0.49332947","0.49187458","0.49144673","0.49136177","0.4909255","0.4904737","0.48905534","0.4885503","0.48838967","0.48835048","0.48817733","0.48775628","0.48739123","0.4865101","0.48649183","0.48613042","0.48597804","0.48594204","0.48568666","0.48500293","0.48483878","0.48413312","0.4840013","0.483948","0.48315957","0.48286375","0.48266605","0.4820929","0.48142713","0.4811499","0.48099202","0.48085442","0.48068577","0.48040769","0.4797545","0.4796"],"string":"[\n \"0.60914993\",\n \"0.5946908\",\n \"0.575641\",\n \"0.57523924\",\n \"0.57523924\",\n \"0.57110393\",\n \"0.5612518\",\n \"0.5518446\",\n \"0.5502605\",\n \"0.5496253\",\n \"0.54666376\",\n \"0.54654276\",\n \"0.5452242\",\n \"0.53977484\",\n \"0.5385463\",\n \"0.5348433\",\n \"0.53089094\",\n \"0.5291369\",\n \"0.52643234\",\n \"0.5233921\",\n \"0.5232764\",\n \"0.52305794\",\n \"0.5220939\",\n \"0.5216883\",\n \"0.5214839\",\n \"0.5207572\",\n \"0.5198916\",\n \"0.51798856\",\n \"0.51566845\",\n \"0.515222\",\n \"0.51496196\",\n \"0.51485324\",\n \"0.5144256\",\n \"0.5140738\",\n \"0.5129704\",\n \"0.51106876\",\n \"0.51010126\",\n \"0.5095933\",\n \"0.5095795\",\n \"0.5086692\",\n \"0.5086692\",\n \"0.50718004\",\n \"0.50716335\",\n \"0.50697833\",\n \"0.50695676\",\n \"0.5063659\",\n \"0.5048897\",\n \"0.5043801\",\n \"0.50374174\",\n \"0.50353235\",\n \"0.5021129\",\n \"0.5016889\",\n \"0.50091654\",\n \"0.500235\",\n \"0.4998731\",\n \"0.49837714\",\n \"0.49772945\",\n \"0.49770126\",\n \"0.49737597\",\n \"0.49668872\",\n \"0.49625754\",\n \"0.4962097\",\n \"0.4956865\",\n \"0.49551082\",\n \"0.49509278\",\n \"0.49332947\",\n \"0.49187458\",\n \"0.49144673\",\n \"0.49136177\",\n \"0.4909255\",\n \"0.4904737\",\n \"0.48905534\",\n \"0.4885503\",\n \"0.48838967\",\n \"0.48835048\",\n \"0.48817733\",\n \"0.48775628\",\n \"0.48739123\",\n \"0.4865101\",\n \"0.48649183\",\n \"0.48613042\",\n \"0.48597804\",\n \"0.48594204\",\n \"0.48568666\",\n \"0.48500293\",\n \"0.48483878\",\n \"0.48413312\",\n \"0.4840013\",\n \"0.483948\",\n \"0.48315957\",\n \"0.48286375\",\n \"0.48266605\",\n \"0.4820929\",\n \"0.48142713\",\n \"0.4811499\",\n \"0.48099202\",\n \"0.48085442\",\n \"0.48068577\",\n \"0.48040769\",\n \"0.4797545\",\n \"0.4796\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":27,"cells":{"query":{"kind":"string","value":"You can extend webpack config here"},"document":{"kind":"string","value":"extend (config, ctx) {\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":["extend (config, { isDev, isClient }) {\n // if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.plugins.push(\n new webpack.EnvironmentPlugin([\n 'APIKEY',\n 'AUTHDOMAIN',\n 'DATABASEURL',\n 'PROJECTID',\n 'STORAGEBUCKET',\n 'MESSAGINGSENDERID'\n ])\n )\n }","function getBaseWebpackConfig(){\n const config={\n entry:{\n main:['./src/index.js']\n },\n alias:{\n $redux:'../src/redux',\n $service:'../src/service'\n },\n resolve:{\n extensions:['.js','.jsx']\n },\n // entry:['src/index.js'],\n module:{\n rules:[\n {\n test:/\\.(js|jsx)?$/,\n exclude:/node_modules/,\n use:getBabelLoader()\n }\n ]\n },\n plugins:[\n new HtmlWebpackPlugin({\n inject:true,\n // template:index_template,\n template:'./index.html',\n filename:'index.html',\n chunksSortMode:'manual',\n chunks:['app']\n })\n ]\n \n }\n return config;\n}","extend(config, ctx) {\n // config.plugins.push(new HtmlWebpackPlugin({\n // })),\n // config.plugins.push(new SkeletonWebpackPlugin({\n // webpackConfig: {\n // entry: {\n // app: path.join(__dirname, './Skeleton.js'),\n // }\n // },\n // quiet: true\n // }))\n }","webpack(config) {\n config.resolve.alias['@root'] = path.join(__dirname);\n config.resolve.alias['@components'] = path.join(__dirname, 'components');\n config.resolve.alias['@pages'] = path.join(__dirname, 'pages');\n config.resolve.alias['@services'] = path.join(__dirname, 'services');\n return config;\n }","extendWebpack (cfg) {\n cfg.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|quasar)/\n })\n cfg.resolve.alias = {\n ...(cfg.resolve.alias || {}),\n '@components': path.resolve(__dirname, './src/components'),\n '@layouts': path.resolve(__dirname, './src/layouts'),\n '@pages': path.resolve(__dirname, './src/pages'),\n '@utils': path.resolve(__dirname, './src/utils'),\n '@store': path.resolve(__dirname, './src/store'),\n '@config': path.resolve(__dirname, './src/config'),\n '@errors': path.resolve(__dirname, './src/errors'),\n '@api': path.resolve(__dirname, './src/api')\n }\n }","extend(config, {\n isDev,\n isClient,\n isServer\n }) {\n if (!isDev) return\n if (isClient) {\n // 启用source-map\n // config.devtool = 'eval-source-map'\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /node_modules/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n fix: true,\n cache: true\n }\n })\n }\n if (isServer) {\n const nodeExternals = require('webpack-node-externals')\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }","extend (config, { isDev, isClient,isServer }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.devtool = 'eval-source-map'\n }\n // if (isServer) {\n // config.externals = [\n // require('webpack-node-externals')({\n // whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^ai-act-ui/, /^ai-i/]\n // })\n // ]\n // }\n }","extend(config, ctx) {\n config.module.rules.push({ test: /\\.graphql?$/, loader: 'webpack-graphql-loader' })\n config.plugins.push(new webpack.ProvidePlugin({\n mapboxgl: 'mapbox-gl'\n }))\n }","function webpackCommonConfigCreator(options) {\r\n\r\n return {\r\n mode: options.mode, // 开发模式\r\n entry: \"./src/index.js\",\r\n externals: {\r\n \"react\": \"react\",\r\n \"react-dom\": \"react-dom\",\r\n // \"lodash\": \"lodash\",\r\n \"antd\": \"antd\",\r\n \"@fluentui/react\": \"@fluentui/react\",\r\n \"styled-components\": \"styled-components\"\r\n },\r\n output: {\r\n // filename: \"bundle.js\",\r\n // 分配打包后的目录,放于js文件夹下\r\n // filename: \"js/bundle.js\",\r\n // 对输出的 bundle.js 进行优化:分割输出,减小体积\r\n // filename: \"js/[name][hash].js\", // 改在 webpack.prod.js 和 webpack.dev.js 中根据不同环境配置不同的hash值\r\n path: path.resolve(__dirname, \"../build\"),\r\n publicPath: \"/\"\r\n },\r\n // 对输出的 bundle.js 进行优化:分割输出,减小体积\r\n optimization: {\r\n splitChunks: {\r\n chunks: \"all\",\r\n minSize: 50000,\r\n minChunks: 1,\r\n }\r\n },\r\n plugins: [\r\n // new HtmlWebpackPlugin(),\r\n new HtmlWebpackPlugin({\r\n template: path.resolve(__dirname, \"../public/index.html\"),\r\n // filename: \"./../html/index.html\", //编译后生成新的html文件路径\r\n // thunks: ['vendor', 'index'], // 需要引入的入口文件\r\n // excludeChunks: ['login'], // 不需要引入的入口文件\r\n favicon: path.resolve(__dirname, \"../src/assets/images/favicon.ico\") //favicon.ico文件路径\r\n }),\r\n new CleanWebpackPlugin({\r\n cleanOnceBeforeBuildPatterns: [path.resolve(process.cwd(), \"build/\"), path.resolve(process.cwd(), \"dist/\")]\r\n }),\r\n new ExtractTextPlugin({\r\n // filename: \"[name][hash].css\"\r\n // 分配打包后的目录,放于css文件夹下\r\n filename: \"css/[name][hash].css\"\r\n }),\r\n ],\r\n module: {\r\n rules: [\r\n {\r\n test: /\\.(js|jsx)$/,\r\n // include: path.resolve(__dirname, \"../src\"),\r\n // 用排除的方式,除了 /node_modules/ 都让 babel-loader 进行解析,这样一来就能解析引用的别的package中的组件了\r\n // exclude: /node_modules/,\r\n use: [\r\n {\r\n loader: \"babel-loader\",\r\n options: {\r\n presets: ['@babel/preset-react'],\r\n plugins: [\"react-hot-loader/babel\"]\r\n }\r\n }\r\n ]\r\n },\r\n // {\r\n // test: /\\.html$/,\r\n // use: [\r\n // {\r\n // loader: 'html-loader'\r\n // }\r\n // ]\r\n // },\r\n // {\r\n // test: /\\.css$/,\r\n // use: [MiniCssExtractPlugin.loader, 'css-loader']\r\n // },\r\n {\r\n // test: /\\.css$/,\r\n test: /\\.(css|scss)$/,\r\n // test: /\\.scss$/,\r\n // include: path.resolve(__dirname, '../src'),\r\n exclude: /node_modules/,\r\n // 进一步优化 配置css-module模式(样式模块化),将自动生成的样式抽离到单独的文件中\r\n use: ExtractTextPlugin.extract({\r\n fallback: \"style-loader\",\r\n use: [\r\n {\r\n loader: \"css-loader\",\r\n options: {\r\n modules: {\r\n mode: \"local\",\r\n localIdentName: '[path][name]_[local]--[hash:base64:5]'\r\n },\r\n localsConvention: 'camelCase'\r\n }\r\n },\r\n \"sass-loader\",\r\n // 使用postcss对css3属性添加前缀\r\n {\r\n loader: \"postcss-loader\",\r\n options: {\r\n ident: 'postcss',\r\n plugins: loader => [\r\n require('postcss-import')({ root: loader.resourcePath }),\r\n require('autoprefixer')()\r\n ]\r\n }\r\n }\r\n ]\r\n })\r\n },\r\n {\r\n test: /\\.less$/,\r\n use: [\r\n { loader: 'style-loader' },\r\n { loader: 'css-loader' },\r\n {\r\n loader: 'less-loader',\r\n options: {\r\n // modifyVars: {\r\n // 'primary-color': '#263961',\r\n // 'link-color': '#263961'\r\n // },\r\n javascriptEnabled: true\r\n }\r\n }\r\n ]\r\n },\r\n // 为第三方包配置css解析,将样式表直接导出\r\n {\r\n test: /\\.(css|scss|less)$/,\r\n exclude: path.resolve(__dirname, '../src'),\r\n use: [\r\n \"style-loader\",\r\n \"css-loader\",\r\n \"sass-loader\",\r\n \"less-loader\"\r\n // {\r\n // loader: 'file-loader',\r\n // options: {\r\n // name: \"css/[name].css\"\r\n // }\r\n // }\r\n ]\r\n },\r\n // 字体加载器 (前提:yarn add file-loader -D)\r\n {\r\n test: /\\.(woff|woff2|eot|ttf|otf)$/,\r\n use: ['file-loader']\r\n },\r\n // 图片加载器 (前提:yarn add url-loader -D)\r\n {\r\n test: /\\.(jpg|png|svg|gif)$/,\r\n use: [\r\n {\r\n loader: 'url-loader',\r\n options: {\r\n limit: 10240,\r\n // name: '[hash].[ext]',\r\n // 分配打包后的目录,放于images文件夹下\r\n name: 'images/[hash].[ext]',\r\n publicPath: \"/\"\r\n }\r\n },\r\n ]\r\n },\r\n ]\r\n },\r\n // 后缀自动补全\r\n resolve: {\r\n // symlinks: false,\r\n extensions: ['.js', '.jsx', '.png', '.svg'],\r\n alias: {\r\n src: path.resolve(__dirname, '../src'),\r\n components: path.resolve(__dirname, '../src/components'),\r\n routes: path.resolve(__dirname, '../src/routes'),\r\n utils: path.resolve(__dirname, '../src/utils'),\r\n api: path.resolve(__dirname, '../src/api')\r\n }\r\n }\r\n }\r\n}","extend(config, { isDev, isClient }) {\n\n // Resolve vue2-google-maps issues (server-side)\n // - an alternative way to solve the issue\n // -----------------------------------------------------------------------\n // config.module.rules.splice(0, 0, {\n // test: /\\.js$/,\n // include: [path.resolve(__dirname, './node_modules/vue2-google-maps')],\n // loader: 'babel-loader',\n // })\n }","extend (config, ctx) {\n config.devtool = ctx.isClient ? \"eval-source-map\" : \"inline-source-map\";\n\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: \"pre\",\n // test: /\\.(js|vue)$/,\n // loader: \"eslint-loader\",\n // exclude: /(node_modules)/,\n // });\n // }\n }","extend (config, { isDev, isClient }) {\n config.resolve.alias['fetch'] = path.join(__dirname, 'utils/fetch.js')\n config.resolve.alias['api'] = path.join(__dirname, 'api')\n config.resolve.alias['layouts'] = path.join(__dirname, 'layouts')\n config.resolve.alias['components'] = path.join(__dirname, 'components')\n config.resolve.alias['utils'] = path.join(__dirname, 'utils')\n config.resolve.alias['static'] = path.join(__dirname, 'static')\n config.resolve.alias['directive'] = path.join(__dirname, 'directive')\n config.resolve.alias['filters'] = path.join(__dirname, 'filters')\n config.resolve.alias['styles'] = path.join(__dirname, 'assets/styles')\n config.resolve.alias['element'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['@element-ui'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['e-ui'] = path.join(__dirname, 'node_modules/h666888')\n config.resolve.alias['@e-ui'] = path.join(__dirname, 'plugins/e-ui')\n config.resolve.alias['areaJSON'] = path.join(__dirname, 'static/area.json')\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\n config.plugins.push(\n new BundleAnalyzerPlugin({\n openAnalyzer: true\n })\n )\n */\n /**\n *全局引入scss文件\n */\n const sassResourcesLoader = {\n loader: 'sass-resources-loader',\n options: {\n resources: [\n 'assets/styles/var.scss'\n ]\n }\n }\n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \n config.module.rules.forEach((rule) => {\n if (rule.test.toString() === '/\\\\.vue$/') {\n rule.options.loaders.sass.push(sassResourcesLoader)\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (['/\\\\.sass$/', '/\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n })\n }\n // https://github.com/vuejs/vuepress/blob/14d4d2581f4b7c71ea71a41a1849f582090edb97/lib/webpack/createBaseConfig.js#L92\n config.module.rules.push({\n test: /\\.md$/,\n use: [\n {\n loader: \"vue-loader\",\n options: {\n compilerOptions: {\n preserveWhitespace: false\n }\n }\n },\n {\n loader: require.resolve(\"vuepress/lib/webpack/markdownLoader\"),\n options: {\n sourceDir: \"./blog\",\n markdown: createMarkdown()\n }\n }\n ]\n })\n // fake the temp folder used in vuepress\n config.resolve.alias[\"@temp\"] = path.resolve(__dirname, \"temp\")\n config.plugins.push(\n new webpack.DefinePlugin({\n \"process.GIT_HEAD\": JSON.stringify(GIT_HEAD)\n })\n )\n config.plugins.push(\n new webpack.LoaderOptionsPlugin({\n options: {\n stylus: {\n use: [poststylus([\"autoprefixer\", \"rucksack-css\"])]\n }\n }\n })\n )\n }","extend (config, { isDev, isClient }) {\n\t\t\tif (isDev && isClient) {\n\t\t\t\tconfig.module.rules.push({\n\t\t\t\t\tenforce: 'pre',\n\t\t\t\t\ttest: /\\.(js|vue)$/,\n\t\t\t\t\tloader: 'eslint-loader',\n\t\t\t\t\texclude: /(node_modules)/\n\t\t\t\t})\n\t\t\t}\n\t\t\tif(!isDev && isClient){\n\t\t\t\tconfig.externals = {\n\t\t\t\t\t\"vue\": \"Vue\",\n\t\t\t\t\t\"axios\" : \"axios\",\n\t\t\t\t\t\"vue-router\" : \"VueRouter\"\n\t\t\t\t},\n\t\t\t\tconfig.output.library = 'LingTal',\n\t\t\t\tconfig.output.libraryTarget = 'umd',\n\t\t\t\tconfig.output.umdNamedDefine = true\n\t\t\t\t//config.output.chunkFilename = _assetsRoot+'js/[chunkhash:20].js'\n\t\t\t}\n\t\t}","prepareWebpackConfig () {\n // resolve webpack config\n let config = createClientConfig(this.context)\n\n config\n .plugin('html')\n // using a fork of html-webpack-plugin to avoid it requiring webpack\n // internals from an incompatible version.\n .use(require('vuepress-html-webpack-plugin'), [{\n template: this.context.devTemplate\n }])\n\n config\n .plugin('site-data')\n .use(HeadPlugin, [{\n tags: this.context.siteConfig.head || []\n }])\n\n config\n .plugin('vuepress-log')\n .use(DevLogPlugin, [{\n port: this.port,\n displayHost: this.displayHost,\n publicPath: this.context.base,\n clearScreen: !(this.context.options.debug || !this.context.options.clearScreen)\n }])\n\n config = config.toConfig()\n const userConfig = this.context.siteConfig.configureWebpack\n if (userConfig) {\n config = applyUserWebpackConfig(userConfig, config, false /* isServer */)\n }\n this.webpackConfig = config\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // muse设置\n config.resolve.alias['muse-components'] = 'muse-ui/src'\n config.resolve.alias['vue$'] = 'vue/dist/vue.esm.js'\n config.module.rules.push({\n test: /muse-ui.src.*?js$/,\n loader: 'babel-loader'\n })\n }","extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n // config.module.rules.push({\n // test: /\\.postcss$/,\n // use: [\n // 'vue-style-loader',\n // 'css-loader',\n // {\n // loader: 'postcss-loader'\n // }\n // ]\n // })\n }\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n },\n {\n test: /\\.ico$/,\n loader: 'uri-loader',\n exclude: /(node_modules)/\n }\n )\n console.log(config.output.publicPath, 'config.output.publicPath')\n // config.output.publicPath = ''\n }\n }","extend(config) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n config.node = {\n console: true,\n fs: 'empty',\n net: 'empty',\n tls: 'empty'\n }\n }\n\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }","webpack(config, env) {\n\n // Drop noisy eslint pre-rule\n config.module.rules.splice(1, 1);\n\n // Drop noisy tslint plugin\n const EXCLUDED_PLUGINS = ['ForkTsCheckerWebpackPlugin'];\n config.plugins = config.plugins.filter(plugin => !EXCLUDED_PLUGINS.includes(plugin.constructor.name));\n // config.plugins.push(\n // [\"prismjs\", {\n // \"languages\": [\"go\", \"java\", \"javascript\", \"css\", \"html\"],\n // \"plugins\": [\"line-numbers\", \"show-language\"],\n // \"theme\": \"okaidia\",\n // \"css\": true\n // }]\n // )\n return config;\n }","extend(config, { isClient, isDev }) {\n // Run ESLint on save\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue|ts)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n\n // stylelint\n config.plugins.push(\n new StylelintPlugin({\n files: ['**/*.vue'],\n }),\n )\n\n config.devtool = '#source-map'\n }\n\n // glsl\n config.module.rules.push({\n test: /\\.(glsl|vs|fs)$/,\n use: ['raw-loader', 'glslify-loader'],\n exclude: /(node_modules)/,\n })\n\n config.module.rules.push({\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n loader: 'file-loader',\n options: {\n name: '[path][name].[ext]',\n },\n })\n\n config.output.globalObject = 'this'\n\n config.module.rules.unshift({\n test: /\\.worker\\.ts$/,\n loader: 'worker-loader',\n })\n config.module.rules.unshift({\n test: /\\.worker\\.js$/,\n loader: 'worker-loader',\n })\n\n // import alias\n config.resolve.alias.Sass = path.resolve(__dirname, './assets/sass/')\n config.resolve.alias.Js = path.resolve(__dirname, './assets/js/')\n config.resolve.alias.Images = path.resolve(__dirname, './assets/images/')\n config.resolve.alias['~'] = path.resolve(__dirname)\n config.resolve.alias['@'] = path.resolve(__dirname)\n }","extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src'\n }\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.node = {\n fs: 'empty'\n }\n // Add markdown loader\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader'\n })\n }","extend(config, ctx) {\n const vueLoader = config.module.rules.find((loader) => loader.loader === 'vue-loader')\n vueLoader.options.transformToRequire = {\n 'vue-h-zoom': ['image', 'image-full']\n }\n }","extend (config, ctx) {\n config.resolve.alias['class-component'] = '~plugins/class-component'\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\n })\n ]\n }\n }","extend (config, { isDev, isClient }) {\n if (isClient && isDev) {\n config.optimization.splitChunks.maxSize = 51200\n }\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.resolve.alias.vue = process.env.NODE_ENV === 'production' ? 'vue/dist/vue.min' : 'vue/dist/vue.js'\n }","extend(config) {\n config.devtool = process.env.NODE_ENV === 'dev' ? 'eval-source-map' : ''\n }","extend(config, ctx) {\n // Added Line\n config.devtool = ctx.isClient ? \"eval-source-map\" : \"inline-source-map\";\n\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n\n }","extend(config, { isDev }) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }","extend (config, ctx) {\n config.output.publicPath = 'http://0.0.0.0:3000/';\n //config.output.crossOriginLoading = 'anonymous'\n /* const devServer = {\n public: 'http://0.0.0.0:3000',\n port: 3000,\n host: '0.0.0.0',\n hotOnly: true,\n https: false,\n watchOptions: {\n poll: 1000,\n },\n headers: {\n \"Access-Control-Allow-Origin\": \"\\*\",\n }\n };\n config.devServer = devServer; */\n }","extend(config, ctx) {\n config.devtool = \"source-map\";\n\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n fix: true,\n },\n });\n }\n\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.txt$/,\n loader: \"raw-loader\",\n exclude: /(node_modules)/,\n });\n }","extend(config, ctx) {\n ctx.loaders.less.javascriptEnabled = true\n config.resolve.alias.vue = 'vue/dist/vue.common'\n }","extend(config, { isDev }) {\n if (isDev) config.devtool = '#source-map';\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }","extend(config, { isDev }) {\n if (isDev) {\n config.devtool = 'source-map';\n }\n }","extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }","extend(config, ctx) {\n if (ctx.isClient) {\n // 配置别名\n config.resolve.alias['@'] = path.resolve(__dirname, './');\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }","extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n ** For including scss variables file\n */\n config.module.rules.forEach((rule) => {\n if (isVueRule(rule)) {\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (isSASSRule(rule)) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.plugins.push(\n new StylelintPlugin({\n files: ['**/*.vue', '**/*.scss']\n })\n )\n }\n config.module.rules.push({\n test: /\\.webp$/,\n loader: 'url-loader',\n options: {\n limit: 1000,\n name: 'img/[name].[hash:7].[ext]'\n }\n })\n }","extend (config, {isDev, isClient, isServer}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\n })\n ]\n }\n }","extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.devtool = '#source-map' // 添加此行代码\n }\n }","extend (config, { isDev }) {\n if (isDev && process.client) {\n\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.pug$/,\n resourceQuery: /^\\?vue/,\n loader: 'pug-plain-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.styl/,\n resourceQuery: /^\\?vue/,\n loader: 'pug-plain-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.filter(r => r.test.toString().includes('svg')).forEach(r => { r.test = /\\.(png|jpe?g|gif)$/ });\n\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'vue-svg-loader',\n });\n\n [].concat(...config.module.rules\n .find(e => e.test.toString().match(/\\.styl/)).oneOf\n .map(e => e.use.filter(e => e.loader === 'stylus-loader'))).forEach(stylus => {\n Object.assign(stylus.options, {\n import: [\n '~assets/styles/colors.styl',\n '~assets/styles/variables.styl',\n ]\n })\n });\n }","extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push(...[{\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },{\n test: /\\.(gif|png|jpe?g|svg)$/i,\n use: [\n 'file-loader',\n {\n loader: 'image-webpack-loader',\n options: {\n bypassOnDebug: true,\n mozjpeg: {\n progressive: true,\n quality: 65\n },\n // optipng.enabled: false will disable optipng\n optipng: {\n enabled: true,\n },\n pngquant: {\n quality: '65-90',\n speed: 4\n },\n gifsicle: {\n interlaced: false,\n },\n // the webp option will enable WEBP\n webp: {\n quality: 75\n }\n },\n },\n ],\n }])\n }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n }\n }","extend(config, ctx) {\n config.module.rules.forEach((r) => {\n if(r.test.toString() === `/\\.(png|jpe?g|gif|svg|webp)$/i`) {\n r.use = [\n {\n loader: \"url-loader\",\n options: {\n limit: 1000,\n name: 'img/[name].[hash:7].[ext]'\n }\n },\n {\n loader: 'image-webpack-loader',\n }\n ]\n delete r.loader;\n delete r.options;\n }\n })\n config.module.rules.push(\n {\n test: /\\.ya?ml$/,\n type: 'json',\n use: 'yaml-loader'\n }\n )\n }","extend(config, { isDev }) {\r\n if (isDev && process.client) {\r\n config.module.rules.push({\r\n enforce: 'pre',\r\n test: /\\.(js|vue)$/,\r\n loader: 'eslint-loader',\r\n exclude: /(node_modules)/,\r\n })\r\n\r\n const vueLoader = config.module.rules.find(\r\n ({ loader }) => loader === 'vue-loader',\r\n )\r\n const { options: { loaders } } = vueLoader || { options: {} }\r\n\r\n if (loaders) {\r\n for (const loader of Object.values(loaders)) {\r\n changeLoaderOptions(Array.isArray(loader) ? loader : [loader])\r\n }\r\n }\r\n\r\n config.module.rules.forEach(rule => changeLoaderOptions(rule.use))\r\n }\r\n }","extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // vue-loader\n const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\n vueLoader.options.loaders.less = 'vue-style-loader!css-loader!less-loader'\n }","function webpackConfigDev(options = {}) {\n // get the common configuration to start with\n const config = init(options);\n\n // // make \"dev\" specific changes here\n // const credentials = require(\"./credentials.json\");\n // credentials.branch = \"dev\";\n //\n // config.plugin(\"screeps\")\n // .use(ScreepsWebpackPlugin, [credentials]);\n\n // modify the args of \"define\" plugin\n config.plugin(\"define\").tap((args) => {\n args[0].PRODUCTION = JSON.stringify(false);\n return args;\n });\n\n return config;\n}","extend(config, ctx) {\n // Use vuetify loader\n const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\n const options = vueLoader.options || {}\n const compilerOptions = options.compilerOptions || {}\n const cm = compilerOptions.modules || []\n cm.push(VuetifyProgressiveModule)\n\n config.module.rules.push({\n test: /\\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)(\\?.*)?$/,\n oneOf: [\n {\n test: /\\.(png|jpe?g|gif)$/,\n resourceQuery: /lazy\\?vuetify-preload/,\n use: [\n 'vuetify-loader/progressive-loader',\n {\n loader: 'url-loader',\n options: { limit: 8000 }\n }\n ]\n },\n {\n loader: 'url-loader',\n options: { limit: 8000 }\n }\n ]\n })\n\n if (ctx.isDev) {\n // Run ESLint on save\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ];\n } else {\n config.plugins.push(new NetlifyServerPushPlugin({\n headersFile: '_headers'\n }));\n }\n }","extend (config) {\n config.module.rules.push({\n test: /\\.s(c|a)ss$/,\n use: [\n {\n loader: 'sass-loader',\n options: {\n includePaths: [\n 'node_modules/breakpoint-sass/stylesheets',\n 'node_modules/susy/sass',\n 'node_modules/gent_styleguide/build/styleguide'\n ]\n }\n }\n ]\n })\n }","extend (config, ctx) {\n // if (ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }","extend(config, ctx) {\n // NuxtJS debugging support\n // eval-source-map: a SourceMap that matchers exactly to the line number and this help to debug the NuxtJS app in the client\n // inline-source-map: help to debug the NuxtJS app in the server\n config.devtool = ctx.isClient ? 'eval-source-map' : 'inline-source-map'\n }","extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }","extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n \n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'svg-inline-loader',\n exclude: /node_modules/\n })\n \n }\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.(png|jpe?g|gif|svg|webp|ico)$/,\n loader: 'url-loader',\n query: {\n limit: 1000 // 1kB\n }\n }\n )\n }\n\n for (const ruleList of Object.values(config.module.rules || {})) {\n for (const rule of Object.values(ruleList.oneOf || {})) {\n for (const loader of rule.use) {\n const loaderModifier = loaderModifiers[loader.loader]\n if (loaderModifier) {\n loaderModifier(loader)\n }\n }\n }\n }\n }","extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n formatter: require('eslint-friendly-formatter'),\n fix: true\n }\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/, /^vue-resource/]\n })\n ]\n }\n }","extend(config, ctx) {\n // Run ESLint on saves\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n // {\n // test: /\\.(jpg)$/,\n // loader: 'file-loader'\n // },\n {\n test: /\\.jpeg$/, // jpeg의 모든 파일\n loader: 'file-loader', // 파일 로더를 적용한다.\n options: {\n // publicPath: './', // prefix를 아웃풋 경로로 지정\n name: '[name].[ext]?[hash]' // 파일명 형식\n }\n }\n )\n }\n }","extend (config, ctx) {\n // transpile: [/^vue2-google-maps($|\\/)/]\n /*\n if (!ctx.isClient) {\n // This instructs Webpack to include `vue2-google-maps`'s Vue files\n // for server-side rendering\n config.externals = [\n function(context, request, callback){\n if (/^vue2-google-maps($|\\/)/.test(request)) {\n callback(null, false)\n } else {\n callback()\n }\n }\n ]\n }\n */\n }","extend(configuration, { isDev, isClient }) {\n configuration.resolve.alias.vue = 'vue/dist/vue.common'\n\n configuration.node = {\n fs: 'empty',\n }\n\n configuration.module.rules.push({\n test: /\\.worker\\.js$/,\n use: { loader: 'worker-loader' },\n })\n\n if (isDev && isClient) {\n configuration.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n }","extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }","extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n\n config.module.rules\n .find((rule) => rule.loader === 'vue-loader')\n .options.loaders.scss\n .push({\n loader: 'sass-resources-loader',\n options: {\n resources: [\n path.join(__dirname, 'app', 'assets', 'scss', '_variables.scss'),\n path.join(__dirname, 'app', 'assets', 'scss', '_mixins.scss'),\n ],\n },\n })\n }","extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n\n const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));\n svgRule.test = /\\.(png|jpe?g|gif|webp)$/;\n\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'vue-svg-loader',\n });\n\n config.module.rules.push({\n test: /\\.(png|gif)$/,\n loader: 'url-loader',\n query: {\n limit: 1000,\n name: 'img/[name].[hash:7].[ext]'\n }\n });\n }","extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.devtool = false\n }","extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === \"vue-loader\"\n );\n vueLoader.options.transformToRequire = {\n img: \"src\",\n image: \"xlink:href\",\n \"b-img\": \"src\",\n \"b-img-lazy\": [\"src\", \"blank-src\"],\n \"b-card\": \"img-src\",\n \"b-card-img\": \"img-src\",\n \"b-carousel-slide\": \"img-src\",\n \"b-embed\": \"src\"\n };\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules\n .filter(r => r.test.toString().includes('svg'))\n .forEach(r => {\n r.test = /\\.(png|jpe?g|gif)$/\n })\n // urlLoader.test = /\\.(png|jpe?g|gif)$/\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'svg-inline-loader',\n exclude: /node_modules/\n })\n }","extend (config, { isDev, isClient }) {\n /*\n // questo linta ogni cosa ad ogni salvataggio\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }*/\n }","extend(config, ctx) {\n // Run ESLint on save\n config.module.rules.push({\n test: /\\.graphql?$/,\n exclude: /node_modules/,\n loader: 'webpack-graphql-loader',\n });\n }","extend(config, {\n isDev,\n isClient\n }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.push({\n test: /\\.yaml$/,\n loader: 'js-yaml-loader'\n })\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader',\n include: path.resolve(__dirname, 'articles'),\n options: {\n markdown: body => {\n return md.render(body)\n }\n }\n })\n }","extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: \"pre\",\n // test: /\\.(js|vue)$/,\n // loader: \"eslint-loader\",\n // exclude: /(node_modules)/\n // })\n // }\n config.module.rules.push({\n test: /\\.md$/,\n use: [\n {\n loader: \"html-loader\"\n },\n {\n loader: \"markdown-loader\",\n options: {\n /* your options here */\n }\n }\n ]\n })\n }","extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n \n }","function createCommonWebpackConfig({\n isDebug = true,\n isHmr = false,\n withLocalSourceMaps,\n isModernBuild = false,\n} = {}) {\n const STATICS_DIR_MODERN = path.join(BUILD_DIR, 'statics-modern');\n const config = {\n context: SRC_DIR,\n\n mode: isProduction ? 'production' : 'development',\n\n output: {\n path: isModernBuild ? STATICS_DIR_MODERN : STATICS_DIR,\n publicPath,\n pathinfo: isDebug,\n filename: isDebug\n ? addHashToAssetName('[name].bundle.js')\n : addHashToAssetName('[name].bundle.min.js'),\n chunkFilename: isDebug\n ? addHashToAssetName('[name].chunk.js')\n : addHashToAssetName('[name].chunk.min.js'),\n hotUpdateMainFilename: 'updates/[hash].hot-update.json',\n hotUpdateChunkFilename: 'updates/[id].[hash].hot-update.js',\n },\n\n resolve: {\n modules: ['node_modules', SRC_DIR],\n\n extensions,\n\n alias: project.resolveAlias,\n\n // Whether to resolve symlinks to their symlinked location.\n symlinks: false,\n },\n\n // Since Yoshi doesn't depend on every loader it uses directly, we first look\n // for loaders in Yoshi's `node_modules` and then look at the root `node_modules`\n //\n // See https://github.com/wix/yoshi/pull/392\n resolveLoader: {\n modules: [path.join(__dirname, '../node_modules'), 'node_modules'],\n },\n\n plugins: [\n // This gives some necessary context to module not found errors, such as\n // the requesting resource\n new ModuleNotFoundPlugin(ROOT_DIR),\n // https://github.com/Urthen/case-sensitive-paths-webpack-plugin\n new CaseSensitivePathsPlugin(),\n // Way of communicating to `babel-preset-yoshi` or `babel-preset-wix` that\n // it should optimize for Webpack\n new EnvirnmentMarkPlugin(),\n // https://github.com/Realytics/fork-ts-checker-webpack-plugin\n ...(isTypescriptProject && project.projectType === 'app' && isDebug\n ? [\n // Since `fork-ts-checker-webpack-plugin` requires you to have\n // TypeScript installed when its required, we only require it if\n // this is a TypeScript project\n new (require('fork-ts-checker-webpack-plugin'))({\n tsconfig: TSCONFIG_FILE,\n async: false,\n silent: true,\n checkSyntacticErrors: true,\n formatter: typescriptFormatter,\n }),\n ]\n : []),\n ...(isHmr ? [new webpack.HotModuleReplacementPlugin()] : []),\n ],\n\n module: {\n // Makes missing exports an error instead of warning\n strictExportPresence: true,\n\n rules: [\n // https://github.com/wix/externalize-relative-module-loader\n ...(project.features.externalizeRelativeLodash\n ? [\n {\n test: /[\\\\/]node_modules[\\\\/]lodash/,\n loader: 'externalize-relative-module-loader',\n },\n ]\n : []),\n\n // https://github.com/huston007/ng-annotate-loader\n ...(project.isAngularProject\n ? [\n {\n test: reScript,\n loader: 'yoshi-angular-dependencies/ng-annotate-loader',\n include: project.unprocessedModules,\n },\n ]\n : []),\n\n // Rules for TS / TSX\n {\n test: /\\.(ts|tsx)$/,\n include: project.unprocessedModules,\n use: [\n {\n loader: 'thread-loader',\n options: {\n workers: require('os').cpus().length - 1,\n },\n },\n\n // https://github.com/huston007/ng-annotate-loader\n ...(project.isAngularProject\n ? [{ loader: 'yoshi-angular-dependencies/ng-annotate-loader' }]\n : []),\n\n {\n loader: 'ts-loader',\n options: {\n // This implicitly sets `transpileOnly` to `true`\n ...(isModernBuild ? {configFile: 'tsconfig-modern.json'} : {}),\n happyPackMode: true,\n compilerOptions: project.isAngularProject\n ? {}\n : {\n // force es modules for tree shaking\n module: 'esnext',\n // use same module resolution\n moduleResolution: 'node',\n // optimize target to latest chrome for local development\n ...(isDevelopment\n ? {\n // allow using Promises, Array.prototype.includes, String.prototype.padStart, etc.\n lib: ['es2017'],\n // use async/await instead of embedding polyfills\n target: 'es2017',\n }\n : {}),\n },\n },\n },\n ],\n },\n\n // Rules for JS\n {\n test: reScript,\n include: project.unprocessedModules,\n use: [\n {\n loader: 'thread-loader',\n options: {\n workers: require('os').cpus().length - 1,\n },\n },\n {\n loader: 'babel-loader',\n options: {\n ...babelConfig,\n },\n },\n ],\n },\n\n // Rules for assets\n {\n oneOf: [\n // Inline SVG images into CSS\n {\n test: /\\.inline\\.svg$/,\n loader: 'svg-inline-loader',\n },\n\n // Allows you to use two kinds of imports for SVG:\n // import logoUrl from './logo.svg'; gives you the URL.\n // import { ReactComponent as Logo } from './logo.svg'; gives you a component.\n {\n test: /\\.svg$/,\n issuer: {\n test: /\\.(j|t)sx?$/,\n },\n use: [\n '@svgr/webpack',\n {\n loader: 'svg-url-loader',\n options: {\n iesafe: true,\n noquotes: true,\n limit: 10000,\n name: staticAssetName,\n },\n },\n ],\n },\n {\n test: /\\.svg$/,\n use: [\n {\n loader: 'svg-url-loader',\n options: {\n iesafe: true,\n limit: 10000,\n name: staticAssetName,\n },\n },\n ],\n },\n\n // Rules for Markdown\n {\n test: /\\.md$/,\n loader: 'raw-loader',\n },\n\n // Rules for HAML\n {\n test: /\\.haml$/,\n loader: 'ruby-haml-loader',\n },\n\n // Rules for HTML\n {\n test: /\\.html$/,\n loader: 'html-loader',\n },\n\n // Rules for GraphQL\n {\n test: /\\.(graphql|gql)$/,\n loader: 'graphql-tag/loader',\n },\n\n // Try to inline assets as base64 or return a public URL to it if it passes\n // the 10kb limit\n {\n test: reAssets,\n loader: 'url-loader',\n options: {\n name: staticAssetName,\n limit: 10000,\n },\n },\n ],\n },\n ],\n },\n\n // https://webpack.js.org/configuration/stats/\n stats: 'none',\n\n // https://github.com/webpack/node-libs-browser/tree/master/mock\n node: {\n fs: 'empty',\n net: 'empty',\n tls: 'empty',\n __dirname: true,\n },\n\n // https://webpack.js.org/configuration/devtool\n // If we are in CI or requested explictly we create full source maps\n // Once we are in a local build, we create cheap eval source map only\n // for a development build (hence the !isProduction)\n devtool:\n inTeamCity || withLocalSourceMaps\n ? 'source-map'\n : !isProduction\n ? 'cheap-module-eval-source-map'\n : false,\n };\n\n return config;\n}","extend(config, ctx) {\n config.module.rules.push(\n {\n test: /\\.html$/,\n loader: 'raw-loader'\n }\n )\n }","extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === 'sass-loader') {\n use.options = use.options || {};\n use.options.includePaths = ['node_modules/foundation-sites/scss', 'node_modules/motion-ui/src'];\n }\n }\n }\n }\n }","extend(config, ctx) {\n config.module.rules.push({\n test: /\\.(graphql|gql)$/,\n exclude: /node_modules/,\n loader: 'graphql-tag/loader'\n })\n }","extend(config,ctx){ \n const sassResourcesLoader = { \n loader: 'sass-resources-loader', \n options: { \n resources: [ \n 'assets/scss/style.scss' \n ] \n } \n } \n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \n config.module.rules.forEach((rule) => { \n if (rule.test.toString() === '/\\\\.vue$/') { \n rule.options.loaders.sass.push(sassResourcesLoader) \n rule.options.loaders.scss.push(sassResourcesLoader) \n } \n if (['/\\\\.sass$/', '/\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) { \n rule.use.push(sassResourcesLoader) \n } \n }) \n\n }","extend(config, ctx) {\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n // whitelist: [/es6-promise|\\.(?!(?:js|json)$).{1,5}$/i]\n whitelist: [/es6-promise|\\.(?!(?:js|json)$).{1,5}$/i, /^echarts/]\n })\n ];\n }\n }","extend(config, ctx) {\n // // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }","extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","function makeConfig() {\n\tif (config)\n\t\tthrow new Error('Config can only be created once');\n\n\toptions = project.custom.webpack || {}\n\t_.defaultsDeep(options,defaultOptions);\n\n\tif (options.config) {\n\t\tconfig = options.config;\n\t} else {\n\t\tlet configPath = path.resolve(options.configPath);\n\t\tif (!fs.existsSync(configPath)) {\n\t\t\tthrow new Error(`Unable to location webpack config path ${configPath}`);\n\t\t}\n\n\t\tlog(`Making compiler with config path ${configPath}`);\n\t\tconfig = require(configPath);\n\n\t\tif (_.isFunction(config))\n\t\t\tconfig = config()\n\t}\n\n\n\tconfig.target = 'node';\n\n\t// Output config\n\toutputPath = path.resolve(process.cwd(),'target');\n\tif (!fs.existsSync(outputPath))\n\t\tmkdirp.sync(outputPath);\n\n\tconst output = config.output = config.output || {};\n\toutput.library = '[name]';\n\n\t// Ensure we have a valid output target\n\tif (!_.includes([CommonJS,CommonJS2],output.libraryTarget)) {\n\t\tconsole.warn('Webpack config library target is not in',[CommonJS,CommonJS2].join(','))\n\t\toutput.libraryTarget = CommonJS2\n\t}\n\n\t// Ref the target\n\tlibraryTarget = output.libraryTarget\n\n\toutput.filename = '[name].js';\n\toutput.path = outputPath;\n\n\tlog('Building entry list');\n\tconst entries = config.entry = {};\n\n\tconst functions = project.getAllFunctions();\n\tfunctions.forEach(fun => {\n\n\t\t// Runtime checks\n\t\t// No python or Java :'(\n\n\t\tif (!/node/.test(fun.runtime)) {\n\t\t\tlog(`${fun.name} is not a webpack function`);\n\t\t\treturn\n\t\t}\n\n\n\t\tconst handlerParts = fun.handler.split('/').pop().split('.');\n\t\tlet modulePath = fun.getRootPath(handlerParts[0]), baseModulePath = modulePath;\n\t\tif (!fs.existsSync(modulePath)) {\n\t\t\tfor (let ext of config.resolve.extensions) {\n\t\t\t\tmodulePath = `${baseModulePath}${ext}`;\n\t\t\t\tlog(`Checking: ${modulePath}`);\n\t\t\t\tif (fs.existsSync(modulePath))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!fs.existsSync(modulePath))\n\t\t\tthrow new Error(`Failed to resolve entry with base path ${baseModulePath}`);\n\n\t\tconst handlerPath = require.resolve(modulePath);\n\n\t\tlog(`Adding entry ${fun.name} with path ${handlerPath}`);\n\t\tentries[fun.name] = handlerPath;\n\t});\n\n\tlog(`Final entry list ${Object.keys(config.entry).join(', ')}`);\n}","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.push({\n test: /\\.json5$/,\n loader: 'json5-loader',\n exclude: /(node_modules)/\n })\n config.node = {\n fs: 'empty'\n }\n }","extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }","extend(config, ctx) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }","extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n\n const vueRule = config.module.rules.find(\n rule => rule.loader === 'vue-loader'\n )\n vueRule.options.compilerOptions = {\n ...vueRule.options.compilerOptions,\n modules: [\n ...((vueRule.options.compilerOptions &&\n vueRule.options.compilerOptions.modules) ||\n []),\n { postTransformNode: staticClassHotfix }\n ]\n }\n\n function staticClassHotfix(el) {\n el.staticClass = el.staticClass && el.staticClass.replace(/\\\\\\w\\b/g, '')\n if (Array.isArray(el.children)) {\n el.children.map(staticClassHotfix)\n }\n }\n }","extend(config) {\n config.module.rules.push({\n test: /\\.(glsl|frag|vert|fs|vs)$/,\n loader: 'shader-loader',\n exclude: /(node_modules)/\n })\n }","extend(config, ctx) {\n if (ctx.isDev) {\n config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map';\n }\n }","extend (config, ctx) {\n config.module.rules.push({\n test: /\\.ya?ml?$/,\n loader: ['json-loader', 'yaml-loader', ]\n })\n }","extend(config) {\n const vueLoader = config.module.rules.find(\n (rule) => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-card-img-lazy': ['src', 'blank-src'],\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src',\n }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }","config(cfg) {\n // if (cfg.hasFilesystemConfig()) {\n // // Use the normal config\n // return cfg.options;\n // }\n\n const {\n __createDll,\n __react,\n __typescript = false,\n __server = false,\n __spaTemplateInject = false,\n __routes,\n } = customOptions;\n const { presets, plugins, ...options } = cfg.options;\n const isServer =\n __server || process.env.WEBPACK_BUILD_STAGE === 'server';\n // console.log({ options });\n\n // presets ========================================================\n const newPresets = [...presets];\n if (__typescript) {\n newPresets.unshift([\n require('@babel/preset-typescript').default,\n __react\n ? {\n isTSX: true,\n allExtensions: true,\n }\n : {},\n ]);\n // console.log(newPresets);\n }\n newPresets.forEach((preset, index) => {\n if (\n typeof preset.file === 'object' &&\n /^@babel\\/preset-env$/.test(preset.file.request)\n ) {\n const thisPreset = newPresets[index];\n if (typeof thisPreset.options !== 'object')\n thisPreset.options = {};\n thisPreset.options.modules = false;\n thisPreset.options.exclude = [\n // '@babel/plugin-transform-regenerator',\n // '@babel/plugin-transform-async-to-generator'\n ];\n if (isServer || __spaTemplateInject) {\n thisPreset.options.targets = {\n node: true,\n };\n thisPreset.options.ignoreBrowserslistConfig = true;\n thisPreset.options.exclude.push(\n '@babel/plugin-transform-regenerator'\n );\n thisPreset.options.exclude.push(\n '@babel/plugin-transform-async-to-generator'\n );\n }\n // console.log(__spaTemplateInject, thisPreset);\n }\n });\n\n // plugins ========================================================\n // console.log('\\n ');\n // console.log('before', plugins.map(plugin => plugin.file.request));\n\n const newPlugins = plugins.filter((plugin) => {\n // console.log(plugin.file.request);\n if (testPluginName(plugin, /^extract-hoc(\\/|\\\\)babel$/))\n return false;\n if (testPluginName(plugin, /^react-hot-loader(\\/|\\\\)babel$/))\n return false;\n if (testPluginName(plugin, 'transform-regenerator'))\n return false;\n\n return true;\n });\n\n // console.log('after', newPlugins.map(plugin => plugin.file.request));\n\n if (\n !__createDll &&\n __react &&\n process.env.WEBPACK_BUILD_ENV === 'dev'\n ) {\n // newPlugins.push(require('extract-hoc/babel'));\n newPlugins.push(require('react-hot-loader/babel'));\n }\n\n if (!__createDll && !isServer) {\n let pathname = path.resolve(getCwd(), __routes);\n if (fs.lstatSync(pathname).isDirectory()) pathname += '/index';\n if (!fs.existsSync(pathname)) {\n const exts = ['.js', '.ts'];\n exts.some((ext) => {\n const newPathname = path.resolve(pathname + ext);\n if (fs.existsSync(newPathname)) {\n pathname = newPathname;\n return true;\n }\n return false;\n });\n }\n newPlugins.push([\n path.resolve(\n __dirname,\n './plugins/client-sanitize-code-spliting-name.js'\n ),\n {\n routesConfigFile: pathname,\n },\n ]);\n // console.log(newPlugins);\n }\n\n const thisOptions = {\n ...options,\n presets: newPresets,\n plugins: newPlugins,\n };\n // console.log(isServer);\n\n return thisOptions;\n }","extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n\n config.module.rules.forEach((rule) => {\n if (isVueRule(rule)) {\n rule.options.loaders.sass.push(sassResourcesLoader);\n rule.options.loaders.scss.push(sassResourcesLoader);\n }\n if (isSassRule(rule)) rule.use.push(sassResourcesLoader);\n });\n }","extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(ts|js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_module)/\n })\n }\n }","extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }","extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }"],"string":"[\n \"extend (config, { isDev, isClient }) {\\n // if (isDev && isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n // }\\n if (process.server && process.browser) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.plugins.push(\\n new webpack.EnvironmentPlugin([\\n 'APIKEY',\\n 'AUTHDOMAIN',\\n 'DATABASEURL',\\n 'PROJECTID',\\n 'STORAGEBUCKET',\\n 'MESSAGINGSENDERID'\\n ])\\n )\\n }\",\n \"function getBaseWebpackConfig(){\\n const config={\\n entry:{\\n main:['./src/index.js']\\n },\\n alias:{\\n $redux:'../src/redux',\\n $service:'../src/service'\\n },\\n resolve:{\\n extensions:['.js','.jsx']\\n },\\n // entry:['src/index.js'],\\n module:{\\n rules:[\\n {\\n test:/\\\\.(js|jsx)?$/,\\n exclude:/node_modules/,\\n use:getBabelLoader()\\n }\\n ]\\n },\\n plugins:[\\n new HtmlWebpackPlugin({\\n inject:true,\\n // template:index_template,\\n template:'./index.html',\\n filename:'index.html',\\n chunksSortMode:'manual',\\n chunks:['app']\\n })\\n ]\\n \\n }\\n return config;\\n}\",\n \"extend(config, ctx) {\\n // config.plugins.push(new HtmlWebpackPlugin({\\n // })),\\n // config.plugins.push(new SkeletonWebpackPlugin({\\n // webpackConfig: {\\n // entry: {\\n // app: path.join(__dirname, './Skeleton.js'),\\n // }\\n // },\\n // quiet: true\\n // }))\\n }\",\n \"webpack(config) {\\n config.resolve.alias['@root'] = path.join(__dirname);\\n config.resolve.alias['@components'] = path.join(__dirname, 'components');\\n config.resolve.alias['@pages'] = path.join(__dirname, 'pages');\\n config.resolve.alias['@services'] = path.join(__dirname, 'services');\\n return config;\\n }\",\n \"extendWebpack (cfg) {\\n cfg.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules|quasar)/\\n })\\n cfg.resolve.alias = {\\n ...(cfg.resolve.alias || {}),\\n '@components': path.resolve(__dirname, './src/components'),\\n '@layouts': path.resolve(__dirname, './src/layouts'),\\n '@pages': path.resolve(__dirname, './src/pages'),\\n '@utils': path.resolve(__dirname, './src/utils'),\\n '@store': path.resolve(__dirname, './src/store'),\\n '@config': path.resolve(__dirname, './src/config'),\\n '@errors': path.resolve(__dirname, './src/errors'),\\n '@api': path.resolve(__dirname, './src/api')\\n }\\n }\",\n \"extend(config, {\\n isDev,\\n isClient,\\n isServer\\n }) {\\n if (!isDev) return\\n if (isClient) {\\n // 启用source-map\\n // config.devtool = 'eval-source-map'\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /node_modules/,\\n options: {\\n formatter: require(\\\"eslint-friendly-formatter\\\"),\\n fix: true,\\n cache: true\\n }\\n })\\n }\\n if (isServer) {\\n const nodeExternals = require('webpack-node-externals')\\n config.externals = [\\n nodeExternals({\\n whitelist: [/^vuetify/]\\n })\\n ]\\n }\\n }\",\n \"extend (config, { isDev, isClient,isServer }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n config.devtool = 'eval-source-map'\\n }\\n // if (isServer) {\\n // config.externals = [\\n // require('webpack-node-externals')({\\n // whitelist: [/\\\\.(?!(?:js|json)$).{1,5}$/i, /^ai-act-ui/, /^ai-i/]\\n // })\\n // ]\\n // }\\n }\",\n \"extend(config, ctx) {\\n config.module.rules.push({ test: /\\\\.graphql?$/, loader: 'webpack-graphql-loader' })\\n config.plugins.push(new webpack.ProvidePlugin({\\n mapboxgl: 'mapbox-gl'\\n }))\\n }\",\n \"function webpackCommonConfigCreator(options) {\\r\\n\\r\\n return {\\r\\n mode: options.mode, // 开发模式\\r\\n entry: \\\"./src/index.js\\\",\\r\\n externals: {\\r\\n \\\"react\\\": \\\"react\\\",\\r\\n \\\"react-dom\\\": \\\"react-dom\\\",\\r\\n // \\\"lodash\\\": \\\"lodash\\\",\\r\\n \\\"antd\\\": \\\"antd\\\",\\r\\n \\\"@fluentui/react\\\": \\\"@fluentui/react\\\",\\r\\n \\\"styled-components\\\": \\\"styled-components\\\"\\r\\n },\\r\\n output: {\\r\\n // filename: \\\"bundle.js\\\",\\r\\n // 分配打包后的目录,放于js文件夹下\\r\\n // filename: \\\"js/bundle.js\\\",\\r\\n // 对输出的 bundle.js 进行优化:分割输出,减小体积\\r\\n // filename: \\\"js/[name][hash].js\\\", // 改在 webpack.prod.js 和 webpack.dev.js 中根据不同环境配置不同的hash值\\r\\n path: path.resolve(__dirname, \\\"../build\\\"),\\r\\n publicPath: \\\"/\\\"\\r\\n },\\r\\n // 对输出的 bundle.js 进行优化:分割输出,减小体积\\r\\n optimization: {\\r\\n splitChunks: {\\r\\n chunks: \\\"all\\\",\\r\\n minSize: 50000,\\r\\n minChunks: 1,\\r\\n }\\r\\n },\\r\\n plugins: [\\r\\n // new HtmlWebpackPlugin(),\\r\\n new HtmlWebpackPlugin({\\r\\n template: path.resolve(__dirname, \\\"../public/index.html\\\"),\\r\\n // filename: \\\"./../html/index.html\\\", //编译后生成新的html文件路径\\r\\n // thunks: ['vendor', 'index'], // 需要引入的入口文件\\r\\n // excludeChunks: ['login'], // 不需要引入的入口文件\\r\\n favicon: path.resolve(__dirname, \\\"../src/assets/images/favicon.ico\\\") //favicon.ico文件路径\\r\\n }),\\r\\n new CleanWebpackPlugin({\\r\\n cleanOnceBeforeBuildPatterns: [path.resolve(process.cwd(), \\\"build/\\\"), path.resolve(process.cwd(), \\\"dist/\\\")]\\r\\n }),\\r\\n new ExtractTextPlugin({\\r\\n // filename: \\\"[name][hash].css\\\"\\r\\n // 分配打包后的目录,放于css文件夹下\\r\\n filename: \\\"css/[name][hash].css\\\"\\r\\n }),\\r\\n ],\\r\\n module: {\\r\\n rules: [\\r\\n {\\r\\n test: /\\\\.(js|jsx)$/,\\r\\n // include: path.resolve(__dirname, \\\"../src\\\"),\\r\\n // 用排除的方式,除了 /node_modules/ 都让 babel-loader 进行解析,这样一来就能解析引用的别的package中的组件了\\r\\n // exclude: /node_modules/,\\r\\n use: [\\r\\n {\\r\\n loader: \\\"babel-loader\\\",\\r\\n options: {\\r\\n presets: ['@babel/preset-react'],\\r\\n plugins: [\\\"react-hot-loader/babel\\\"]\\r\\n }\\r\\n }\\r\\n ]\\r\\n },\\r\\n // {\\r\\n // test: /\\\\.html$/,\\r\\n // use: [\\r\\n // {\\r\\n // loader: 'html-loader'\\r\\n // }\\r\\n // ]\\r\\n // },\\r\\n // {\\r\\n // test: /\\\\.css$/,\\r\\n // use: [MiniCssExtractPlugin.loader, 'css-loader']\\r\\n // },\\r\\n {\\r\\n // test: /\\\\.css$/,\\r\\n test: /\\\\.(css|scss)$/,\\r\\n // test: /\\\\.scss$/,\\r\\n // include: path.resolve(__dirname, '../src'),\\r\\n exclude: /node_modules/,\\r\\n // 进一步优化 配置css-module模式(样式模块化),将自动生成的样式抽离到单独的文件中\\r\\n use: ExtractTextPlugin.extract({\\r\\n fallback: \\\"style-loader\\\",\\r\\n use: [\\r\\n {\\r\\n loader: \\\"css-loader\\\",\\r\\n options: {\\r\\n modules: {\\r\\n mode: \\\"local\\\",\\r\\n localIdentName: '[path][name]_[local]--[hash:base64:5]'\\r\\n },\\r\\n localsConvention: 'camelCase'\\r\\n }\\r\\n },\\r\\n \\\"sass-loader\\\",\\r\\n // 使用postcss对css3属性添加前缀\\r\\n {\\r\\n loader: \\\"postcss-loader\\\",\\r\\n options: {\\r\\n ident: 'postcss',\\r\\n plugins: loader => [\\r\\n require('postcss-import')({ root: loader.resourcePath }),\\r\\n require('autoprefixer')()\\r\\n ]\\r\\n }\\r\\n }\\r\\n ]\\r\\n })\\r\\n },\\r\\n {\\r\\n test: /\\\\.less$/,\\r\\n use: [\\r\\n { loader: 'style-loader' },\\r\\n { loader: 'css-loader' },\\r\\n {\\r\\n loader: 'less-loader',\\r\\n options: {\\r\\n // modifyVars: {\\r\\n // 'primary-color': '#263961',\\r\\n // 'link-color': '#263961'\\r\\n // },\\r\\n javascriptEnabled: true\\r\\n }\\r\\n }\\r\\n ]\\r\\n },\\r\\n // 为第三方包配置css解析,将样式表直接导出\\r\\n {\\r\\n test: /\\\\.(css|scss|less)$/,\\r\\n exclude: path.resolve(__dirname, '../src'),\\r\\n use: [\\r\\n \\\"style-loader\\\",\\r\\n \\\"css-loader\\\",\\r\\n \\\"sass-loader\\\",\\r\\n \\\"less-loader\\\"\\r\\n // {\\r\\n // loader: 'file-loader',\\r\\n // options: {\\r\\n // name: \\\"css/[name].css\\\"\\r\\n // }\\r\\n // }\\r\\n ]\\r\\n },\\r\\n // 字体加载器 (前提:yarn add file-loader -D)\\r\\n {\\r\\n test: /\\\\.(woff|woff2|eot|ttf|otf)$/,\\r\\n use: ['file-loader']\\r\\n },\\r\\n // 图片加载器 (前提:yarn add url-loader -D)\\r\\n {\\r\\n test: /\\\\.(jpg|png|svg|gif)$/,\\r\\n use: [\\r\\n {\\r\\n loader: 'url-loader',\\r\\n options: {\\r\\n limit: 10240,\\r\\n // name: '[hash].[ext]',\\r\\n // 分配打包后的目录,放于images文件夹下\\r\\n name: 'images/[hash].[ext]',\\r\\n publicPath: \\\"/\\\"\\r\\n }\\r\\n },\\r\\n ]\\r\\n },\\r\\n ]\\r\\n },\\r\\n // 后缀自动补全\\r\\n resolve: {\\r\\n // symlinks: false,\\r\\n extensions: ['.js', '.jsx', '.png', '.svg'],\\r\\n alias: {\\r\\n src: path.resolve(__dirname, '../src'),\\r\\n components: path.resolve(__dirname, '../src/components'),\\r\\n routes: path.resolve(__dirname, '../src/routes'),\\r\\n utils: path.resolve(__dirname, '../src/utils'),\\r\\n api: path.resolve(__dirname, '../src/api')\\r\\n }\\r\\n }\\r\\n }\\r\\n}\",\n \"extend(config, { isDev, isClient }) {\\n\\n // Resolve vue2-google-maps issues (server-side)\\n // - an alternative way to solve the issue\\n // -----------------------------------------------------------------------\\n // config.module.rules.splice(0, 0, {\\n // test: /\\\\.js$/,\\n // include: [path.resolve(__dirname, './node_modules/vue2-google-maps')],\\n // loader: 'babel-loader',\\n // })\\n }\",\n \"extend (config, ctx) {\\n config.devtool = ctx.isClient ? \\\"eval-source-map\\\" : \\\"inline-source-map\\\";\\n\\n // if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: \\\"pre\\\",\\n // test: /\\\\.(js|vue)$/,\\n // loader: \\\"eslint-loader\\\",\\n // exclude: /(node_modules)/,\\n // });\\n // }\\n }\",\n \"extend (config, { isDev, isClient }) {\\n config.resolve.alias['fetch'] = path.join(__dirname, 'utils/fetch.js')\\n config.resolve.alias['api'] = path.join(__dirname, 'api')\\n config.resolve.alias['layouts'] = path.join(__dirname, 'layouts')\\n config.resolve.alias['components'] = path.join(__dirname, 'components')\\n config.resolve.alias['utils'] = path.join(__dirname, 'utils')\\n config.resolve.alias['static'] = path.join(__dirname, 'static')\\n config.resolve.alias['directive'] = path.join(__dirname, 'directive')\\n config.resolve.alias['filters'] = path.join(__dirname, 'filters')\\n config.resolve.alias['styles'] = path.join(__dirname, 'assets/styles')\\n config.resolve.alias['element'] = path.join(__dirname, 'plugins/element-ui')\\n config.resolve.alias['@element-ui'] = path.join(__dirname, 'plugins/element-ui')\\n config.resolve.alias['e-ui'] = path.join(__dirname, 'node_modules/h666888')\\n config.resolve.alias['@e-ui'] = path.join(__dirname, 'plugins/e-ui')\\n config.resolve.alias['areaJSON'] = path.join(__dirname, 'static/area.json')\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n /*\\n const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\\n config.plugins.push(\\n new BundleAnalyzerPlugin({\\n openAnalyzer: true\\n })\\n )\\n */\\n /**\\n *全局引入scss文件\\n */\\n const sassResourcesLoader = {\\n loader: 'sass-resources-loader',\\n options: {\\n resources: [\\n 'assets/styles/var.scss'\\n ]\\n }\\n }\\n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \\n config.module.rules.forEach((rule) => {\\n if (rule.test.toString() === '/\\\\\\\\.vue$/') {\\n rule.options.loaders.sass.push(sassResourcesLoader)\\n rule.options.loaders.scss.push(sassResourcesLoader)\\n }\\n if (['/\\\\\\\\.sass$/', '/\\\\\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) {\\n rule.use.push(sassResourcesLoader)\\n }\\n })\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: \\\"pre\\\",\\n test: /\\\\.(js|vue)$/,\\n loader: \\\"eslint-loader\\\",\\n exclude: /(node_modules)/\\n })\\n }\\n // https://github.com/vuejs/vuepress/blob/14d4d2581f4b7c71ea71a41a1849f582090edb97/lib/webpack/createBaseConfig.js#L92\\n config.module.rules.push({\\n test: /\\\\.md$/,\\n use: [\\n {\\n loader: \\\"vue-loader\\\",\\n options: {\\n compilerOptions: {\\n preserveWhitespace: false\\n }\\n }\\n },\\n {\\n loader: require.resolve(\\\"vuepress/lib/webpack/markdownLoader\\\"),\\n options: {\\n sourceDir: \\\"./blog\\\",\\n markdown: createMarkdown()\\n }\\n }\\n ]\\n })\\n // fake the temp folder used in vuepress\\n config.resolve.alias[\\\"@temp\\\"] = path.resolve(__dirname, \\\"temp\\\")\\n config.plugins.push(\\n new webpack.DefinePlugin({\\n \\\"process.GIT_HEAD\\\": JSON.stringify(GIT_HEAD)\\n })\\n )\\n config.plugins.push(\\n new webpack.LoaderOptionsPlugin({\\n options: {\\n stylus: {\\n use: [poststylus([\\\"autoprefixer\\\", \\\"rucksack-css\\\"])]\\n }\\n }\\n })\\n )\\n }\",\n \"extend (config, { isDev, isClient }) {\\n\\t\\t\\tif (isDev && isClient) {\\n\\t\\t\\t\\tconfig.module.rules.push({\\n\\t\\t\\t\\t\\tenforce: 'pre',\\n\\t\\t\\t\\t\\ttest: /\\\\.(js|vue)$/,\\n\\t\\t\\t\\t\\tloader: 'eslint-loader',\\n\\t\\t\\t\\t\\texclude: /(node_modules)/\\n\\t\\t\\t\\t})\\n\\t\\t\\t}\\n\\t\\t\\tif(!isDev && isClient){\\n\\t\\t\\t\\tconfig.externals = {\\n\\t\\t\\t\\t\\t\\\"vue\\\": \\\"Vue\\\",\\n\\t\\t\\t\\t\\t\\\"axios\\\" : \\\"axios\\\",\\n\\t\\t\\t\\t\\t\\\"vue-router\\\" : \\\"VueRouter\\\"\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\tconfig.output.library = 'LingTal',\\n\\t\\t\\t\\tconfig.output.libraryTarget = 'umd',\\n\\t\\t\\t\\tconfig.output.umdNamedDefine = true\\n\\t\\t\\t\\t//config.output.chunkFilename = _assetsRoot+'js/[chunkhash:20].js'\\n\\t\\t\\t}\\n\\t\\t}\",\n \"prepareWebpackConfig () {\\n // resolve webpack config\\n let config = createClientConfig(this.context)\\n\\n config\\n .plugin('html')\\n // using a fork of html-webpack-plugin to avoid it requiring webpack\\n // internals from an incompatible version.\\n .use(require('vuepress-html-webpack-plugin'), [{\\n template: this.context.devTemplate\\n }])\\n\\n config\\n .plugin('site-data')\\n .use(HeadPlugin, [{\\n tags: this.context.siteConfig.head || []\\n }])\\n\\n config\\n .plugin('vuepress-log')\\n .use(DevLogPlugin, [{\\n port: this.port,\\n displayHost: this.displayHost,\\n publicPath: this.context.base,\\n clearScreen: !(this.context.options.debug || !this.context.options.clearScreen)\\n }])\\n\\n config = config.toConfig()\\n const userConfig = this.context.siteConfig.configureWebpack\\n if (userConfig) {\\n config = applyUserWebpackConfig(userConfig, config, false /* isServer */)\\n }\\n this.webpackConfig = config\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n // muse设置\\n config.resolve.alias['muse-components'] = 'muse-ui/src'\\n config.resolve.alias['vue$'] = 'vue/dist/vue.esm.js'\\n config.module.rules.push({\\n test: /muse-ui.src.*?js$/,\\n loader: 'babel-loader'\\n })\\n }\",\n \"extend(config, { isDev }) {\\n if (isDev && process.client) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n // config.module.rules.push({\\n // test: /\\\\.postcss$/,\\n // use: [\\n // 'vue-style-loader',\\n // 'css-loader',\\n // {\\n // loader: 'postcss-loader'\\n // }\\n // ]\\n // })\\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push(\\n {\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n options: {\\n fix: true\\n }\\n },\\n {\\n test: /\\\\.ico$/,\\n loader: 'uri-loader',\\n exclude: /(node_modules)/\\n }\\n )\\n console.log(config.output.publicPath, 'config.output.publicPath')\\n // config.output.publicPath = ''\\n }\\n }\",\n \"extend(config) {\\n if (process.server && process.browser) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n config.node = {\\n console: true,\\n fs: 'empty',\\n net: 'empty',\\n tls: 'empty'\\n }\\n }\\n\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/^vuetify/]\\n })\\n ]\\n }\\n }\",\n \"webpack(config, env) {\\n\\n // Drop noisy eslint pre-rule\\n config.module.rules.splice(1, 1);\\n\\n // Drop noisy tslint plugin\\n const EXCLUDED_PLUGINS = ['ForkTsCheckerWebpackPlugin'];\\n config.plugins = config.plugins.filter(plugin => !EXCLUDED_PLUGINS.includes(plugin.constructor.name));\\n // config.plugins.push(\\n // [\\\"prismjs\\\", {\\n // \\\"languages\\\": [\\\"go\\\", \\\"java\\\", \\\"javascript\\\", \\\"css\\\", \\\"html\\\"],\\n // \\\"plugins\\\": [\\\"line-numbers\\\", \\\"show-language\\\"],\\n // \\\"theme\\\": \\\"okaidia\\\",\\n // \\\"css\\\": true\\n // }]\\n // )\\n return config;\\n }\",\n \"extend(config, { isClient, isDev }) {\\n // Run ESLint on save\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue|ts)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n })\\n\\n // stylelint\\n config.plugins.push(\\n new StylelintPlugin({\\n files: ['**/*.vue'],\\n }),\\n )\\n\\n config.devtool = '#source-map'\\n }\\n\\n // glsl\\n config.module.rules.push({\\n test: /\\\\.(glsl|vs|fs)$/,\\n use: ['raw-loader', 'glslify-loader'],\\n exclude: /(node_modules)/,\\n })\\n\\n config.module.rules.push({\\n test: /\\\\.(ogg|mp3|wav|mpe?g)$/i,\\n loader: 'file-loader',\\n options: {\\n name: '[path][name].[ext]',\\n },\\n })\\n\\n config.output.globalObject = 'this'\\n\\n config.module.rules.unshift({\\n test: /\\\\.worker\\\\.ts$/,\\n loader: 'worker-loader',\\n })\\n config.module.rules.unshift({\\n test: /\\\\.worker\\\\.js$/,\\n loader: 'worker-loader',\\n })\\n\\n // import alias\\n config.resolve.alias.Sass = path.resolve(__dirname, './assets/sass/')\\n config.resolve.alias.Js = path.resolve(__dirname, './assets/js/')\\n config.resolve.alias.Images = path.resolve(__dirname, './assets/images/')\\n config.resolve.alias['~'] = path.resolve(__dirname)\\n config.resolve.alias['@'] = path.resolve(__dirname)\\n }\",\n \"extend(config, ctx) {\\n const vueLoader = config.module.rules.find(\\n rule => rule.loader === 'vue-loader'\\n )\\n vueLoader.options.transformAssetUrls = {\\n video: ['src', 'poster'],\\n source: 'src',\\n img: 'src',\\n image: 'xlink:href',\\n 'b-img': 'src',\\n 'b-img-lazy': ['src', 'blank-src'],\\n 'b-card': 'img-src',\\n 'b-card-img': 'img-src',\\n 'b-carousel-slide': 'img-src',\\n 'b-embed': 'src'\\n }\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.node = {\\n fs: 'empty'\\n }\\n // Add markdown loader\\n config.module.rules.push({\\n test: /\\\\.md$/,\\n loader: 'frontmatter-markdown-loader'\\n })\\n }\",\n \"extend(config, ctx) {\\n const vueLoader = config.module.rules.find((loader) => loader.loader === 'vue-loader')\\n vueLoader.options.transformToRequire = {\\n 'vue-h-zoom': ['image', 'image-full']\\n }\\n }\",\n \"extend (config, ctx) {\\n config.resolve.alias['class-component'] = '~plugins/class-component'\\n if (ctx.dev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/\\\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\\n })\\n ]\\n }\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isClient && isDev) {\\n config.optimization.splitChunks.maxSize = 51200\\n }\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.resolve.alias.vue = process.env.NODE_ENV === 'production' ? 'vue/dist/vue.min' : 'vue/dist/vue.js'\\n }\",\n \"extend(config) {\\n config.devtool = process.env.NODE_ENV === 'dev' ? 'eval-source-map' : ''\\n }\",\n \"extend(config, ctx) {\\n // Added Line\\n config.devtool = ctx.isClient ? \\\"eval-source-map\\\" : \\\"inline-source-map\\\";\\n\\n // Run ESLint on save\\n // if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n // }\\n\\n }\",\n \"extend(config, { isDev }) {\\n if (process.server && process.browser) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n });\\n }\\n }\",\n \"extend (config, ctx) {\\n config.output.publicPath = 'http://0.0.0.0:3000/';\\n //config.output.crossOriginLoading = 'anonymous'\\n /* const devServer = {\\n public: 'http://0.0.0.0:3000',\\n port: 3000,\\n host: '0.0.0.0',\\n hotOnly: true,\\n https: false,\\n watchOptions: {\\n poll: 1000,\\n },\\n headers: {\\n \\\"Access-Control-Allow-Origin\\\": \\\"\\\\*\\\",\\n }\\n };\\n config.devServer = devServer; */\\n }\",\n \"extend(config, ctx) {\\n config.devtool = \\\"source-map\\\";\\n\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: \\\"pre\\\",\\n test: /\\\\.(js|vue)$/,\\n loader: \\\"eslint-loader\\\",\\n exclude: /(node_modules)/,\\n options: {\\n fix: true,\\n },\\n });\\n }\\n\\n config.module.rules.push({\\n enforce: \\\"pre\\\",\\n test: /\\\\.txt$/,\\n loader: \\\"raw-loader\\\",\\n exclude: /(node_modules)/,\\n });\\n }\",\n \"extend(config, ctx) {\\n ctx.loaders.less.javascriptEnabled = true\\n config.resolve.alias.vue = 'vue/dist/vue.common'\\n }\",\n \"extend(config, { isDev }) {\\n if (isDev) config.devtool = '#source-map';\\n if (isDev && process.client) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n });\\n }\\n }\",\n \"extend(config, { isDev }) {\\n if (isDev) {\\n config.devtool = 'source-map';\\n }\\n }\",\n \"extend(config, ctx) {\\n // if (process.server && process.browser) {\\n if (ctx.isDev && ctx.isClient) {\\n config.devtool = \\\"source-map\\\";\\n // if (isDev && process.isClient) {\\n config.plugins.push(\\n new StylelintPlugin({\\n files: [\\\"**/*.vue\\\", \\\"**/*.scss\\\"],\\n })\\n ),\\n config.module.rules.push({\\n enforce: \\\"pre\\\",\\n test: /\\\\.(js|vue)$/,\\n loader: \\\"eslint-loader\\\",\\n exclude: /(node_modules)/,\\n options: {\\n formatter: require(\\\"eslint-friendly-formatter\\\"),\\n },\\n });\\n if (ctx.isDev) {\\n config.mode = \\\"development\\\";\\n }\\n }\\n for (const rule of config.module.rules) {\\n if (rule.use) {\\n for (const use of rule.use) {\\n if (use.loader === \\\"sass-loader\\\") {\\n use.options = use.options || {};\\n use.options.includePaths = [\\n \\\"node_modules/foundation-sites/scss\\\",\\n \\\"node_modules/motion-ui/src\\\",\\n ];\\n }\\n }\\n }\\n }\\n // vue-svg-inline-loader\\n const vueRule = config.module.rules.find((rule) =>\\n rule.test.test(\\\".vue\\\")\\n );\\n vueRule.use = [\\n {\\n loader: vueRule.loader,\\n options: vueRule.options,\\n },\\n {\\n loader: \\\"vue-svg-inline-loader\\\",\\n },\\n ];\\n delete vueRule.loader;\\n delete vueRule.options;\\n }\",\n \"extend(config, ctx) {\\n if (ctx.isClient) {\\n // 配置别名\\n config.resolve.alias['@'] = path.resolve(__dirname, './');\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n });\\n }\\n }\",\n \"extend (config, ctx) {\\n if (ctx.dev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n /*\\n ** For including scss variables file\\n */\\n config.module.rules.forEach((rule) => {\\n if (isVueRule(rule)) {\\n rule.options.loaders.scss.push(sassResourcesLoader)\\n }\\n if (isSASSRule(rule)) {\\n rule.use.push(sassResourcesLoader)\\n }\\n })\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n config.plugins.push(\\n new StylelintPlugin({\\n files: ['**/*.vue', '**/*.scss']\\n })\\n )\\n }\\n config.module.rules.push({\\n test: /\\\\.webp$/,\\n loader: 'url-loader',\\n options: {\\n limit: 1000,\\n name: 'img/[name].[hash:7].[ext]'\\n }\\n })\\n }\",\n \"extend (config, {isDev, isClient, isServer}) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n if (isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/\\\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\\n })\\n ]\\n }\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n config.devtool = '#source-map' // 添加此行代码\\n }\\n }\",\n \"extend (config, { isDev }) {\\n if (isDev && process.client) {\\n\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n },\\n {\\n test: /\\\\.pug$/,\\n resourceQuery: /^\\\\?vue/,\\n loader: 'pug-plain-loader',\\n exclude: /(node_modules)/\\n },\\n {\\n test: /\\\\.styl/,\\n resourceQuery: /^\\\\?vue/,\\n loader: 'pug-plain-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.module.rules.filter(r => r.test.toString().includes('svg')).forEach(r => { r.test = /\\\\.(png|jpe?g|gif)$/ });\\n\\n config.module.rules.push({\\n test: /\\\\.svg$/,\\n loader: 'vue-svg-loader',\\n });\\n\\n [].concat(...config.module.rules\\n .find(e => e.test.toString().match(/\\\\.styl/)).oneOf\\n .map(e => e.use.filter(e => e.loader === 'stylus-loader'))).forEach(stylus => {\\n Object.assign(stylus.options, {\\n import: [\\n '~assets/styles/colors.styl',\\n '~assets/styles/variables.styl',\\n ]\\n })\\n });\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push(...[{\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n },{\\n test: /\\\\.(gif|png|jpe?g|svg)$/i,\\n use: [\\n 'file-loader',\\n {\\n loader: 'image-webpack-loader',\\n options: {\\n bypassOnDebug: true,\\n mozjpeg: {\\n progressive: true,\\n quality: 65\\n },\\n // optipng.enabled: false will disable optipng\\n optipng: {\\n enabled: true,\\n },\\n pngquant: {\\n quality: '65-90',\\n speed: 4\\n },\\n gifsicle: {\\n interlaced: false,\\n },\\n // the webp option will enable WEBP\\n webp: {\\n quality: 75\\n }\\n },\\n },\\n ],\\n }])\\n }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n }\\n }\",\n \"extend(config, ctx) {\\n config.module.rules.forEach((r) => {\\n if(r.test.toString() === `/\\\\.(png|jpe?g|gif|svg|webp)$/i`) {\\n r.use = [\\n {\\n loader: \\\"url-loader\\\",\\n options: {\\n limit: 1000,\\n name: 'img/[name].[hash:7].[ext]'\\n }\\n },\\n {\\n loader: 'image-webpack-loader',\\n }\\n ]\\n delete r.loader;\\n delete r.options;\\n }\\n })\\n config.module.rules.push(\\n {\\n test: /\\\\.ya?ml$/,\\n type: 'json',\\n use: 'yaml-loader'\\n }\\n )\\n }\",\n \"extend(config, { isDev }) {\\r\\n if (isDev && process.client) {\\r\\n config.module.rules.push({\\r\\n enforce: 'pre',\\r\\n test: /\\\\.(js|vue)$/,\\r\\n loader: 'eslint-loader',\\r\\n exclude: /(node_modules)/,\\r\\n })\\r\\n\\r\\n const vueLoader = config.module.rules.find(\\r\\n ({ loader }) => loader === 'vue-loader',\\r\\n )\\r\\n const { options: { loaders } } = vueLoader || { options: {} }\\r\\n\\r\\n if (loaders) {\\r\\n for (const loader of Object.values(loaders)) {\\r\\n changeLoaderOptions(Array.isArray(loader) ? loader : [loader])\\r\\n }\\r\\n }\\r\\n\\r\\n config.module.rules.forEach(rule => changeLoaderOptions(rule.use))\\r\\n }\\r\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n // vue-loader\\n const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\\n vueLoader.options.loaders.less = 'vue-style-loader!css-loader!less-loader'\\n }\",\n \"function webpackConfigDev(options = {}) {\\n // get the common configuration to start with\\n const config = init(options);\\n\\n // // make \\\"dev\\\" specific changes here\\n // const credentials = require(\\\"./credentials.json\\\");\\n // credentials.branch = \\\"dev\\\";\\n //\\n // config.plugin(\\\"screeps\\\")\\n // .use(ScreepsWebpackPlugin, [credentials]);\\n\\n // modify the args of \\\"define\\\" plugin\\n config.plugin(\\\"define\\\").tap((args) => {\\n args[0].PRODUCTION = JSON.stringify(false);\\n return args;\\n });\\n\\n return config;\\n}\",\n \"extend(config, ctx) {\\n // Use vuetify loader\\n const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\\n const options = vueLoader.options || {}\\n const compilerOptions = options.compilerOptions || {}\\n const cm = compilerOptions.modules || []\\n cm.push(VuetifyProgressiveModule)\\n\\n config.module.rules.push({\\n test: /\\\\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)(\\\\?.*)?$/,\\n oneOf: [\\n {\\n test: /\\\\.(png|jpe?g|gif)$/,\\n resourceQuery: /lazy\\\\?vuetify-preload/,\\n use: [\\n 'vuetify-loader/progressive-loader',\\n {\\n loader: 'url-loader',\\n options: { limit: 8000 }\\n }\\n ]\\n },\\n {\\n loader: 'url-loader',\\n options: { limit: 8000 }\\n }\\n ]\\n })\\n\\n if (ctx.isDev) {\\n // Run ESLint on save\\n if (ctx.isClient) {\\n config.module.rules.push({\\n enforce: \\\"pre\\\",\\n test: /\\\\.(js|vue)$/,\\n loader: \\\"eslint-loader\\\",\\n exclude: /(node_modules)/\\n });\\n }\\n }\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/^vuetify/]\\n })\\n ];\\n } else {\\n config.plugins.push(new NetlifyServerPushPlugin({\\n headersFile: '_headers'\\n }));\\n }\\n }\",\n \"extend (config) {\\n config.module.rules.push({\\n test: /\\\\.s(c|a)ss$/,\\n use: [\\n {\\n loader: 'sass-loader',\\n options: {\\n includePaths: [\\n 'node_modules/breakpoint-sass/stylesheets',\\n 'node_modules/susy/sass',\\n 'node_modules/gent_styleguide/build/styleguide'\\n ]\\n }\\n }\\n ]\\n })\\n }\",\n \"extend (config, ctx) {\\n // if (ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n // }\\n }\",\n \"extend(config, ctx) {\\n // NuxtJS debugging support\\n // eval-source-map: a SourceMap that matchers exactly to the line number and this help to debug the NuxtJS app in the client\\n // inline-source-map: help to debug the NuxtJS app in the server\\n config.devtool = ctx.isClient ? 'eval-source-map' : 'inline-source-map'\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/^vuetify/]\\n })\\n ]\\n }\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n \\n config.module.rules.push({\\n test: /\\\\.svg$/,\\n loader: 'svg-inline-loader',\\n exclude: /node_modules/\\n })\\n \\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push(\\n {\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n },\\n {\\n test: /\\\\.(png|jpe?g|gif|svg|webp|ico)$/,\\n loader: 'url-loader',\\n query: {\\n limit: 1000 // 1kB\\n }\\n }\\n )\\n }\\n\\n for (const ruleList of Object.values(config.module.rules || {})) {\\n for (const rule of Object.values(ruleList.oneOf || {})) {\\n for (const loader of rule.use) {\\n const loaderModifier = loaderModifiers[loader.loader]\\n if (loaderModifier) {\\n loaderModifier(loader)\\n }\\n }\\n }\\n }\\n }\",\n \"extend(config, ctx) {\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n options: {\\n formatter: require('eslint-friendly-formatter'),\\n fix: true\\n }\\n })\\n }\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/^vuetify/, /^vue-resource/]\\n })\\n ]\\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on saves\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push(\\n {\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n },\\n // {\\n // test: /\\\\.(jpg)$/,\\n // loader: 'file-loader'\\n // },\\n {\\n test: /\\\\.jpeg$/, // jpeg의 모든 파일\\n loader: 'file-loader', // 파일 로더를 적용한다.\\n options: {\\n // publicPath: './', // prefix를 아웃풋 경로로 지정\\n name: '[name].[ext]?[hash]' // 파일명 형식\\n }\\n }\\n )\\n }\\n }\",\n \"extend (config, ctx) {\\n // transpile: [/^vue2-google-maps($|\\\\/)/]\\n /*\\n if (!ctx.isClient) {\\n // This instructs Webpack to include `vue2-google-maps`'s Vue files\\n // for server-side rendering\\n config.externals = [\\n function(context, request, callback){\\n if (/^vue2-google-maps($|\\\\/)/.test(request)) {\\n callback(null, false)\\n } else {\\n callback()\\n }\\n }\\n ]\\n }\\n */\\n }\",\n \"extend(configuration, { isDev, isClient }) {\\n configuration.resolve.alias.vue = 'vue/dist/vue.common'\\n\\n configuration.node = {\\n fs: 'empty',\\n }\\n\\n configuration.module.rules.push({\\n test: /\\\\.worker\\\\.js$/,\\n use: { loader: 'worker-loader' },\\n })\\n\\n if (isDev && isClient) {\\n configuration.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n })\\n }\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n })\\n }\\n\\n config.module.rules\\n .find((rule) => rule.loader === 'vue-loader')\\n .options.loaders.scss\\n .push({\\n loader: 'sass-resources-loader',\\n options: {\\n resources: [\\n path.join(__dirname, 'app', 'assets', 'scss', '_variables.scss'),\\n path.join(__dirname, 'app', 'assets', 'scss', '_mixins.scss'),\\n ],\\n },\\n })\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n\\n const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));\\n svgRule.test = /\\\\.(png|jpe?g|gif|webp)$/;\\n\\n config.module.rules.push({\\n test: /\\\\.svg$/,\\n loader: 'vue-svg-loader',\\n });\\n\\n config.module.rules.push({\\n test: /\\\\.(png|gif)$/,\\n loader: 'url-loader',\\n query: {\\n limit: 1000,\\n name: 'img/[name].[hash:7].[ext]'\\n }\\n });\\n }\",\n \"extend(config, { isDev }) {\\n if (isDev && process.client) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.devtool = false\\n }\",\n \"extend(config, ctx) {\\n const vueLoader = config.module.rules.find(\\n rule => rule.loader === \\\"vue-loader\\\"\\n );\\n vueLoader.options.transformToRequire = {\\n img: \\\"src\\\",\\n image: \\\"xlink:href\\\",\\n \\\"b-img\\\": \\\"src\\\",\\n \\\"b-img-lazy\\\": [\\\"src\\\", \\\"blank-src\\\"],\\n \\\"b-card\\\": \\\"img-src\\\",\\n \\\"b-card-img\\\": \\\"img-src\\\",\\n \\\"b-carousel-slide\\\": \\\"img-src\\\",\\n \\\"b-embed\\\": \\\"src\\\"\\n };\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.module.rules\\n .filter(r => r.test.toString().includes('svg'))\\n .forEach(r => {\\n r.test = /\\\\.(png|jpe?g|gif)$/\\n })\\n // urlLoader.test = /\\\\.(png|jpe?g|gif)$/\\n config.module.rules.push({\\n test: /\\\\.svg$/,\\n loader: 'svg-inline-loader',\\n exclude: /node_modules/\\n })\\n }\",\n \"extend (config, { isDev, isClient }) {\\n /*\\n // questo linta ogni cosa ad ogni salvataggio\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }*/\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n config.module.rules.push({\\n test: /\\\\.graphql?$/,\\n exclude: /node_modules/,\\n loader: 'webpack-graphql-loader',\\n });\\n }\",\n \"extend(config, {\\n isDev,\\n isClient\\n }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.module.rules.push({\\n test: /\\\\.yaml$/,\\n loader: 'js-yaml-loader'\\n })\\n config.module.rules.push({\\n test: /\\\\.md$/,\\n loader: 'frontmatter-markdown-loader',\\n include: path.resolve(__dirname, 'articles'),\\n options: {\\n markdown: body => {\\n return md.render(body)\\n }\\n }\\n })\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n // if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: \\\"pre\\\",\\n // test: /\\\\.(js|vue)$/,\\n // loader: \\\"eslint-loader\\\",\\n // exclude: /(node_modules)/\\n // })\\n // }\\n config.module.rules.push({\\n test: /\\\\.md$/,\\n use: [\\n {\\n loader: \\\"html-loader\\\"\\n },\\n {\\n loader: \\\"markdown-loader\\\",\\n options: {\\n /* your options here */\\n }\\n }\\n ]\\n })\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n // if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n \\n }\",\n \"function createCommonWebpackConfig({\\n isDebug = true,\\n isHmr = false,\\n withLocalSourceMaps,\\n isModernBuild = false,\\n} = {}) {\\n const STATICS_DIR_MODERN = path.join(BUILD_DIR, 'statics-modern');\\n const config = {\\n context: SRC_DIR,\\n\\n mode: isProduction ? 'production' : 'development',\\n\\n output: {\\n path: isModernBuild ? STATICS_DIR_MODERN : STATICS_DIR,\\n publicPath,\\n pathinfo: isDebug,\\n filename: isDebug\\n ? addHashToAssetName('[name].bundle.js')\\n : addHashToAssetName('[name].bundle.min.js'),\\n chunkFilename: isDebug\\n ? addHashToAssetName('[name].chunk.js')\\n : addHashToAssetName('[name].chunk.min.js'),\\n hotUpdateMainFilename: 'updates/[hash].hot-update.json',\\n hotUpdateChunkFilename: 'updates/[id].[hash].hot-update.js',\\n },\\n\\n resolve: {\\n modules: ['node_modules', SRC_DIR],\\n\\n extensions,\\n\\n alias: project.resolveAlias,\\n\\n // Whether to resolve symlinks to their symlinked location.\\n symlinks: false,\\n },\\n\\n // Since Yoshi doesn't depend on every loader it uses directly, we first look\\n // for loaders in Yoshi's `node_modules` and then look at the root `node_modules`\\n //\\n // See https://github.com/wix/yoshi/pull/392\\n resolveLoader: {\\n modules: [path.join(__dirname, '../node_modules'), 'node_modules'],\\n },\\n\\n plugins: [\\n // This gives some necessary context to module not found errors, such as\\n // the requesting resource\\n new ModuleNotFoundPlugin(ROOT_DIR),\\n // https://github.com/Urthen/case-sensitive-paths-webpack-plugin\\n new CaseSensitivePathsPlugin(),\\n // Way of communicating to `babel-preset-yoshi` or `babel-preset-wix` that\\n // it should optimize for Webpack\\n new EnvirnmentMarkPlugin(),\\n // https://github.com/Realytics/fork-ts-checker-webpack-plugin\\n ...(isTypescriptProject && project.projectType === 'app' && isDebug\\n ? [\\n // Since `fork-ts-checker-webpack-plugin` requires you to have\\n // TypeScript installed when its required, we only require it if\\n // this is a TypeScript project\\n new (require('fork-ts-checker-webpack-plugin'))({\\n tsconfig: TSCONFIG_FILE,\\n async: false,\\n silent: true,\\n checkSyntacticErrors: true,\\n formatter: typescriptFormatter,\\n }),\\n ]\\n : []),\\n ...(isHmr ? [new webpack.HotModuleReplacementPlugin()] : []),\\n ],\\n\\n module: {\\n // Makes missing exports an error instead of warning\\n strictExportPresence: true,\\n\\n rules: [\\n // https://github.com/wix/externalize-relative-module-loader\\n ...(project.features.externalizeRelativeLodash\\n ? [\\n {\\n test: /[\\\\\\\\/]node_modules[\\\\\\\\/]lodash/,\\n loader: 'externalize-relative-module-loader',\\n },\\n ]\\n : []),\\n\\n // https://github.com/huston007/ng-annotate-loader\\n ...(project.isAngularProject\\n ? [\\n {\\n test: reScript,\\n loader: 'yoshi-angular-dependencies/ng-annotate-loader',\\n include: project.unprocessedModules,\\n },\\n ]\\n : []),\\n\\n // Rules for TS / TSX\\n {\\n test: /\\\\.(ts|tsx)$/,\\n include: project.unprocessedModules,\\n use: [\\n {\\n loader: 'thread-loader',\\n options: {\\n workers: require('os').cpus().length - 1,\\n },\\n },\\n\\n // https://github.com/huston007/ng-annotate-loader\\n ...(project.isAngularProject\\n ? [{ loader: 'yoshi-angular-dependencies/ng-annotate-loader' }]\\n : []),\\n\\n {\\n loader: 'ts-loader',\\n options: {\\n // This implicitly sets `transpileOnly` to `true`\\n ...(isModernBuild ? {configFile: 'tsconfig-modern.json'} : {}),\\n happyPackMode: true,\\n compilerOptions: project.isAngularProject\\n ? {}\\n : {\\n // force es modules for tree shaking\\n module: 'esnext',\\n // use same module resolution\\n moduleResolution: 'node',\\n // optimize target to latest chrome for local development\\n ...(isDevelopment\\n ? {\\n // allow using Promises, Array.prototype.includes, String.prototype.padStart, etc.\\n lib: ['es2017'],\\n // use async/await instead of embedding polyfills\\n target: 'es2017',\\n }\\n : {}),\\n },\\n },\\n },\\n ],\\n },\\n\\n // Rules for JS\\n {\\n test: reScript,\\n include: project.unprocessedModules,\\n use: [\\n {\\n loader: 'thread-loader',\\n options: {\\n workers: require('os').cpus().length - 1,\\n },\\n },\\n {\\n loader: 'babel-loader',\\n options: {\\n ...babelConfig,\\n },\\n },\\n ],\\n },\\n\\n // Rules for assets\\n {\\n oneOf: [\\n // Inline SVG images into CSS\\n {\\n test: /\\\\.inline\\\\.svg$/,\\n loader: 'svg-inline-loader',\\n },\\n\\n // Allows you to use two kinds of imports for SVG:\\n // import logoUrl from './logo.svg'; gives you the URL.\\n // import { ReactComponent as Logo } from './logo.svg'; gives you a component.\\n {\\n test: /\\\\.svg$/,\\n issuer: {\\n test: /\\\\.(j|t)sx?$/,\\n },\\n use: [\\n '@svgr/webpack',\\n {\\n loader: 'svg-url-loader',\\n options: {\\n iesafe: true,\\n noquotes: true,\\n limit: 10000,\\n name: staticAssetName,\\n },\\n },\\n ],\\n },\\n {\\n test: /\\\\.svg$/,\\n use: [\\n {\\n loader: 'svg-url-loader',\\n options: {\\n iesafe: true,\\n limit: 10000,\\n name: staticAssetName,\\n },\\n },\\n ],\\n },\\n\\n // Rules for Markdown\\n {\\n test: /\\\\.md$/,\\n loader: 'raw-loader',\\n },\\n\\n // Rules for HAML\\n {\\n test: /\\\\.haml$/,\\n loader: 'ruby-haml-loader',\\n },\\n\\n // Rules for HTML\\n {\\n test: /\\\\.html$/,\\n loader: 'html-loader',\\n },\\n\\n // Rules for GraphQL\\n {\\n test: /\\\\.(graphql|gql)$/,\\n loader: 'graphql-tag/loader',\\n },\\n\\n // Try to inline assets as base64 or return a public URL to it if it passes\\n // the 10kb limit\\n {\\n test: reAssets,\\n loader: 'url-loader',\\n options: {\\n name: staticAssetName,\\n limit: 10000,\\n },\\n },\\n ],\\n },\\n ],\\n },\\n\\n // https://webpack.js.org/configuration/stats/\\n stats: 'none',\\n\\n // https://github.com/webpack/node-libs-browser/tree/master/mock\\n node: {\\n fs: 'empty',\\n net: 'empty',\\n tls: 'empty',\\n __dirname: true,\\n },\\n\\n // https://webpack.js.org/configuration/devtool\\n // If we are in CI or requested explictly we create full source maps\\n // Once we are in a local build, we create cheap eval source map only\\n // for a development build (hence the !isProduction)\\n devtool:\\n inTeamCity || withLocalSourceMaps\\n ? 'source-map'\\n : !isProduction\\n ? 'cheap-module-eval-source-map'\\n : false,\\n };\\n\\n return config;\\n}\",\n \"extend(config, ctx) {\\n config.module.rules.push(\\n {\\n test: /\\\\.html$/,\\n loader: 'raw-loader'\\n }\\n )\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n for (const rule of config.module.rules) {\\n if (rule.use) {\\n for (const use of rule.use) {\\n if (use.loader === 'sass-loader') {\\n use.options = use.options || {};\\n use.options.includePaths = ['node_modules/foundation-sites/scss', 'node_modules/motion-ui/src'];\\n }\\n }\\n }\\n }\\n }\",\n \"extend(config, ctx) {\\n config.module.rules.push({\\n test: /\\\\.(graphql|gql)$/,\\n exclude: /node_modules/,\\n loader: 'graphql-tag/loader'\\n })\\n }\",\n \"extend(config,ctx){ \\n const sassResourcesLoader = { \\n loader: 'sass-resources-loader', \\n options: { \\n resources: [ \\n 'assets/scss/style.scss' \\n ] \\n } \\n } \\n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \\n config.module.rules.forEach((rule) => { \\n if (rule.test.toString() === '/\\\\\\\\.vue$/') { \\n rule.options.loaders.sass.push(sassResourcesLoader) \\n rule.options.loaders.scss.push(sassResourcesLoader) \\n } \\n if (['/\\\\\\\\.sass$/', '/\\\\\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) { \\n rule.use.push(sassResourcesLoader) \\n } \\n }) \\n\\n }\",\n \"extend(config, ctx) {\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n // whitelist: [/es6-promise|\\\\.(?!(?:js|json)$).{1,5}$/i]\\n whitelist: [/es6-promise|\\\\.(?!(?:js|json)$).{1,5}$/i, /^echarts/]\\n })\\n ];\\n }\\n }\",\n \"extend(config, ctx) {\\n // // Run ESLint on save\\n // if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n // }\\n }\",\n \"extend(config, {isDev, isClient}) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend(config, {isDev, isClient}) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"function makeConfig() {\\n\\tif (config)\\n\\t\\tthrow new Error('Config can only be created once');\\n\\n\\toptions = project.custom.webpack || {}\\n\\t_.defaultsDeep(options,defaultOptions);\\n\\n\\tif (options.config) {\\n\\t\\tconfig = options.config;\\n\\t} else {\\n\\t\\tlet configPath = path.resolve(options.configPath);\\n\\t\\tif (!fs.existsSync(configPath)) {\\n\\t\\t\\tthrow new Error(`Unable to location webpack config path ${configPath}`);\\n\\t\\t}\\n\\n\\t\\tlog(`Making compiler with config path ${configPath}`);\\n\\t\\tconfig = require(configPath);\\n\\n\\t\\tif (_.isFunction(config))\\n\\t\\t\\tconfig = config()\\n\\t}\\n\\n\\n\\tconfig.target = 'node';\\n\\n\\t// Output config\\n\\toutputPath = path.resolve(process.cwd(),'target');\\n\\tif (!fs.existsSync(outputPath))\\n\\t\\tmkdirp.sync(outputPath);\\n\\n\\tconst output = config.output = config.output || {};\\n\\toutput.library = '[name]';\\n\\n\\t// Ensure we have a valid output target\\n\\tif (!_.includes([CommonJS,CommonJS2],output.libraryTarget)) {\\n\\t\\tconsole.warn('Webpack config library target is not in',[CommonJS,CommonJS2].join(','))\\n\\t\\toutput.libraryTarget = CommonJS2\\n\\t}\\n\\n\\t// Ref the target\\n\\tlibraryTarget = output.libraryTarget\\n\\n\\toutput.filename = '[name].js';\\n\\toutput.path = outputPath;\\n\\n\\tlog('Building entry list');\\n\\tconst entries = config.entry = {};\\n\\n\\tconst functions = project.getAllFunctions();\\n\\tfunctions.forEach(fun => {\\n\\n\\t\\t// Runtime checks\\n\\t\\t// No python or Java :'(\\n\\n\\t\\tif (!/node/.test(fun.runtime)) {\\n\\t\\t\\tlog(`${fun.name} is not a webpack function`);\\n\\t\\t\\treturn\\n\\t\\t}\\n\\n\\n\\t\\tconst handlerParts = fun.handler.split('/').pop().split('.');\\n\\t\\tlet modulePath = fun.getRootPath(handlerParts[0]), baseModulePath = modulePath;\\n\\t\\tif (!fs.existsSync(modulePath)) {\\n\\t\\t\\tfor (let ext of config.resolve.extensions) {\\n\\t\\t\\t\\tmodulePath = `${baseModulePath}${ext}`;\\n\\t\\t\\t\\tlog(`Checking: ${modulePath}`);\\n\\t\\t\\t\\tif (fs.existsSync(modulePath))\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif (!fs.existsSync(modulePath))\\n\\t\\t\\tthrow new Error(`Failed to resolve entry with base path ${baseModulePath}`);\\n\\n\\t\\tconst handlerPath = require.resolve(modulePath);\\n\\n\\t\\tlog(`Adding entry ${fun.name} with path ${handlerPath}`);\\n\\t\\tentries[fun.name] = handlerPath;\\n\\t});\\n\\n\\tlog(`Final entry list ${Object.keys(config.entry).join(', ')}`);\\n}\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n if (ctx.isServer) {\\n config.externals = [\\n nodeExternals({\\n whitelist: [/^vuetify/]\\n })\\n ]\\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n config.module.rules.push({\\n test: /\\\\.json5$/,\\n loader: 'json5-loader',\\n exclude: /(node_modules)/\\n })\\n config.node = {\\n fs: 'empty'\\n }\\n }\",\n \"extend(config, ctx) {\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n });\\n }\\n }\",\n \"extend(config, ctx) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/,\\n options: {\\n fix: true\\n }\\n })\\n }\",\n \"extend(config, ctx) {\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n\\n const vueRule = config.module.rules.find(\\n rule => rule.loader === 'vue-loader'\\n )\\n vueRule.options.compilerOptions = {\\n ...vueRule.options.compilerOptions,\\n modules: [\\n ...((vueRule.options.compilerOptions &&\\n vueRule.options.compilerOptions.modules) ||\\n []),\\n { postTransformNode: staticClassHotfix }\\n ]\\n }\\n\\n function staticClassHotfix(el) {\\n el.staticClass = el.staticClass && el.staticClass.replace(/\\\\\\\\\\\\w\\\\b/g, '')\\n if (Array.isArray(el.children)) {\\n el.children.map(staticClassHotfix)\\n }\\n }\\n }\",\n \"extend(config) {\\n config.module.rules.push({\\n test: /\\\\.(glsl|frag|vert|fs|vs)$/,\\n loader: 'shader-loader',\\n exclude: /(node_modules)/\\n })\\n }\",\n \"extend(config, ctx) {\\n if (ctx.isDev) {\\n config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map';\\n }\\n }\",\n \"extend (config, ctx) {\\n config.module.rules.push({\\n test: /\\\\.ya?ml?$/,\\n loader: ['json-loader', 'yaml-loader', ]\\n })\\n }\",\n \"extend(config) {\\n const vueLoader = config.module.rules.find(\\n (rule) => rule.loader === 'vue-loader'\\n )\\n vueLoader.options.transformAssetUrls = {\\n video: ['src', 'poster'],\\n source: 'src',\\n img: 'src',\\n image: 'xlink:href',\\n 'b-img': 'src',\\n 'b-img-lazy': ['src', 'blank-src'],\\n 'b-card': 'img-src',\\n 'b-card-img': 'img-src',\\n 'b-card-img-lazy': ['src', 'blank-src'],\\n 'b-carousel-slide': 'img-src',\\n 'b-embed': 'src',\\n }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n });\\n }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n })\\n }\\n }\",\n \"config(cfg) {\\n // if (cfg.hasFilesystemConfig()) {\\n // // Use the normal config\\n // return cfg.options;\\n // }\\n\\n const {\\n __createDll,\\n __react,\\n __typescript = false,\\n __server = false,\\n __spaTemplateInject = false,\\n __routes,\\n } = customOptions;\\n const { presets, plugins, ...options } = cfg.options;\\n const isServer =\\n __server || process.env.WEBPACK_BUILD_STAGE === 'server';\\n // console.log({ options });\\n\\n // presets ========================================================\\n const newPresets = [...presets];\\n if (__typescript) {\\n newPresets.unshift([\\n require('@babel/preset-typescript').default,\\n __react\\n ? {\\n isTSX: true,\\n allExtensions: true,\\n }\\n : {},\\n ]);\\n // console.log(newPresets);\\n }\\n newPresets.forEach((preset, index) => {\\n if (\\n typeof preset.file === 'object' &&\\n /^@babel\\\\/preset-env$/.test(preset.file.request)\\n ) {\\n const thisPreset = newPresets[index];\\n if (typeof thisPreset.options !== 'object')\\n thisPreset.options = {};\\n thisPreset.options.modules = false;\\n thisPreset.options.exclude = [\\n // '@babel/plugin-transform-regenerator',\\n // '@babel/plugin-transform-async-to-generator'\\n ];\\n if (isServer || __spaTemplateInject) {\\n thisPreset.options.targets = {\\n node: true,\\n };\\n thisPreset.options.ignoreBrowserslistConfig = true;\\n thisPreset.options.exclude.push(\\n '@babel/plugin-transform-regenerator'\\n );\\n thisPreset.options.exclude.push(\\n '@babel/plugin-transform-async-to-generator'\\n );\\n }\\n // console.log(__spaTemplateInject, thisPreset);\\n }\\n });\\n\\n // plugins ========================================================\\n // console.log('\\\\n ');\\n // console.log('before', plugins.map(plugin => plugin.file.request));\\n\\n const newPlugins = plugins.filter((plugin) => {\\n // console.log(plugin.file.request);\\n if (testPluginName(plugin, /^extract-hoc(\\\\/|\\\\\\\\)babel$/))\\n return false;\\n if (testPluginName(plugin, /^react-hot-loader(\\\\/|\\\\\\\\)babel$/))\\n return false;\\n if (testPluginName(plugin, 'transform-regenerator'))\\n return false;\\n\\n return true;\\n });\\n\\n // console.log('after', newPlugins.map(plugin => plugin.file.request));\\n\\n if (\\n !__createDll &&\\n __react &&\\n process.env.WEBPACK_BUILD_ENV === 'dev'\\n ) {\\n // newPlugins.push(require('extract-hoc/babel'));\\n newPlugins.push(require('react-hot-loader/babel'));\\n }\\n\\n if (!__createDll && !isServer) {\\n let pathname = path.resolve(getCwd(), __routes);\\n if (fs.lstatSync(pathname).isDirectory()) pathname += '/index';\\n if (!fs.existsSync(pathname)) {\\n const exts = ['.js', '.ts'];\\n exts.some((ext) => {\\n const newPathname = path.resolve(pathname + ext);\\n if (fs.existsSync(newPathname)) {\\n pathname = newPathname;\\n return true;\\n }\\n return false;\\n });\\n }\\n newPlugins.push([\\n path.resolve(\\n __dirname,\\n './plugins/client-sanitize-code-spliting-name.js'\\n ),\\n {\\n routesConfigFile: pathname,\\n },\\n ]);\\n // console.log(newPlugins);\\n }\\n\\n const thisOptions = {\\n ...options,\\n presets: newPresets,\\n plugins: newPlugins,\\n };\\n // console.log(isServer);\\n\\n return thisOptions;\\n }\",\n \"extend (config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_modules)/\\n });\\n }\\n\\n config.module.rules.forEach((rule) => {\\n if (isVueRule(rule)) {\\n rule.options.loaders.sass.push(sassResourcesLoader);\\n rule.options.loaders.scss.push(sassResourcesLoader);\\n }\\n if (isSassRule(rule)) rule.use.push(sassResourcesLoader);\\n });\\n }\",\n \"extend (config, ctx) {\\n if (ctx.isDev && ctx.isClient) {\\n config.module.rules.push({\\n enforce: 'pre',\\n test: /\\\\.(ts|js|vue)$/,\\n loader: 'eslint-loader',\\n exclude: /(node_module)/\\n })\\n }\\n }\",\n \"extend(config, ctx) {\\n // Run ESLint on save\\n // if (ctx.isDev && ctx.isClient) {\\n // config.module.rules.push({\\n // enforce: 'pre',\\n // test: /\\\\.(js|vue)$/,\\n // loader: 'eslint-loader',\\n // exclude: /(node_modules)/\\n // })\\n // }\\n }\",\n \"extend(config, { isDev, isClient }) {\\n if (isDev && isClient) {\\n config.module.rules.push({\\n enforce: \\\"pre\\\",\\n test: /\\\\.(js|vue)$/,\\n loader: \\\"eslint-loader\\\",\\n exclude: /(node_modules)/\\n });\\n }\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.75780183","0.7486256","0.74535376","0.7388344","0.73616195","0.72877634","0.7282417","0.7211369","0.71547335","0.7107632","0.70970905","0.7090317","0.7045734","0.7035934","0.70036227","0.699704","0.69930667","0.6985959","0.69833404","0.6973784","0.69592714","0.6957332","0.69565624","0.6953751","0.69367003","0.6934928","0.69198984","0.6918667","0.6916272","0.6914212","0.6904401","0.6878041","0.68734443","0.6873211","0.68403995","0.68301773","0.6815345","0.6808729","0.6798517","0.6792629","0.67694056","0.6767418","0.6745065","0.67429864","0.67425466","0.6742329","0.6741698","0.67343605","0.6730357","0.6722651","0.67210746","0.66935563","0.66860217","0.6677227","0.6670981","0.6662804","0.6651306","0.6646672","0.6639688","0.66372496","0.6633925","0.66318494","0.66288406","0.66256106","0.66063815","0.66058326","0.6604861","0.6590057","0.6587027","0.6583075","0.657836","0.6576266","0.6571445","0.6571217","0.6562979","0.65626484","0.656086","0.6557368","0.6555168","0.6555168","0.6546314","0.6546203","0.6544196","0.6533708","0.652474","0.65215254","0.6519123","0.65124923","0.65034574","0.65013987","0.6500342","0.64998245","0.6491299","0.6491299","0.6491299","0.6491299","0.6489082","0.64888567","0.64861816","0.64853734","0.648373"],"string":"[\n \"0.75780183\",\n \"0.7486256\",\n \"0.74535376\",\n \"0.7388344\",\n \"0.73616195\",\n \"0.72877634\",\n \"0.7282417\",\n \"0.7211369\",\n \"0.71547335\",\n \"0.7107632\",\n \"0.70970905\",\n \"0.7090317\",\n \"0.7045734\",\n \"0.7035934\",\n \"0.70036227\",\n \"0.699704\",\n \"0.69930667\",\n \"0.6985959\",\n \"0.69833404\",\n \"0.6973784\",\n \"0.69592714\",\n \"0.6957332\",\n \"0.69565624\",\n \"0.6953751\",\n \"0.69367003\",\n \"0.6934928\",\n \"0.69198984\",\n \"0.6918667\",\n \"0.6916272\",\n \"0.6914212\",\n \"0.6904401\",\n \"0.6878041\",\n \"0.68734443\",\n \"0.6873211\",\n \"0.68403995\",\n \"0.68301773\",\n \"0.6815345\",\n \"0.6808729\",\n \"0.6798517\",\n \"0.6792629\",\n \"0.67694056\",\n \"0.6767418\",\n \"0.6745065\",\n \"0.67429864\",\n \"0.67425466\",\n \"0.6742329\",\n \"0.6741698\",\n \"0.67343605\",\n \"0.6730357\",\n \"0.6722651\",\n \"0.67210746\",\n \"0.66935563\",\n \"0.66860217\",\n \"0.6677227\",\n \"0.6670981\",\n \"0.6662804\",\n \"0.6651306\",\n \"0.6646672\",\n \"0.6639688\",\n \"0.66372496\",\n \"0.6633925\",\n \"0.66318494\",\n \"0.66288406\",\n \"0.66256106\",\n \"0.66063815\",\n \"0.66058326\",\n \"0.6604861\",\n \"0.6590057\",\n \"0.6587027\",\n \"0.6583075\",\n \"0.657836\",\n \"0.6576266\",\n \"0.6571445\",\n \"0.6571217\",\n \"0.6562979\",\n \"0.65626484\",\n \"0.656086\",\n \"0.6557368\",\n \"0.6555168\",\n \"0.6555168\",\n \"0.6546314\",\n \"0.6546203\",\n \"0.6544196\",\n \"0.6533708\",\n \"0.652474\",\n \"0.65215254\",\n \"0.6519123\",\n \"0.65124923\",\n \"0.65034574\",\n \"0.65013987\",\n \"0.6500342\",\n \"0.64998245\",\n \"0.6491299\",\n \"0.6491299\",\n \"0.6491299\",\n \"0.6491299\",\n \"0.6489082\",\n \"0.64888567\",\n \"0.64861816\",\n \"0.64853734\",\n \"0.648373\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":28,"cells":{"query":{"kind":"string","value":"converts it to a base b number. Return the new number as a string E.g. base_converter(5, 2) == \"101\" base_converter(31, 16) == \"1f\""},"document":{"kind":"string","value":"function baseConverter(num, b) {\n if (num === 0) {\n return \"\"\n };\n\n const digit = [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"];\n\n return baseConverter((num/b), b) + digit[num % b];\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 baseConverter(num, base) {\n const bases = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n const possibleBases = bases.slice(0, base)\n\n let result = [];\n\n while (num >= base) {\n result.unshift(possibleBases[num % base])\n num = Math.floor(num / base)\n }\n result.unshift(num)\n return result.join(\"\")\n}","function baseConverter(decNumber, base) {\n\n\tvar remStack = new Stack(),\n\t\trem,\n\t\tbaseString = '';\n\t\tdigits = '0123456789ABCDEF';\n\n\twhile(decNumber > 0) {\n\t\trem = Math.floor(decNumber % base);\n\t\tremStack.push(rem);\n\t\tdecNumber = Math.floor(decNumber / base);\n\t}\n\n\twhile(!remStack.isEmpty()) {\n\t\tbaseString += digits[remStack.pop()];\n\t}\n\n\treturn baseString;\n}","function strBaseConverter (number,ob,nb) {\n number = number.toUpperCase();\n var list = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var dec = 0;\n for (var i = 0; i <= number.length; i++) {\n dec += (list.indexOf(number.charAt(i))) * (Math.pow(ob , (number.length - i - 1)));\n }\n number = '';\n var magnitude = Math.floor((Math.log(dec)) / (Math.log(nb)));\n for (var i = magnitude; i >= 0; i--) {\n var amount = Math.floor(dec / Math.pow(nb,i));\n number = number + list.charAt(amount);\n dec -= amount * (Math.pow(nb,i));\n }\n return number;\n}","function baseConvert(base, number) {\n if (checkNum()) {\n let conversion = 0;\n let digits = number.split('').map(Number).reverse();\n base = Number(base);\n for (let place = digits.length - 1; place >= 0; place--) {\n conversion += (Math.pow(base, place)) * digits[place];\n }\n return conversion;\n }\n }","toBase10(value, b = 62) {\n const limit = value.length;\n let result = base.indexOf(value[0]);\n for (let i = 1; i < limit; i++) {\n result = b * result + base.indexOf(value[i]);\n }\n return result;\n }","function h$ghcjsbn_showBase(b, base) {\n h$ghcjsbn_assertValid_b(b, \"showBase\");\n h$ghcjsbn_assertValid_s(base, \"showBase\");\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\n return \"0\";\n } else {\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\n }\n}","function h$ghcjsbn_showBase(b, base) {\n h$ghcjsbn_assertValid_b(b, \"showBase\");\n h$ghcjsbn_assertValid_s(base, \"showBase\");\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\n return \"0\";\n } else {\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\n }\n}","function h$ghcjsbn_showBase(b, base) {\n h$ghcjsbn_assertValid_b(b, \"showBase\");\n h$ghcjsbn_assertValid_s(base, \"showBase\");\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\n return \"0\";\n } else {\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\n }\n}","function h$ghcjsbn_showBase(b, base) {\n h$ghcjsbn_assertValid_b(b, \"showBase\");\n h$ghcjsbn_assertValid_s(base, \"showBase\");\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\n return \"0\";\n } else {\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\n }\n}","function convertBase(str, fromBase, toBase) {\n const digits = parseToDigitsArray(str, fromBase);\n if (digits === null) return null;\n\n let outArray = [];\n let power = [1];\n for (let i = 0; i < digits.length; i += 1) {\n // invariant: at this point, fromBase^i = power\n if (digits[i]) {\n outArray = add(outArray, multiplyByNumber(digits[i], power, toBase), toBase);\n }\n power = multiplyByNumber(fromBase, power, toBase);\n }\n\n let out = '';\n for (let i = outArray.length - 1; i >= 0; i -= 1) {\n out += outArray[i].toString(toBase);\n }\n // if the original input was equivalent to zero, then 'out' will still be empty ''. Let's check for zero.\n if (out === '') {\n let sum = 0;\n for (let i = 0; i < digits.length; i += 1) {\n sum += digits[i];\n }\n if (sum === 0) out = '0';\n }\n\n return out;\n}","function base(dec, base) {\n var len = base.length;\n var ret = '';\n while(dec > 0) {\n ret = base.charAt(dec % len) + ret;\n dec = Math.floor(dec / len);\n }\n return ret;\n}","function $builtin_base_convert_helper(obj, base) {\n var prefix = \"\";\n switch(base){\n case 2:\n prefix = '0b'; break\n case 8:\n prefix = '0o'; break\n case 16:\n prefix = '0x'; break\n default:\n console.log('invalid base:' + base)\n }\n\n if(obj.__class__ === $B.long_int){\n var res = prefix + obj.value.toString(base)\n return res\n }\n\n var value = $B.$GetInt(obj)\n\n if(value === undefined){\n // need to raise an error\n throw _b_.TypeError.$factory('Error, argument must be an integer or' +\n ' contains an __index__ function')\n }\n\n if(value >= 0){return prefix + value.toString(base)}\n return '-' + prefix + (-value).toString(base)\n}","function h$ghcjsbn_showBase(b, base) {\n ASSERTVALID_B(b, \"showBase\");\n ASSERTVALID_S(base, \"showBase\");\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === GHCJSBN_EQ) {\n return \"0\";\n } else {\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\n }\n}","function toBaseOut(str,baseIn,baseOut,alphabet){var j,arr=[0],arrL,i=0,len=str.length;for(;ibaseOut-1){if(arr[j+1]==null)arr[j+1]=0;arr[j+1]+=arr[j]/baseOut|0;arr[j]%=baseOut}}}return arr.reverse()}// Convert a numeric string of baseIn to a numeric string of baseOut.","function decimalToBase(decNumber, base) {\n if (!Number.isInteger(decNumber) || !Number.isInteger(base)) {\n throw TypeError('input number is not an integer');\n }\n if (!(base >= 2 && base <= 36)) {\n throw Error('invalid base')\n }\n\n const remStack = new Stack();\n const digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n let number = decNumber;\n let rem;\n let stringified = '';\n\n while (number > 0) {\n rem = number % base;\n remStack.push(rem);\n number = Math.floor(number / base);\n }\n\n while (!remStack.isEmpty()) {\n stringified += digits[remStack.pop()].toString();\n }\n\n return stringified;\n}","toBase(value, b = 62) {\n let r = value % b;\n let result = base[r];\n let q = Math.floor(value / b);\n while (q) {\n r = q % b;\n q = Math.floor(q / b);\n result = base[r] + result;\n }\n return result;\n }","function baseConvert(obj, begBase, endBase ){\n if (begBase < 2 && endBase > 36){\n throw new Error(\"Bases are not valid\");\n }else {\n return parseInt(obj, begBase).toString(endBase);\n }\n}","function convertBase( str, baseOut, baseIn, sign ) {\n\t var d, e, k, r, x, xc, y,\n\t i = str.indexOf( '.' ),\n\t dp = DECIMAL_PLACES,\n\t rm = ROUNDING_MODE;\n\n\t if ( baseIn < 37 ) str = str.toLowerCase();\n\n\t // Non-integer.\n\t if ( i >= 0 ) {\n\t k = POW_PRECISION;\n\n\t // Unlimited precision.\n\t POW_PRECISION = 0;\n\t str = str.replace( '.', '' );\n\t y = new BigNumber(baseIn);\n\t x = y.pow( str.length - i );\n\t POW_PRECISION = k;\n\n\t // Convert str as if an integer, then restore the fraction part by dividing the\n\t // result by its base raised to a power.\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n\t y.e = y.c.length;\n\t }\n\n\t // Convert the number as integer.\n\t xc = toBaseOut( str, baseIn, baseOut );\n\t e = k = xc.length;\n\n\t // Remove trailing zeros.\n\t for ( ; xc[--k] == 0; xc.pop() );\n\t if ( !xc[0] ) return '0';\n\n\t if ( i < 0 ) {\n\t --e;\n\t } else {\n\t x.c = xc;\n\t x.e = e;\n\n\t // sign is needed for correct rounding.\n\t x.s = sign;\n\t x = div( x, y, dp, rm, baseOut );\n\t xc = x.c;\n\t r = x.r;\n\t e = x.e;\n\t }\n\n\t d = e + dp + 1;\n\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n\t i = xc[d];\n\t k = baseOut / 2;\n\t r = r || d < 0 || xc[d + 1] != null;\n\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n\t rm == ( x.s < 0 ? 8 : 7 ) );\n\n\t if ( d < 1 || !xc[0] ) {\n\n\t // 1^-dp or 0.\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\n\t } else {\n\t xc.length = d;\n\n\t if (r) {\n\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\n\t xc[d] = 0;\n\n\t if ( !d ) {\n\t ++e;\n\t xc.unshift(1);\n\t }\n\t }\n\t }\n\n\t // Determine trailing zeros.\n\t for ( k = xc.length; !xc[--k]; );\n\n\t // E.g. [4, 11, 15] becomes 4bf.\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n\t str = toFixedPoint( str, e );\n\t }\n\n\t // The caller will add the sign.\n\t return str;\n\t }","function convertBase( str, baseOut, baseIn, sign ) {\n\t var d, e, k, r, x, xc, y,\n\t i = str.indexOf( '.' ),\n\t dp = DECIMAL_PLACES,\n\t rm = ROUNDING_MODE;\n\n\t if ( baseIn < 37 ) str = str.toLowerCase();\n\n\t // Non-integer.\n\t if ( i >= 0 ) {\n\t k = POW_PRECISION;\n\n\t // Unlimited precision.\n\t POW_PRECISION = 0;\n\t str = str.replace( '.', '' );\n\t y = new BigNumber(baseIn);\n\t x = y.pow( str.length - i );\n\t POW_PRECISION = k;\n\n\t // Convert str as if an integer, then restore the fraction part by dividing the\n\t // result by its base raised to a power.\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n\t y.e = y.c.length;\n\t }\n\n\t // Convert the number as integer.\n\t xc = toBaseOut( str, baseIn, baseOut );\n\t e = k = xc.length;\n\n\t // Remove trailing zeros.\n\t for ( ; xc[--k] == 0; xc.pop() );\n\t if ( !xc[0] ) return '0';\n\n\t if ( i < 0 ) {\n\t --e;\n\t } else {\n\t x.c = xc;\n\t x.e = e;\n\n\t // sign is needed for correct rounding.\n\t x.s = sign;\n\t x = div( x, y, dp, rm, baseOut );\n\t xc = x.c;\n\t r = x.r;\n\t e = x.e;\n\t }\n\n\t d = e + dp + 1;\n\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n\t i = xc[d];\n\t k = baseOut / 2;\n\t r = r || d < 0 || xc[d + 1] != null;\n\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n\t rm == ( x.s < 0 ? 8 : 7 ) );\n\n\t if ( d < 1 || !xc[0] ) {\n\n\t // 1^-dp or 0.\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\n\t } else {\n\t xc.length = d;\n\n\t if (r) {\n\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\n\t xc[d] = 0;\n\n\t if ( !d ) {\n\t ++e;\n\t xc.unshift(1);\n\t }\n\t }\n\t }\n\n\t // Determine trailing zeros.\n\t for ( k = xc.length; !xc[--k]; );\n\n\t // E.g. [4, 11, 15] becomes 4bf.\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n\t str = toFixedPoint( str, e );\n\t }\n\n\t // The caller will add the sign.\n\t return str;\n\t }","function convertBase( str, baseOut, baseIn, sign ) {\n\t var d, e, k, r, x, xc, y,\n\t i = str.indexOf( '.' ),\n\t dp = DECIMAL_PLACES,\n\t rm = ROUNDING_MODE;\n\t\n\t if ( baseIn < 37 ) str = str.toLowerCase();\n\t\n\t // Non-integer.\n\t if ( i >= 0 ) {\n\t k = POW_PRECISION;\n\t\n\t // Unlimited precision.\n\t POW_PRECISION = 0;\n\t str = str.replace( '.', '' );\n\t y = new BigNumber(baseIn);\n\t x = y.pow( str.length - i );\n\t POW_PRECISION = k;\n\t\n\t // Convert str as if an integer, then restore the fraction part by dividing the\n\t // result by its base raised to a power.\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n\t y.e = y.c.length;\n\t }\n\t\n\t // Convert the number as integer.\n\t xc = toBaseOut( str, baseIn, baseOut );\n\t e = k = xc.length;\n\t\n\t // Remove trailing zeros.\n\t for ( ; xc[--k] == 0; xc.pop() );\n\t if ( !xc[0] ) return '0';\n\t\n\t if ( i < 0 ) {\n\t --e;\n\t } else {\n\t x.c = xc;\n\t x.e = e;\n\t\n\t // sign is needed for correct rounding.\n\t x.s = sign;\n\t x = div( x, y, dp, rm, baseOut );\n\t xc = x.c;\n\t r = x.r;\n\t e = x.e;\n\t }\n\t\n\t d = e + dp + 1;\n\t\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n\t i = xc[d];\n\t k = baseOut / 2;\n\t r = r || d < 0 || xc[d + 1] != null;\n\t\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n\t rm == ( x.s < 0 ? 8 : 7 ) );\n\t\n\t if ( d < 1 || !xc[0] ) {\n\t\n\t // 1^-dp or 0.\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\n\t } else {\n\t xc.length = d;\n\t\n\t if (r) {\n\t\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\n\t xc[d] = 0;\n\t\n\t if ( !d ) {\n\t ++e;\n\t xc.unshift(1);\n\t }\n\t }\n\t }\n\t\n\t // Determine trailing zeros.\n\t for ( k = xc.length; !xc[--k]; );\n\t\n\t // E.g. [4, 11, 15] becomes 4bf.\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n\t str = toFixedPoint( str, e );\n\t }\n\t\n\t // The caller will add the sign.\n\t return str;\n\t }","function convertBase( str, baseOut, baseIn, sign ) {\n\t var d, e, k, r, x, xc, y,\n\t i = str.indexOf( '.' ),\n\t dp = DECIMAL_PLACES,\n\t rm = ROUNDING_MODE;\n\t\n\t if ( baseIn < 37 ) str = str.toLowerCase();\n\t\n\t // Non-integer.\n\t if ( i >= 0 ) {\n\t k = POW_PRECISION;\n\t\n\t // Unlimited precision.\n\t POW_PRECISION = 0;\n\t str = str.replace( '.', '' );\n\t y = new BigNumber(baseIn);\n\t x = y.pow( str.length - i );\n\t POW_PRECISION = k;\n\t\n\t // Convert str as if an integer, then restore the fraction part by dividing the\n\t // result by its base raised to a power.\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n\t y.e = y.c.length;\n\t }\n\t\n\t // Convert the number as integer.\n\t xc = toBaseOut( str, baseIn, baseOut );\n\t e = k = xc.length;\n\t\n\t // Remove trailing zeros.\n\t for ( ; xc[--k] == 0; xc.pop() );\n\t if ( !xc[0] ) return '0';\n\t\n\t if ( i < 0 ) {\n\t --e;\n\t } else {\n\t x.c = xc;\n\t x.e = e;\n\t\n\t // sign is needed for correct rounding.\n\t x.s = sign;\n\t x = div( x, y, dp, rm, baseOut );\n\t xc = x.c;\n\t r = x.r;\n\t e = x.e;\n\t }\n\t\n\t d = e + dp + 1;\n\t\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n\t i = xc[d];\n\t k = baseOut / 2;\n\t r = r || d < 0 || xc[d + 1] != null;\n\t\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n\t rm == ( x.s < 0 ? 8 : 7 ) );\n\t\n\t if ( d < 1 || !xc[0] ) {\n\t\n\t // 1^-dp or 0.\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\n\t } else {\n\t xc.length = d;\n\t\n\t if (r) {\n\t\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\n\t xc[d] = 0;\n\t\n\t if ( !d ) {\n\t ++e;\n\t xc = [1].concat(xc);\n\t }\n\t }\n\t }\n\t\n\t // Determine trailing zeros.\n\t for ( k = xc.length; !xc[--k]; );\n\t\n\t // E.g. [4, 11, 15] becomes 4bf.\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n\t str = toFixedPoint( str, e );\n\t }\n\t\n\t // The caller will add the sign.\n\t return str;\n\t }","function convertBase( str, baseOut, baseIn, sign ) {\r\n\t var d, e, k, r, x, xc, y,\r\n\t i = str.indexOf( '.' ),\r\n\t dp = DECIMAL_PLACES,\r\n\t rm = ROUNDING_MODE;\r\n\r\n\t if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n\t // Non-integer.\r\n\t if ( i >= 0 ) {\r\n\t k = POW_PRECISION;\r\n\r\n\t // Unlimited precision.\r\n\t POW_PRECISION = 0;\r\n\t str = str.replace( '.', '' );\r\n\t y = new BigNumber(baseIn);\r\n\t x = y.pow( str.length - i );\r\n\t POW_PRECISION = k;\r\n\r\n\t // Convert str as if an integer, then restore the fraction part by dividing the\r\n\t // result by its base raised to a power.\r\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n\t y.e = y.c.length;\r\n\t }\r\n\r\n\t // Convert the number as integer.\r\n\t xc = toBaseOut( str, baseIn, baseOut );\r\n\t e = k = xc.length;\r\n\r\n\t // Remove trailing zeros.\r\n\t for ( ; xc[--k] == 0; xc.pop() );\r\n\t if ( !xc[0] ) return '0';\r\n\r\n\t if ( i < 0 ) {\r\n\t --e;\r\n\t } else {\r\n\t x.c = xc;\r\n\t x.e = e;\r\n\r\n\t // sign is needed for correct rounding.\r\n\t x.s = sign;\r\n\t x = div( x, y, dp, rm, baseOut );\r\n\t xc = x.c;\r\n\t r = x.r;\r\n\t e = x.e;\r\n\t }\r\n\r\n\t d = e + dp + 1;\r\n\r\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n\t i = xc[d];\r\n\t k = baseOut / 2;\r\n\t r = r || d < 0 || xc[d + 1] != null;\r\n\r\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n\t rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n\t if ( d < 1 || !xc[0] ) {\r\n\r\n\t // 1^-dp or 0.\r\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\r\n\t } else {\r\n\t xc.length = d;\r\n\r\n\t if (r) {\r\n\r\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\r\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n\t xc[d] = 0;\r\n\r\n\t if ( !d ) {\r\n\t ++e;\r\n\t xc.unshift(1);\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t // Determine trailing zeros.\r\n\t for ( k = xc.length; !xc[--k]; );\r\n\r\n\t // E.g. [4, 11, 15] becomes 4bf.\r\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n\t str = toFixedPoint( str, e );\r\n\t }\r\n\r\n\t // The caller will add the sign.\r\n\t return str;\r\n\t }","function convertBase(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n strL = str.length;\n\n for (; i < strL;) {\n for (arrL = arr.length; arrL--;) {arr[arrL] *= baseIn;}\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }","function convertFromBaseTenToBaseX( xbase, inval ) {\n\n return inval.toString( xbase ).toUpperCase();\n\n /* let xinval = inval;\n let remainder = hexidecimal[ xinval % xbase ];\n while ( xinval >= xbase ) {\n let r1 = subtract( xinval, ( xinval % xbase ) );\n xinval = divide( r1, xbase );\n // in this case we do not want to add we want to append the strings together\n if ( xinval >= xbase ) {\n remainder = hexidecimal[ xinval % xbase ] + remainder;\n } else {\n remainder = hexidecimal[ xinval ] + remainder;\n }\n }\n return remainder; */\n}","function dec_to_bho(number, change_base) {\n if (change_base == B ){\n return parseInt(number + '', 10)\n .toString(2);} else\n if (change_base == H ){\n return parseInt(number + '', 10)\n .toString(8);} else \n if (change_base == O ){\n return parseInt(number + '', 10)\n .toString(8);} else\n console.log(\"pick H, B, or O\");\n\n }","function convertBase(str, baseOut, baseIn, sign) {\n var d,\n e,\n k,\n r,\n x,\n xc,\n y,\n i = str.indexOf('.'),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if (baseIn < 37) str = str.toLowerCase();\n\n // Non-integer.\n if (i >= 0) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace('.', '');\n y = new BigNumber(baseIn);\n x = y.pow(str.length - i);\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e), 10, baseOut);\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut(str, baseIn, baseOut);\n e = k = xc.length;\n\n // Remove trailing zeros.\n for (; xc[--k] == 0; xc.pop()) {}\n if (!xc[0]) return '0';\n\n if (i < 0) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div(x, y, dp, rm, baseOut);\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));\n\n if (d < 1 || !xc[0]) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint('1', -dp) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for (--baseOut; ++xc[--d] > baseOut;) {\n xc[d] = 0;\n\n if (!d) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for (k = xc.length; !xc[--k];) {}\n\n // E.g. [4, 11, 15] becomes 4bf.\n for (i = 0, str = ''; i <= k; str += ALPHABET.charAt(xc[i++])) {}\n str = toFixedPoint(str, e);\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase(str, baseOut, baseIn, sign) {\n var d,\n e,\n k,\n r,\n x,\n xc,\n y,\n i = str.indexOf('.'),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if (baseIn < 37) str = str.toLowerCase();\n\n // Non-integer.\n if (i >= 0) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace('.', '');\n y = new BigNumber(baseIn);\n x = y.pow(str.length - i);\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e), 10, baseOut);\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut(str, baseIn, baseOut);\n e = k = xc.length;\n\n // Remove trailing zeros.\n for (; xc[--k] == 0; xc.pop()) {}\n if (!xc[0]) return '0';\n\n if (i < 0) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div(x, y, dp, rm, baseOut);\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));\n\n if (d < 1 || !xc[0]) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint('1', -dp) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for (--baseOut; ++xc[--d] > baseOut;) {\n xc[d] = 0;\n\n if (!d) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for (k = xc.length; !xc[--k];) {}\n\n // E.g. [4, 11, 15] becomes 4bf.\n for (i = 0, str = ''; i <= k; str += ALPHABET.charAt(xc[i++])) {}\n str = toFixedPoint(str, e);\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase(str, baseOut, baseIn, sign) {\n var d,\n e,\n k,\n r,\n x,\n xc,\n y,\n i = str.indexOf('.'),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n if (baseIn < 37) str = str.toLowerCase(); // Non-integer.\n\n if (i >= 0) {\n k = POW_PRECISION; // Unlimited precision.\n\n POW_PRECISION = 0;\n str = str.replace('.', '');\n y = new BigNumber(baseIn);\n x = y.pow(str.length - i);\n POW_PRECISION = k; // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e), 10, baseOut);\n y.e = y.c.length;\n } // Convert the number as integer.\n\n\n xc = toBaseOut(str, baseIn, baseOut);\n e = k = xc.length; // Remove trailing zeros.\n\n for (; xc[--k] == 0; xc.pop()) {\n }\n\n if (!xc[0]) return '0';\n\n if (i < 0) {\n --e;\n } else {\n x.c = xc;\n x.e = e; // sign is needed for correct rounding.\n\n x.s = sign;\n x = div(x, y, dp, rm, baseOut);\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1; // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));\n\n if (d < 1 || !xc[0]) {\n // 1^-dp or 0.\n str = r ? toFixedPoint('1', -dp) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for (--baseOut; ++xc[--d] > baseOut;) {\n xc[d] = 0;\n\n if (!d) {\n ++e;\n xc.unshift(1);\n }\n }\n } // Determine trailing zeros.\n\n\n for (k = xc.length; !xc[--k];) {\n } // E.g. [4, 11, 15] becomes 4bf.\n\n\n for (i = 0, str = ''; i <= k; str += ALPHABET.charAt(xc[i++])) {\n }\n\n str = toFixedPoint(str, e);\n } // The caller will add the sign.\n\n\n return str;\n } // Perform division in the specified base. Called by div and convertBase.","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc = [1].concat(xc);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n\t\t var d, e, k, r, x, xc, y,\r\n\t\t i = str.indexOf( '.' ),\r\n\t\t dp = DECIMAL_PLACES,\r\n\t\t rm = ROUNDING_MODE;\r\n\t\t\r\n\t\t if ( baseIn < 37 ) str = str.toLowerCase();\r\n\t\t\r\n\t\t // Non-integer.\r\n\t\t if ( i >= 0 ) {\r\n\t\t k = POW_PRECISION;\r\n\t\t\r\n\t\t // Unlimited precision.\r\n\t\t POW_PRECISION = 0;\r\n\t\t str = str.replace( '.', '' );\r\n\t\t y = new BigNumber(baseIn);\r\n\t\t x = y.pow( str.length - i );\r\n\t\t POW_PRECISION = k;\r\n\t\t\r\n\t\t // Convert str as if an integer, then restore the fraction part by dividing the\r\n\t\t // result by its base raised to a power.\r\n\t\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n\t\t y.e = y.c.length;\r\n\t\t }\r\n\t\t\r\n\t\t // Convert the number as integer.\r\n\t\t xc = toBaseOut( str, baseIn, baseOut );\r\n\t\t e = k = xc.length;\r\n\t\t\r\n\t\t // Remove trailing zeros.\r\n\t\t for ( ; xc[--k] == 0; xc.pop() );\r\n\t\t if ( !xc[0] ) return '0';\r\n\t\t\r\n\t\t if ( i < 0 ) {\r\n\t\t --e;\r\n\t\t } else {\r\n\t\t x.c = xc;\r\n\t\t x.e = e;\r\n\t\t\r\n\t\t // sign is needed for correct rounding.\r\n\t\t x.s = sign;\r\n\t\t x = div( x, y, dp, rm, baseOut );\r\n\t\t xc = x.c;\r\n\t\t r = x.r;\r\n\t\t e = x.e;\r\n\t\t }\r\n\t\t\r\n\t\t d = e + dp + 1;\r\n\t\t\r\n\t\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n\t\t i = xc[d];\r\n\t\t k = baseOut / 2;\r\n\t\t r = r || d < 0 || xc[d + 1] != null;\r\n\t\t\r\n\t\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n\t\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n\t\t rm == ( x.s < 0 ? 8 : 7 ) );\r\n\t\t\r\n\t\t if ( d < 1 || !xc[0] ) {\r\n\t\t\r\n\t\t // 1^-dp or 0.\r\n\t\t str = r ? toFixedPoint( '1', -dp ) : '0';\r\n\t\t } else {\r\n\t\t xc.length = d;\r\n\t\t\r\n\t\t if (r) {\r\n\t\t\r\n\t\t // Rounding up may mean the previous digit has to be rounded up and so on.\r\n\t\t for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n\t\t xc[d] = 0;\r\n\t\t\r\n\t\t if ( !d ) {\r\n\t\t ++e;\r\n\t\t xc.unshift(1);\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t\r\n\t\t // Determine trailing zeros.\r\n\t\t for ( k = xc.length; !xc[--k]; );\r\n\t\t\r\n\t\t // E.g. [4, 11, 15] becomes 4bf.\r\n\t\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n\t\t str = toFixedPoint( str, e );\r\n\t\t }\r\n\t\t\r\n\t\t // The caller will add the sign.\r\n\t\t return str;\r\n\t\t }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase( str, baseOut, baseIn, sign ) {\r\n var d, e, k, r, x, xc, y,\r\n i = str.indexOf( '.' ),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n // Non-integer.\r\n if ( i >= 0 ) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace( '.', '' );\r\n y = new BigNumber(baseIn);\r\n x = y.pow( str.length - i );\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n xc = toBaseOut( str, baseIn, baseOut );\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for ( ; xc[--k] == 0; xc.pop() );\r\n if ( !xc[0] ) return '0';\r\n\r\n if ( i < 0 ) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div( x, y, dp, rm, baseOut );\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n d = e + dp + 1;\r\n\r\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n if ( d < 1 || !xc[0] ) {\r\n\r\n // 1^-dp or 0.\r\n str = r ? toFixedPoint( '1', -dp ) : '0';\r\n } else {\r\n xc.length = d;\r\n\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n xc[d] = 0;\r\n\r\n if ( !d ) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for ( k = xc.length; !xc[--k]; );\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n str = toFixedPoint( str, e );\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function numberToString(n, base) {\n let result = '';\n let sign = '';\n if (n < 0) {\n sign = '-';\n n = -n;\n }\n do {\n // convert the number into the given 'base'\n // by repeatedly picking out the last digit and then dividing the number to get rid of this digit\n result = String(n % base) + result;\n n = Math.floor(n / base);\n } while (n > 0);\n return sign + result;\n}","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function convertBase(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n strL = str.length;\n\n for (; i < strL;) {\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }","function toBase10(number) {\n\n var x = number.toLowerCase();\n Logger.debug(\"x = \" + x)\n\n if (!x.startsWith('0b') && !x.startsWith('0x') && parseInt(x, 10).toString(10) == x.replace(/^0+/, '')) {\n Logger.debug('>>> Base 10: ' + parseInt(x, 10).toString(10) + ' = ' + x);\n return parseInt(x, 10);\n } else if (x.startsWith('0b') && (parseInt(x.substring(2), 2).toString(2) == x.substring(2).replace(/^0+/, ''))) {\n Logger.debug('>>> Base 2: ' + parseInt(x.substring(2), 2).toString(2) + ' = ' + x.substring(2));\n return parseInt(x.substring(2), 2);\n } else if (x.startsWith('0x') && (parseInt(x.substring(2), 16).toString(16) == x.substring(2).replace(/^0+/, ''))) {\n Logger.debug('>>> Base 16: ' + parseInt(x.substring(2), 16).toString(16) + ' = ' + x.substring(2));\n return parseInt(x.substring(2), 16);\n } else {\n Logger.debug('>>> ???')\n return NaN;\n }\n}","function convertBase(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n strL = str.length;\n\n for (; i < strL;) {\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }","function toBinary(decNumber,base){\n var remStack = new stacks(),\n rem,\n binarystring = '';\n digits = '0123456789ABCDEF';\n\n while (decNumber>0) {\n rem = Math.floor(decNumber%base);\n remStack.push(rem);\n decNumber = Math.floor(decNumber/base);\n\n }\n\nwhile (!remStack.isEmpty()) {\n binarystring += digits[remStack.pop()];\n}\n return binarystring;\n}","function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {\n ;\n }\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n } // Convert a numeric string of baseIn to a numeric string of baseOut.","function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n } // Convert a numeric string of baseIn to a numeric string of baseOut.","function util_frombase(input_buffer, input_base)\n {\n /// Convert number from 2^base to 2^10\n /// Array of bytes representing the number to convert\n /// The base of initial number\n\n var result = 0;\n\n for(var i = (input_buffer.length - 1); i >= 0; i-- )\n result += input_buffer[(input_buffer.length - 1) - i] * Math.pow(2, input_base * i);\n\n return result;\n }","function baseConvert(faceValues, num) {\n let base = faceValues.length;\n let result = \"\";\n if (num === 0) {\n return faceValues[0];\n }\n while (num !== 0) {\n let remainder = num % base;\n result += faceValues[remainder]; // we got result from right to left, last digit is entered first, we need to reverse\n let quotient = Math.floor(num / base);\n num = quotient;\n }\n return reverseString(result);\n}","function conversaoBase(num,b1,b2){\r\n\r\n num = num.toString()\r\n numArr = num.split(\"\",num.length)\r\n virgPos = numArr.indexOf(\".\")\r\n \r\n console.log(virgPos)\r\n \r\n // numero com 'casa decimal'\r\n if(numArr.indexOf(\".\") != -1 )\r\n {\r\n console.log('quebrado')\r\n intSize = virgPos\r\n numArr.splice(virgPos, 1)\r\n decSize = (numArr.length) - (intSize)\r\n }\r\n //numero inteiro\r\n else if(numArr.indexOf(\".\") == -1)\r\n {\r\n console.log('inteiro')\r\n intSize = numArr.length\r\n decSize = 0 \r\n }\r\n\r\n numConcat = 0\r\n index = 0\r\n\r\n console.log(`Numero: ${numArr}`)\r\n console.log(`intSize: ${intSize}`)\r\n console.log(`decSize: ${decSize}`)\r\n \r\n // converte da base n1 para a base 10\r\n for(let i = intSize - 1; i>= (-1*decSize); i--)\r\n {\r\n numConcat = numConcat + numArr[index]*(Math.pow(b1,i))\r\n index++\r\n console.log(numConcat)\r\n }\r\n // retorna da base 10 para a base n2\r\n return numConcat.toString(b2)\r\n}","function toBaseOut( str, baseIn, baseOut ) {\r\n\t\t var j,\r\n\t\t arr = [0],\r\n\t\t arrL,\r\n\t\t i = 0,\r\n\t\t len = str.length;\r\n\t\t\r\n\t\t for ( ; i < len; ) {\r\n\t\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n\t\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\t\t\r\n\t\t for ( ; j < arr.length; j++ ) {\r\n\t\t\r\n\t\t if ( arr[j] > baseOut - 1 ) {\r\n\t\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n\t\t arr[j + 1] += arr[j] / baseOut | 0;\r\n\t\t arr[j] %= baseOut;\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t\r\n\t\t return arr.reverse();\r\n\t\t }","function toBaseOut( str, baseIn, baseOut ) {\r\n\t var j,\r\n\t arr = [0],\r\n\t arrL,\r\n\t i = 0,\r\n\t len = str.length;\r\n\r\n\t for ( ; i < len; ) {\r\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n\t for ( ; j < arr.length; j++ ) {\r\n\r\n\t if ( arr[j] > baseOut - 1 ) {\r\n\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n\t arr[j + 1] += arr[j] / baseOut | 0;\r\n\t arr[j] %= baseOut;\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t return arr.reverse();\r\n\t }","function toBaseOut( str, baseIn, baseOut ) {\n\t var j,\n\t arr = [0],\n\t arrL,\n\t i = 0,\n\t len = str.length;\n\t\n\t for ( ; i < len; ) {\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\t\n\t for ( ; j < arr.length; j++ ) {\n\t\n\t if ( arr[j] > baseOut - 1 ) {\n\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\n\t arr[j + 1] += arr[j] / baseOut | 0;\n\t arr[j] %= baseOut;\n\t }\n\t }\n\t }\n\t\n\t return arr.reverse();\n\t }","function toBaseOut( str, baseIn, baseOut ) {\n\t var j,\n\t arr = [0],\n\t arrL,\n\t i = 0,\n\t len = str.length;\n\t\n\t for ( ; i < len; ) {\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\t\n\t for ( ; j < arr.length; j++ ) {\n\t\n\t if ( arr[j] > baseOut - 1 ) {\n\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\n\t arr[j + 1] += arr[j] / baseOut | 0;\n\t arr[j] %= baseOut;\n\t }\n\t }\n\t }\n\t\n\t return arr.reverse();\n\t }","function bigInt2str(x, base) {\n var i, t, s = \"\";\n\n if (s6.length != x.length)\n s6 = dup(x);\n else\n copy_(s6, x);\n\n if (base == -1) { //return the list of array contents\n for (i = x.length - 1; i > 0; i--)\n s += x[i] + ',';\n s += x[0];\n }\n else { //return it in the given base\n while (!isZero(s6)) {\n t = divInt_(s6, base); //t=s6 % base; s6=floor(s6/base);\n s = digitsStr.substring(t, t + 1) + s;\n }\n }\n if (s.length == 0)\n s = \"0\";\n return s;\n }","function toBaseOut( str, baseIn, baseOut ) {\n\t var j,\n\t arr = [0],\n\t arrL,\n\t i = 0,\n\t len = str.length;\n\n\t for ( ; i < len; ) {\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n\t for ( ; j < arr.length; j++ ) {\n\n\t if ( arr[j] > baseOut - 1 ) {\n\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\n\t arr[j + 1] += arr[j] / baseOut | 0;\n\t arr[j] %= baseOut;\n\t }\n\t }\n\t }\n\n\t return arr.reverse();\n\t }","function toBaseOut( str, baseIn, baseOut ) {\n\t var j,\n\t arr = [0],\n\t arrL,\n\t i = 0,\n\t len = str.length;\n\n\t for ( ; i < len; ) {\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n\t for ( ; j < arr.length; j++ ) {\n\n\t if ( arr[j] > baseOut - 1 ) {\n\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\n\t arr[j + 1] += arr[j] / baseOut | 0;\n\t arr[j] %= baseOut;\n\t }\n\t }\n\t }\n\n\t return arr.reverse();\n\t }","function toBaseOut(str, baseIn, baseOut, alphabet) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\n\n arr[0] += alphabet.indexOf(str.charAt(i++));\n\n for (j = 0; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }","function baseChange(number, newBase) {\n\n var newNumber = \"\";\n var myStack = new Stack();\n while(number > 0) {\n myStack.push(number%newBase);\n number = Math.floor(number/newBase);\n }\n while(!myStack.isEmpty()) {\n newNumber += myStack.pop();\n }\n return newNumber;\n}","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut( str, baseIn, baseOut ) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for ( ; i < len; ) {\r\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\r\n\r\n for ( ; j < arr.length; j++ ) {\r\n\r\n if ( arr[j] > baseOut - 1 ) {\r\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {}\n arr[j = 0] += ALPHABET.indexOf(str.charAt(i++));\n\n for (; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }","function toBaseOut(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for (; i < len;) {\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {}\n arr[j = 0] += ALPHABET.indexOf(str.charAt(i++));\n\n for (; j < arr.length; j++) {\n\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] == null) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }","function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }"],"string":"[\n \"function baseConverter(num, base) {\\n const bases = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \\\"a\\\", \\\"b\\\", \\\"c\\\", \\\"d\\\", \\\"e\\\", \\\"f\\\"]\\n const possibleBases = bases.slice(0, base)\\n\\n let result = [];\\n\\n while (num >= base) {\\n result.unshift(possibleBases[num % base])\\n num = Math.floor(num / base)\\n }\\n result.unshift(num)\\n return result.join(\\\"\\\")\\n}\",\n \"function baseConverter(decNumber, base) {\\n\\n\\tvar remStack = new Stack(),\\n\\t\\trem,\\n\\t\\tbaseString = '';\\n\\t\\tdigits = '0123456789ABCDEF';\\n\\n\\twhile(decNumber > 0) {\\n\\t\\trem = Math.floor(decNumber % base);\\n\\t\\tremStack.push(rem);\\n\\t\\tdecNumber = Math.floor(decNumber / base);\\n\\t}\\n\\n\\twhile(!remStack.isEmpty()) {\\n\\t\\tbaseString += digits[remStack.pop()];\\n\\t}\\n\\n\\treturn baseString;\\n}\",\n \"function strBaseConverter (number,ob,nb) {\\n number = number.toUpperCase();\\n var list = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\\n var dec = 0;\\n for (var i = 0; i <= number.length; i++) {\\n dec += (list.indexOf(number.charAt(i))) * (Math.pow(ob , (number.length - i - 1)));\\n }\\n number = '';\\n var magnitude = Math.floor((Math.log(dec)) / (Math.log(nb)));\\n for (var i = magnitude; i >= 0; i--) {\\n var amount = Math.floor(dec / Math.pow(nb,i));\\n number = number + list.charAt(amount);\\n dec -= amount * (Math.pow(nb,i));\\n }\\n return number;\\n}\",\n \"function baseConvert(base, number) {\\n if (checkNum()) {\\n let conversion = 0;\\n let digits = number.split('').map(Number).reverse();\\n base = Number(base);\\n for (let place = digits.length - 1; place >= 0; place--) {\\n conversion += (Math.pow(base, place)) * digits[place];\\n }\\n return conversion;\\n }\\n }\",\n \"toBase10(value, b = 62) {\\n const limit = value.length;\\n let result = base.indexOf(value[0]);\\n for (let i = 1; i < limit; i++) {\\n result = b * result + base.indexOf(value[i]);\\n }\\n return result;\\n }\",\n \"function h$ghcjsbn_showBase(b, base) {\\n h$ghcjsbn_assertValid_b(b, \\\"showBase\\\");\\n h$ghcjsbn_assertValid_s(base, \\\"showBase\\\");\\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\\n return \\\"0\\\";\\n } else {\\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\\n }\\n}\",\n \"function h$ghcjsbn_showBase(b, base) {\\n h$ghcjsbn_assertValid_b(b, \\\"showBase\\\");\\n h$ghcjsbn_assertValid_s(base, \\\"showBase\\\");\\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\\n return \\\"0\\\";\\n } else {\\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\\n }\\n}\",\n \"function h$ghcjsbn_showBase(b, base) {\\n h$ghcjsbn_assertValid_b(b, \\\"showBase\\\");\\n h$ghcjsbn_assertValid_s(base, \\\"showBase\\\");\\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\\n return \\\"0\\\";\\n } else {\\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\\n }\\n}\",\n \"function h$ghcjsbn_showBase(b, base) {\\n h$ghcjsbn_assertValid_b(b, \\\"showBase\\\");\\n h$ghcjsbn_assertValid_s(base, \\\"showBase\\\");\\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === 1) {\\n return \\\"0\\\";\\n } else {\\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\\n }\\n}\",\n \"function convertBase(str, fromBase, toBase) {\\n const digits = parseToDigitsArray(str, fromBase);\\n if (digits === null) return null;\\n\\n let outArray = [];\\n let power = [1];\\n for (let i = 0; i < digits.length; i += 1) {\\n // invariant: at this point, fromBase^i = power\\n if (digits[i]) {\\n outArray = add(outArray, multiplyByNumber(digits[i], power, toBase), toBase);\\n }\\n power = multiplyByNumber(fromBase, power, toBase);\\n }\\n\\n let out = '';\\n for (let i = outArray.length - 1; i >= 0; i -= 1) {\\n out += outArray[i].toString(toBase);\\n }\\n // if the original input was equivalent to zero, then 'out' will still be empty ''. Let's check for zero.\\n if (out === '') {\\n let sum = 0;\\n for (let i = 0; i < digits.length; i += 1) {\\n sum += digits[i];\\n }\\n if (sum === 0) out = '0';\\n }\\n\\n return out;\\n}\",\n \"function base(dec, base) {\\n var len = base.length;\\n var ret = '';\\n while(dec > 0) {\\n ret = base.charAt(dec % len) + ret;\\n dec = Math.floor(dec / len);\\n }\\n return ret;\\n}\",\n \"function $builtin_base_convert_helper(obj, base) {\\n var prefix = \\\"\\\";\\n switch(base){\\n case 2:\\n prefix = '0b'; break\\n case 8:\\n prefix = '0o'; break\\n case 16:\\n prefix = '0x'; break\\n default:\\n console.log('invalid base:' + base)\\n }\\n\\n if(obj.__class__ === $B.long_int){\\n var res = prefix + obj.value.toString(base)\\n return res\\n }\\n\\n var value = $B.$GetInt(obj)\\n\\n if(value === undefined){\\n // need to raise an error\\n throw _b_.TypeError.$factory('Error, argument must be an integer or' +\\n ' contains an __index__ function')\\n }\\n\\n if(value >= 0){return prefix + value.toString(base)}\\n return '-' + prefix + (-value).toString(base)\\n}\",\n \"function h$ghcjsbn_showBase(b, base) {\\n ASSERTVALID_B(b, \\\"showBase\\\");\\n ASSERTVALID_S(base, \\\"showBase\\\");\\n if(h$ghcjsbn_cmp_bb(b, h$ghcjsbn_zero_b) === GHCJSBN_EQ) {\\n return \\\"0\\\";\\n } else {\\n return h$ghcjsbn_showBase_rec(b, base, Math.log(base), 0);\\n }\\n}\",\n \"function toBaseOut(str,baseIn,baseOut,alphabet){var j,arr=[0],arrL,i=0,len=str.length;for(;ibaseOut-1){if(arr[j+1]==null)arr[j+1]=0;arr[j+1]+=arr[j]/baseOut|0;arr[j]%=baseOut}}}return arr.reverse()}// Convert a numeric string of baseIn to a numeric string of baseOut.\",\n \"function decimalToBase(decNumber, base) {\\n if (!Number.isInteger(decNumber) || !Number.isInteger(base)) {\\n throw TypeError('input number is not an integer');\\n }\\n if (!(base >= 2 && base <= 36)) {\\n throw Error('invalid base')\\n }\\n\\n const remStack = new Stack();\\n const digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\\n\\n let number = decNumber;\\n let rem;\\n let stringified = '';\\n\\n while (number > 0) {\\n rem = number % base;\\n remStack.push(rem);\\n number = Math.floor(number / base);\\n }\\n\\n while (!remStack.isEmpty()) {\\n stringified += digits[remStack.pop()].toString();\\n }\\n\\n return stringified;\\n}\",\n \"toBase(value, b = 62) {\\n let r = value % b;\\n let result = base[r];\\n let q = Math.floor(value / b);\\n while (q) {\\n r = q % b;\\n q = Math.floor(q / b);\\n result = base[r] + result;\\n }\\n return result;\\n }\",\n \"function baseConvert(obj, begBase, endBase ){\\n if (begBase < 2 && endBase > 36){\\n throw new Error(\\\"Bases are not valid\\\");\\n }else {\\n return parseInt(obj, begBase).toString(endBase);\\n }\\n}\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n\\t var d, e, k, r, x, xc, y,\\n\\t i = str.indexOf( '.' ),\\n\\t dp = DECIMAL_PLACES,\\n\\t rm = ROUNDING_MODE;\\n\\n\\t if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n\\t // Non-integer.\\n\\t if ( i >= 0 ) {\\n\\t k = POW_PRECISION;\\n\\n\\t // Unlimited precision.\\n\\t POW_PRECISION = 0;\\n\\t str = str.replace( '.', '' );\\n\\t y = new BigNumber(baseIn);\\n\\t x = y.pow( str.length - i );\\n\\t POW_PRECISION = k;\\n\\n\\t // Convert str as if an integer, then restore the fraction part by dividing the\\n\\t // result by its base raised to a power.\\n\\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n\\t y.e = y.c.length;\\n\\t }\\n\\n\\t // Convert the number as integer.\\n\\t xc = toBaseOut( str, baseIn, baseOut );\\n\\t e = k = xc.length;\\n\\n\\t // Remove trailing zeros.\\n\\t for ( ; xc[--k] == 0; xc.pop() );\\n\\t if ( !xc[0] ) return '0';\\n\\n\\t if ( i < 0 ) {\\n\\t --e;\\n\\t } else {\\n\\t x.c = xc;\\n\\t x.e = e;\\n\\n\\t // sign is needed for correct rounding.\\n\\t x.s = sign;\\n\\t x = div( x, y, dp, rm, baseOut );\\n\\t xc = x.c;\\n\\t r = x.r;\\n\\t e = x.e;\\n\\t }\\n\\n\\t d = e + dp + 1;\\n\\n\\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n\\t i = xc[d];\\n\\t k = baseOut / 2;\\n\\t r = r || d < 0 || xc[d + 1] != null;\\n\\n\\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n\\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n\\t rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n\\t if ( d < 1 || !xc[0] ) {\\n\\n\\t // 1^-dp or 0.\\n\\t str = r ? toFixedPoint( '1', -dp ) : '0';\\n\\t } else {\\n\\t xc.length = d;\\n\\n\\t if (r) {\\n\\n\\t // Rounding up may mean the previous digit has to be rounded up and so on.\\n\\t for ( --baseOut; ++xc[--d] > baseOut; ) {\\n\\t xc[d] = 0;\\n\\n\\t if ( !d ) {\\n\\t ++e;\\n\\t xc.unshift(1);\\n\\t }\\n\\t }\\n\\t }\\n\\n\\t // Determine trailing zeros.\\n\\t for ( k = xc.length; !xc[--k]; );\\n\\n\\t // E.g. [4, 11, 15] becomes 4bf.\\n\\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n\\t str = toFixedPoint( str, e );\\n\\t }\\n\\n\\t // The caller will add the sign.\\n\\t return str;\\n\\t }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n\\t var d, e, k, r, x, xc, y,\\n\\t i = str.indexOf( '.' ),\\n\\t dp = DECIMAL_PLACES,\\n\\t rm = ROUNDING_MODE;\\n\\n\\t if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n\\t // Non-integer.\\n\\t if ( i >= 0 ) {\\n\\t k = POW_PRECISION;\\n\\n\\t // Unlimited precision.\\n\\t POW_PRECISION = 0;\\n\\t str = str.replace( '.', '' );\\n\\t y = new BigNumber(baseIn);\\n\\t x = y.pow( str.length - i );\\n\\t POW_PRECISION = k;\\n\\n\\t // Convert str as if an integer, then restore the fraction part by dividing the\\n\\t // result by its base raised to a power.\\n\\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n\\t y.e = y.c.length;\\n\\t }\\n\\n\\t // Convert the number as integer.\\n\\t xc = toBaseOut( str, baseIn, baseOut );\\n\\t e = k = xc.length;\\n\\n\\t // Remove trailing zeros.\\n\\t for ( ; xc[--k] == 0; xc.pop() );\\n\\t if ( !xc[0] ) return '0';\\n\\n\\t if ( i < 0 ) {\\n\\t --e;\\n\\t } else {\\n\\t x.c = xc;\\n\\t x.e = e;\\n\\n\\t // sign is needed for correct rounding.\\n\\t x.s = sign;\\n\\t x = div( x, y, dp, rm, baseOut );\\n\\t xc = x.c;\\n\\t r = x.r;\\n\\t e = x.e;\\n\\t }\\n\\n\\t d = e + dp + 1;\\n\\n\\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n\\t i = xc[d];\\n\\t k = baseOut / 2;\\n\\t r = r || d < 0 || xc[d + 1] != null;\\n\\n\\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n\\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n\\t rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n\\t if ( d < 1 || !xc[0] ) {\\n\\n\\t // 1^-dp or 0.\\n\\t str = r ? toFixedPoint( '1', -dp ) : '0';\\n\\t } else {\\n\\t xc.length = d;\\n\\n\\t if (r) {\\n\\n\\t // Rounding up may mean the previous digit has to be rounded up and so on.\\n\\t for ( --baseOut; ++xc[--d] > baseOut; ) {\\n\\t xc[d] = 0;\\n\\n\\t if ( !d ) {\\n\\t ++e;\\n\\t xc.unshift(1);\\n\\t }\\n\\t }\\n\\t }\\n\\n\\t // Determine trailing zeros.\\n\\t for ( k = xc.length; !xc[--k]; );\\n\\n\\t // E.g. [4, 11, 15] becomes 4bf.\\n\\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n\\t str = toFixedPoint( str, e );\\n\\t }\\n\\n\\t // The caller will add the sign.\\n\\t return str;\\n\\t }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n\\t var d, e, k, r, x, xc, y,\\n\\t i = str.indexOf( '.' ),\\n\\t dp = DECIMAL_PLACES,\\n\\t rm = ROUNDING_MODE;\\n\\t\\n\\t if ( baseIn < 37 ) str = str.toLowerCase();\\n\\t\\n\\t // Non-integer.\\n\\t if ( i >= 0 ) {\\n\\t k = POW_PRECISION;\\n\\t\\n\\t // Unlimited precision.\\n\\t POW_PRECISION = 0;\\n\\t str = str.replace( '.', '' );\\n\\t y = new BigNumber(baseIn);\\n\\t x = y.pow( str.length - i );\\n\\t POW_PRECISION = k;\\n\\t\\n\\t // Convert str as if an integer, then restore the fraction part by dividing the\\n\\t // result by its base raised to a power.\\n\\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n\\t y.e = y.c.length;\\n\\t }\\n\\t\\n\\t // Convert the number as integer.\\n\\t xc = toBaseOut( str, baseIn, baseOut );\\n\\t e = k = xc.length;\\n\\t\\n\\t // Remove trailing zeros.\\n\\t for ( ; xc[--k] == 0; xc.pop() );\\n\\t if ( !xc[0] ) return '0';\\n\\t\\n\\t if ( i < 0 ) {\\n\\t --e;\\n\\t } else {\\n\\t x.c = xc;\\n\\t x.e = e;\\n\\t\\n\\t // sign is needed for correct rounding.\\n\\t x.s = sign;\\n\\t x = div( x, y, dp, rm, baseOut );\\n\\t xc = x.c;\\n\\t r = x.r;\\n\\t e = x.e;\\n\\t }\\n\\t\\n\\t d = e + dp + 1;\\n\\t\\n\\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n\\t i = xc[d];\\n\\t k = baseOut / 2;\\n\\t r = r || d < 0 || xc[d + 1] != null;\\n\\t\\n\\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n\\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n\\t rm == ( x.s < 0 ? 8 : 7 ) );\\n\\t\\n\\t if ( d < 1 || !xc[0] ) {\\n\\t\\n\\t // 1^-dp or 0.\\n\\t str = r ? toFixedPoint( '1', -dp ) : '0';\\n\\t } else {\\n\\t xc.length = d;\\n\\t\\n\\t if (r) {\\n\\t\\n\\t // Rounding up may mean the previous digit has to be rounded up and so on.\\n\\t for ( --baseOut; ++xc[--d] > baseOut; ) {\\n\\t xc[d] = 0;\\n\\t\\n\\t if ( !d ) {\\n\\t ++e;\\n\\t xc.unshift(1);\\n\\t }\\n\\t }\\n\\t }\\n\\t\\n\\t // Determine trailing zeros.\\n\\t for ( k = xc.length; !xc[--k]; );\\n\\t\\n\\t // E.g. [4, 11, 15] becomes 4bf.\\n\\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n\\t str = toFixedPoint( str, e );\\n\\t }\\n\\t\\n\\t // The caller will add the sign.\\n\\t return str;\\n\\t }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n\\t var d, e, k, r, x, xc, y,\\n\\t i = str.indexOf( '.' ),\\n\\t dp = DECIMAL_PLACES,\\n\\t rm = ROUNDING_MODE;\\n\\t\\n\\t if ( baseIn < 37 ) str = str.toLowerCase();\\n\\t\\n\\t // Non-integer.\\n\\t if ( i >= 0 ) {\\n\\t k = POW_PRECISION;\\n\\t\\n\\t // Unlimited precision.\\n\\t POW_PRECISION = 0;\\n\\t str = str.replace( '.', '' );\\n\\t y = new BigNumber(baseIn);\\n\\t x = y.pow( str.length - i );\\n\\t POW_PRECISION = k;\\n\\t\\n\\t // Convert str as if an integer, then restore the fraction part by dividing the\\n\\t // result by its base raised to a power.\\n\\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n\\t y.e = y.c.length;\\n\\t }\\n\\t\\n\\t // Convert the number as integer.\\n\\t xc = toBaseOut( str, baseIn, baseOut );\\n\\t e = k = xc.length;\\n\\t\\n\\t // Remove trailing zeros.\\n\\t for ( ; xc[--k] == 0; xc.pop() );\\n\\t if ( !xc[0] ) return '0';\\n\\t\\n\\t if ( i < 0 ) {\\n\\t --e;\\n\\t } else {\\n\\t x.c = xc;\\n\\t x.e = e;\\n\\t\\n\\t // sign is needed for correct rounding.\\n\\t x.s = sign;\\n\\t x = div( x, y, dp, rm, baseOut );\\n\\t xc = x.c;\\n\\t r = x.r;\\n\\t e = x.e;\\n\\t }\\n\\t\\n\\t d = e + dp + 1;\\n\\t\\n\\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n\\t i = xc[d];\\n\\t k = baseOut / 2;\\n\\t r = r || d < 0 || xc[d + 1] != null;\\n\\t\\n\\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n\\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n\\t rm == ( x.s < 0 ? 8 : 7 ) );\\n\\t\\n\\t if ( d < 1 || !xc[0] ) {\\n\\t\\n\\t // 1^-dp or 0.\\n\\t str = r ? toFixedPoint( '1', -dp ) : '0';\\n\\t } else {\\n\\t xc.length = d;\\n\\t\\n\\t if (r) {\\n\\t\\n\\t // Rounding up may mean the previous digit has to be rounded up and so on.\\n\\t for ( --baseOut; ++xc[--d] > baseOut; ) {\\n\\t xc[d] = 0;\\n\\t\\n\\t if ( !d ) {\\n\\t ++e;\\n\\t xc = [1].concat(xc);\\n\\t }\\n\\t }\\n\\t }\\n\\t\\n\\t // Determine trailing zeros.\\n\\t for ( k = xc.length; !xc[--k]; );\\n\\t\\n\\t // E.g. [4, 11, 15] becomes 4bf.\\n\\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n\\t str = toFixedPoint( str, e );\\n\\t }\\n\\t\\n\\t // The caller will add the sign.\\n\\t return str;\\n\\t }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n\\t var d, e, k, r, x, xc, y,\\r\\n\\t i = str.indexOf( '.' ),\\r\\n\\t dp = DECIMAL_PLACES,\\r\\n\\t rm = ROUNDING_MODE;\\r\\n\\r\\n\\t if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n\\t // Non-integer.\\r\\n\\t if ( i >= 0 ) {\\r\\n\\t k = POW_PRECISION;\\r\\n\\r\\n\\t // Unlimited precision.\\r\\n\\t POW_PRECISION = 0;\\r\\n\\t str = str.replace( '.', '' );\\r\\n\\t y = new BigNumber(baseIn);\\r\\n\\t x = y.pow( str.length - i );\\r\\n\\t POW_PRECISION = k;\\r\\n\\r\\n\\t // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n\\t // result by its base raised to a power.\\r\\n\\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n\\t y.e = y.c.length;\\r\\n\\t }\\r\\n\\r\\n\\t // Convert the number as integer.\\r\\n\\t xc = toBaseOut( str, baseIn, baseOut );\\r\\n\\t e = k = xc.length;\\r\\n\\r\\n\\t // Remove trailing zeros.\\r\\n\\t for ( ; xc[--k] == 0; xc.pop() );\\r\\n\\t if ( !xc[0] ) return '0';\\r\\n\\r\\n\\t if ( i < 0 ) {\\r\\n\\t --e;\\r\\n\\t } else {\\r\\n\\t x.c = xc;\\r\\n\\t x.e = e;\\r\\n\\r\\n\\t // sign is needed for correct rounding.\\r\\n\\t x.s = sign;\\r\\n\\t x = div( x, y, dp, rm, baseOut );\\r\\n\\t xc = x.c;\\r\\n\\t r = x.r;\\r\\n\\t e = x.e;\\r\\n\\t }\\r\\n\\r\\n\\t d = e + dp + 1;\\r\\n\\r\\n\\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n\\t i = xc[d];\\r\\n\\t k = baseOut / 2;\\r\\n\\t r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n\\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n\\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n\\t rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n\\t if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n\\t // 1^-dp or 0.\\r\\n\\t str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n\\t } else {\\r\\n\\t xc.length = d;\\r\\n\\r\\n\\t if (r) {\\r\\n\\r\\n\\t // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n\\t for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n\\t xc[d] = 0;\\r\\n\\r\\n\\t if ( !d ) {\\r\\n\\t ++e;\\r\\n\\t xc.unshift(1);\\r\\n\\t }\\r\\n\\t }\\r\\n\\t }\\r\\n\\r\\n\\t // Determine trailing zeros.\\r\\n\\t for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n\\t // E.g. [4, 11, 15] becomes 4bf.\\r\\n\\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n\\t str = toFixedPoint( str, e );\\r\\n\\t }\\r\\n\\r\\n\\t // The caller will add the sign.\\r\\n\\t return str;\\r\\n\\t }\",\n \"function convertBase(str, baseIn, baseOut) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n strL = str.length;\\n\\n for (; i < strL;) {\\n for (arrL = arr.length; arrL--;) {arr[arrL] *= baseIn;}\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\n for (j = 0; j < arr.length; j++) {\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n }\",\n \"function convertFromBaseTenToBaseX( xbase, inval ) {\\n\\n return inval.toString( xbase ).toUpperCase();\\n\\n /* let xinval = inval;\\n let remainder = hexidecimal[ xinval % xbase ];\\n while ( xinval >= xbase ) {\\n let r1 = subtract( xinval, ( xinval % xbase ) );\\n xinval = divide( r1, xbase );\\n // in this case we do not want to add we want to append the strings together\\n if ( xinval >= xbase ) {\\n remainder = hexidecimal[ xinval % xbase ] + remainder;\\n } else {\\n remainder = hexidecimal[ xinval ] + remainder;\\n }\\n }\\n return remainder; */\\n}\",\n \"function dec_to_bho(number, change_base) {\\n if (change_base == B ){\\n return parseInt(number + '', 10)\\n .toString(2);} else\\n if (change_base == H ){\\n return parseInt(number + '', 10)\\n .toString(8);} else \\n if (change_base == O ){\\n return parseInt(number + '', 10)\\n .toString(8);} else\\n console.log(\\\"pick H, B, or O\\\");\\n\\n }\",\n \"function convertBase(str, baseOut, baseIn, sign) {\\n var d,\\n e,\\n k,\\n r,\\n x,\\n xc,\\n y,\\n i = str.indexOf('.'),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if (baseIn < 37) str = str.toLowerCase();\\n\\n // Non-integer.\\n if (i >= 0) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace('.', '');\\n y = new BigNumber(baseIn);\\n x = y.pow(str.length - i);\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e), 10, baseOut);\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut(str, baseIn, baseOut);\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for (; xc[--k] == 0; xc.pop()) {}\\n if (!xc[0]) return '0';\\n\\n if (i < 0) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div(x, y, dp, rm, baseOut);\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));\\n\\n if (d < 1 || !xc[0]) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint('1', -dp) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for (--baseOut; ++xc[--d] > baseOut;) {\\n xc[d] = 0;\\n\\n if (!d) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for (k = xc.length; !xc[--k];) {}\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for (i = 0, str = ''; i <= k; str += ALPHABET.charAt(xc[i++])) {}\\n str = toFixedPoint(str, e);\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase(str, baseOut, baseIn, sign) {\\n var d,\\n e,\\n k,\\n r,\\n x,\\n xc,\\n y,\\n i = str.indexOf('.'),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if (baseIn < 37) str = str.toLowerCase();\\n\\n // Non-integer.\\n if (i >= 0) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace('.', '');\\n y = new BigNumber(baseIn);\\n x = y.pow(str.length - i);\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e), 10, baseOut);\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut(str, baseIn, baseOut);\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for (; xc[--k] == 0; xc.pop()) {}\\n if (!xc[0]) return '0';\\n\\n if (i < 0) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div(x, y, dp, rm, baseOut);\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));\\n\\n if (d < 1 || !xc[0]) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint('1', -dp) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for (--baseOut; ++xc[--d] > baseOut;) {\\n xc[d] = 0;\\n\\n if (!d) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for (k = xc.length; !xc[--k];) {}\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for (i = 0, str = ''; i <= k; str += ALPHABET.charAt(xc[i++])) {}\\n str = toFixedPoint(str, e);\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase(str, baseOut, baseIn, sign) {\\n var d,\\n e,\\n k,\\n r,\\n x,\\n xc,\\n y,\\n i = str.indexOf('.'),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n if (baseIn < 37) str = str.toLowerCase(); // Non-integer.\\n\\n if (i >= 0) {\\n k = POW_PRECISION; // Unlimited precision.\\n\\n POW_PRECISION = 0;\\n str = str.replace('.', '');\\n y = new BigNumber(baseIn);\\n x = y.pow(str.length - i);\\n POW_PRECISION = k; // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n\\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e), 10, baseOut);\\n y.e = y.c.length;\\n } // Convert the number as integer.\\n\\n\\n xc = toBaseOut(str, baseIn, baseOut);\\n e = k = xc.length; // Remove trailing zeros.\\n\\n for (; xc[--k] == 0; xc.pop()) {\\n }\\n\\n if (!xc[0]) return '0';\\n\\n if (i < 0) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e; // sign is needed for correct rounding.\\n\\n x.s = sign;\\n x = div(x, y, dp, rm, baseOut);\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1; // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));\\n\\n if (d < 1 || !xc[0]) {\\n // 1^-dp or 0.\\n str = r ? toFixedPoint('1', -dp) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for (--baseOut; ++xc[--d] > baseOut;) {\\n xc[d] = 0;\\n\\n if (!d) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n } // Determine trailing zeros.\\n\\n\\n for (k = xc.length; !xc[--k];) {\\n } // E.g. [4, 11, 15] becomes 4bf.\\n\\n\\n for (i = 0, str = ''; i <= k; str += ALPHABET.charAt(xc[i++])) {\\n }\\n\\n str = toFixedPoint(str, e);\\n } // The caller will add the sign.\\n\\n\\n return str;\\n } // Perform division in the specified base. Called by div and convertBase.\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc = [1].concat(xc);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\n var d, e, k, r, x, xc, y,\\n i = str.indexOf( '.' ),\\n dp = DECIMAL_PLACES,\\n rm = ROUNDING_MODE;\\n\\n if ( baseIn < 37 ) str = str.toLowerCase();\\n\\n // Non-integer.\\n if ( i >= 0 ) {\\n k = POW_PRECISION;\\n\\n // Unlimited precision.\\n POW_PRECISION = 0;\\n str = str.replace( '.', '' );\\n y = new BigNumber(baseIn);\\n x = y.pow( str.length - i );\\n POW_PRECISION = k;\\n\\n // Convert str as if an integer, then restore the fraction part by dividing the\\n // result by its base raised to a power.\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\n y.e = y.c.length;\\n }\\n\\n // Convert the number as integer.\\n xc = toBaseOut( str, baseIn, baseOut );\\n e = k = xc.length;\\n\\n // Remove trailing zeros.\\n for ( ; xc[--k] == 0; xc.pop() );\\n if ( !xc[0] ) return '0';\\n\\n if ( i < 0 ) {\\n --e;\\n } else {\\n x.c = xc;\\n x.e = e;\\n\\n // sign is needed for correct rounding.\\n x.s = sign;\\n x = div( x, y, dp, rm, baseOut );\\n xc = x.c;\\n r = x.r;\\n e = x.e;\\n }\\n\\n d = e + dp + 1;\\n\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\n i = xc[d];\\n k = baseOut / 2;\\n r = r || d < 0 || xc[d + 1] != null;\\n\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\n rm == ( x.s < 0 ? 8 : 7 ) );\\n\\n if ( d < 1 || !xc[0] ) {\\n\\n // 1^-dp or 0.\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\n } else {\\n xc.length = d;\\n\\n if (r) {\\n\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\n xc[d] = 0;\\n\\n if ( !d ) {\\n ++e;\\n xc.unshift(1);\\n }\\n }\\n }\\n\\n // Determine trailing zeros.\\n for ( k = xc.length; !xc[--k]; );\\n\\n // E.g. [4, 11, 15] becomes 4bf.\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\n str = toFixedPoint( str, e );\\n }\\n\\n // The caller will add the sign.\\n return str;\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n\\t\\t var d, e, k, r, x, xc, y,\\r\\n\\t\\t i = str.indexOf( '.' ),\\r\\n\\t\\t dp = DECIMAL_PLACES,\\r\\n\\t\\t rm = ROUNDING_MODE;\\r\\n\\t\\t\\r\\n\\t\\t if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\t\\t\\r\\n\\t\\t // Non-integer.\\r\\n\\t\\t if ( i >= 0 ) {\\r\\n\\t\\t k = POW_PRECISION;\\r\\n\\t\\t\\r\\n\\t\\t // Unlimited precision.\\r\\n\\t\\t POW_PRECISION = 0;\\r\\n\\t\\t str = str.replace( '.', '' );\\r\\n\\t\\t y = new BigNumber(baseIn);\\r\\n\\t\\t x = y.pow( str.length - i );\\r\\n\\t\\t POW_PRECISION = k;\\r\\n\\t\\t\\r\\n\\t\\t // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n\\t\\t // result by its base raised to a power.\\r\\n\\t\\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n\\t\\t y.e = y.c.length;\\r\\n\\t\\t }\\r\\n\\t\\t\\r\\n\\t\\t // Convert the number as integer.\\r\\n\\t\\t xc = toBaseOut( str, baseIn, baseOut );\\r\\n\\t\\t e = k = xc.length;\\r\\n\\t\\t\\r\\n\\t\\t // Remove trailing zeros.\\r\\n\\t\\t for ( ; xc[--k] == 0; xc.pop() );\\r\\n\\t\\t if ( !xc[0] ) return '0';\\r\\n\\t\\t\\r\\n\\t\\t if ( i < 0 ) {\\r\\n\\t\\t --e;\\r\\n\\t\\t } else {\\r\\n\\t\\t x.c = xc;\\r\\n\\t\\t x.e = e;\\r\\n\\t\\t\\r\\n\\t\\t // sign is needed for correct rounding.\\r\\n\\t\\t x.s = sign;\\r\\n\\t\\t x = div( x, y, dp, rm, baseOut );\\r\\n\\t\\t xc = x.c;\\r\\n\\t\\t r = x.r;\\r\\n\\t\\t e = x.e;\\r\\n\\t\\t }\\r\\n\\t\\t\\r\\n\\t\\t d = e + dp + 1;\\r\\n\\t\\t\\r\\n\\t\\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n\\t\\t i = xc[d];\\r\\n\\t\\t k = baseOut / 2;\\r\\n\\t\\t r = r || d < 0 || xc[d + 1] != null;\\r\\n\\t\\t\\r\\n\\t\\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n\\t\\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n\\t\\t rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\t\\t\\r\\n\\t\\t if ( d < 1 || !xc[0] ) {\\r\\n\\t\\t\\r\\n\\t\\t // 1^-dp or 0.\\r\\n\\t\\t str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n\\t\\t } else {\\r\\n\\t\\t xc.length = d;\\r\\n\\t\\t\\r\\n\\t\\t if (r) {\\r\\n\\t\\t\\r\\n\\t\\t // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n\\t\\t for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n\\t\\t xc[d] = 0;\\r\\n\\t\\t\\r\\n\\t\\t if ( !d ) {\\r\\n\\t\\t ++e;\\r\\n\\t\\t xc.unshift(1);\\r\\n\\t\\t }\\r\\n\\t\\t }\\r\\n\\t\\t }\\r\\n\\t\\t\\r\\n\\t\\t // Determine trailing zeros.\\r\\n\\t\\t for ( k = xc.length; !xc[--k]; );\\r\\n\\t\\t\\r\\n\\t\\t // E.g. [4, 11, 15] becomes 4bf.\\r\\n\\t\\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n\\t\\t str = toFixedPoint( str, e );\\r\\n\\t\\t }\\r\\n\\t\\t\\r\\n\\t\\t // The caller will add the sign.\\r\\n\\t\\t return str;\\r\\n\\t\\t }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n}\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc = [1].concat(xc);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc.unshift(1);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc.unshift(1);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc.unshift(1);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc.unshift(1);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc = [1].concat(xc);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc.unshift(1);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase( str, baseOut, baseIn, sign ) {\\r\\n var d, e, k, r, x, xc, y,\\r\\n i = str.indexOf( '.' ),\\r\\n dp = DECIMAL_PLACES,\\r\\n rm = ROUNDING_MODE;\\r\\n\\r\\n if ( baseIn < 37 ) str = str.toLowerCase();\\r\\n\\r\\n // Non-integer.\\r\\n if ( i >= 0 ) {\\r\\n k = POW_PRECISION;\\r\\n\\r\\n // Unlimited precision.\\r\\n POW_PRECISION = 0;\\r\\n str = str.replace( '.', '' );\\r\\n y = new BigNumber(baseIn);\\r\\n x = y.pow( str.length - i );\\r\\n POW_PRECISION = k;\\r\\n\\r\\n // Convert str as if an integer, then restore the fraction part by dividing the\\r\\n // result by its base raised to a power.\\r\\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\\r\\n y.e = y.c.length;\\r\\n }\\r\\n\\r\\n // Convert the number as integer.\\r\\n xc = toBaseOut( str, baseIn, baseOut );\\r\\n e = k = xc.length;\\r\\n\\r\\n // Remove trailing zeros.\\r\\n for ( ; xc[--k] == 0; xc.pop() );\\r\\n if ( !xc[0] ) return '0';\\r\\n\\r\\n if ( i < 0 ) {\\r\\n --e;\\r\\n } else {\\r\\n x.c = xc;\\r\\n x.e = e;\\r\\n\\r\\n // sign is needed for correct rounding.\\r\\n x.s = sign;\\r\\n x = div( x, y, dp, rm, baseOut );\\r\\n xc = x.c;\\r\\n r = x.r;\\r\\n e = x.e;\\r\\n }\\r\\n\\r\\n d = e + dp + 1;\\r\\n\\r\\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\\r\\n i = xc[d];\\r\\n k = baseOut / 2;\\r\\n r = r || d < 0 || xc[d + 1] != null;\\r\\n\\r\\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\\r\\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\\r\\n rm == ( x.s < 0 ? 8 : 7 ) );\\r\\n\\r\\n if ( d < 1 || !xc[0] ) {\\r\\n\\r\\n // 1^-dp or 0.\\r\\n str = r ? toFixedPoint( '1', -dp ) : '0';\\r\\n } else {\\r\\n xc.length = d;\\r\\n\\r\\n if (r) {\\r\\n\\r\\n // Rounding up may mean the previous digit has to be rounded up and so on.\\r\\n for ( --baseOut; ++xc[--d] > baseOut; ) {\\r\\n xc[d] = 0;\\r\\n\\r\\n if ( !d ) {\\r\\n ++e;\\r\\n xc = [1].concat(xc);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n // Determine trailing zeros.\\r\\n for ( k = xc.length; !xc[--k]; );\\r\\n\\r\\n // E.g. [4, 11, 15] becomes 4bf.\\r\\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\\r\\n str = toFixedPoint( str, e );\\r\\n }\\r\\n\\r\\n // The caller will add the sign.\\r\\n return str;\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function numberToString(n, base) {\\n let result = '';\\n let sign = '';\\n if (n < 0) {\\n sign = '-';\\n n = -n;\\n }\\n do {\\n // convert the number into the given 'base'\\n // by repeatedly picking out the last digit and then dividing the number to get rid of this digit\\n result = String(n % base) + result;\\n n = Math.floor(n / base);\\n } while (n > 0);\\n return sign + result;\\n}\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n strL = str.length;\\r\\n\\r\\n for (; i < strL;) {\\r\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\r\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function convertBase(str, baseIn, baseOut) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n strL = str.length;\\n\\n for (; i < strL;) {\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\n for (j = 0; j < arr.length; j++) {\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n }\",\n \"function toBase10(number) {\\n\\n var x = number.toLowerCase();\\n Logger.debug(\\\"x = \\\" + x)\\n\\n if (!x.startsWith('0b') && !x.startsWith('0x') && parseInt(x, 10).toString(10) == x.replace(/^0+/, '')) {\\n Logger.debug('>>> Base 10: ' + parseInt(x, 10).toString(10) + ' = ' + x);\\n return parseInt(x, 10);\\n } else if (x.startsWith('0b') && (parseInt(x.substring(2), 2).toString(2) == x.substring(2).replace(/^0+/, ''))) {\\n Logger.debug('>>> Base 2: ' + parseInt(x.substring(2), 2).toString(2) + ' = ' + x.substring(2));\\n return parseInt(x.substring(2), 2);\\n } else if (x.startsWith('0x') && (parseInt(x.substring(2), 16).toString(16) == x.substring(2).replace(/^0+/, ''))) {\\n Logger.debug('>>> Base 16: ' + parseInt(x.substring(2), 16).toString(16) + ' = ' + x.substring(2));\\n return parseInt(x.substring(2), 16);\\n } else {\\n Logger.debug('>>> ???')\\n return NaN;\\n }\\n}\",\n \"function convertBase(str, baseIn, baseOut) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n strL = str.length;\\n\\n for (; i < strL;) {\\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\\n for (j = 0; j < arr.length; j++) {\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n }\",\n \"function toBinary(decNumber,base){\\n var remStack = new stacks(),\\n rem,\\n binarystring = '';\\n digits = '0123456789ABCDEF';\\n\\n while (decNumber>0) {\\n rem = Math.floor(decNumber%base);\\n remStack.push(rem);\\n decNumber = Math.floor(decNumber/base);\\n\\n }\\n\\nwhile (!remStack.isEmpty()) {\\n binarystring += digits[remStack.pop()];\\n}\\n return binarystring;\\n}\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n len = str.length;\\n\\n for (; i < len;) {\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {\\n ;\\n }\\n\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\n\\n for (j = 0; j < arr.length; j++) {\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n } // Convert a numeric string of baseIn to a numeric string of baseOut.\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n len = str.length;\\n\\n for (; i < len;) {\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\n\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\n\\n for (j = 0; j < arr.length; j++) {\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n } // Convert a numeric string of baseIn to a numeric string of baseOut.\",\n \"function util_frombase(input_buffer, input_base)\\n {\\n /// Convert number from 2^base to 2^10\\n /// Array of bytes representing the number to convert\\n /// The base of initial number\\n\\n var result = 0;\\n\\n for(var i = (input_buffer.length - 1); i >= 0; i-- )\\n result += input_buffer[(input_buffer.length - 1) - i] * Math.pow(2, input_base * i);\\n\\n return result;\\n }\",\n \"function baseConvert(faceValues, num) {\\n let base = faceValues.length;\\n let result = \\\"\\\";\\n if (num === 0) {\\n return faceValues[0];\\n }\\n while (num !== 0) {\\n let remainder = num % base;\\n result += faceValues[remainder]; // we got result from right to left, last digit is entered first, we need to reverse\\n let quotient = Math.floor(num / base);\\n num = quotient;\\n }\\n return reverseString(result);\\n}\",\n \"function conversaoBase(num,b1,b2){\\r\\n\\r\\n num = num.toString()\\r\\n numArr = num.split(\\\"\\\",num.length)\\r\\n virgPos = numArr.indexOf(\\\".\\\")\\r\\n \\r\\n console.log(virgPos)\\r\\n \\r\\n // numero com 'casa decimal'\\r\\n if(numArr.indexOf(\\\".\\\") != -1 )\\r\\n {\\r\\n console.log('quebrado')\\r\\n intSize = virgPos\\r\\n numArr.splice(virgPos, 1)\\r\\n decSize = (numArr.length) - (intSize)\\r\\n }\\r\\n //numero inteiro\\r\\n else if(numArr.indexOf(\\\".\\\") == -1)\\r\\n {\\r\\n console.log('inteiro')\\r\\n intSize = numArr.length\\r\\n decSize = 0 \\r\\n }\\r\\n\\r\\n numConcat = 0\\r\\n index = 0\\r\\n\\r\\n console.log(`Numero: ${numArr}`)\\r\\n console.log(`intSize: ${intSize}`)\\r\\n console.log(`decSize: ${decSize}`)\\r\\n \\r\\n // converte da base n1 para a base 10\\r\\n for(let i = intSize - 1; i>= (-1*decSize); i--)\\r\\n {\\r\\n numConcat = numConcat + numArr[index]*(Math.pow(b1,i))\\r\\n index++\\r\\n console.log(numConcat)\\r\\n }\\r\\n // retorna da base 10 para a base n2\\r\\n return numConcat.toString(b2)\\r\\n}\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n\\t\\t var j,\\r\\n\\t\\t arr = [0],\\r\\n\\t\\t arrL,\\r\\n\\t\\t i = 0,\\r\\n\\t\\t len = str.length;\\r\\n\\t\\t\\r\\n\\t\\t for ( ; i < len; ) {\\r\\n\\t\\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n\\t\\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\t\\t\\r\\n\\t\\t for ( ; j < arr.length; j++ ) {\\r\\n\\t\\t\\r\\n\\t\\t if ( arr[j] > baseOut - 1 ) {\\r\\n\\t\\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n\\t\\t arr[j + 1] += arr[j] / baseOut | 0;\\r\\n\\t\\t arr[j] %= baseOut;\\r\\n\\t\\t }\\r\\n\\t\\t }\\r\\n\\t\\t }\\r\\n\\t\\t\\r\\n\\t\\t return arr.reverse();\\r\\n\\t\\t }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n\\t var j,\\r\\n\\t arr = [0],\\r\\n\\t arrL,\\r\\n\\t i = 0,\\r\\n\\t len = str.length;\\r\\n\\r\\n\\t for ( ; i < len; ) {\\r\\n\\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n\\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n\\t for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n\\t if ( arr[j] > baseOut - 1 ) {\\r\\n\\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n\\t arr[j + 1] += arr[j] / baseOut | 0;\\r\\n\\t arr[j] %= baseOut;\\r\\n\\t }\\r\\n\\t }\\r\\n\\t }\\r\\n\\r\\n\\t return arr.reverse();\\r\\n\\t }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\n\\t var j,\\n\\t arr = [0],\\n\\t arrL,\\n\\t i = 0,\\n\\t len = str.length;\\n\\t\\n\\t for ( ; i < len; ) {\\n\\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\n\\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\n\\t\\n\\t for ( ; j < arr.length; j++ ) {\\n\\t\\n\\t if ( arr[j] > baseOut - 1 ) {\\n\\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\\n\\t arr[j + 1] += arr[j] / baseOut | 0;\\n\\t arr[j] %= baseOut;\\n\\t }\\n\\t }\\n\\t }\\n\\t\\n\\t return arr.reverse();\\n\\t }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\n\\t var j,\\n\\t arr = [0],\\n\\t arrL,\\n\\t i = 0,\\n\\t len = str.length;\\n\\t\\n\\t for ( ; i < len; ) {\\n\\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\n\\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\n\\t\\n\\t for ( ; j < arr.length; j++ ) {\\n\\t\\n\\t if ( arr[j] > baseOut - 1 ) {\\n\\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\\n\\t arr[j + 1] += arr[j] / baseOut | 0;\\n\\t arr[j] %= baseOut;\\n\\t }\\n\\t }\\n\\t }\\n\\t\\n\\t return arr.reverse();\\n\\t }\",\n \"function bigInt2str(x, base) {\\n var i, t, s = \\\"\\\";\\n\\n if (s6.length != x.length)\\n s6 = dup(x);\\n else\\n copy_(s6, x);\\n\\n if (base == -1) { //return the list of array contents\\n for (i = x.length - 1; i > 0; i--)\\n s += x[i] + ',';\\n s += x[0];\\n }\\n else { //return it in the given base\\n while (!isZero(s6)) {\\n t = divInt_(s6, base); //t=s6 % base; s6=floor(s6/base);\\n s = digitsStr.substring(t, t + 1) + s;\\n }\\n }\\n if (s.length == 0)\\n s = \\\"0\\\";\\n return s;\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\n\\t var j,\\n\\t arr = [0],\\n\\t arrL,\\n\\t i = 0,\\n\\t len = str.length;\\n\\n\\t for ( ; i < len; ) {\\n\\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\n\\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\n\\n\\t for ( ; j < arr.length; j++ ) {\\n\\n\\t if ( arr[j] > baseOut - 1 ) {\\n\\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\\n\\t arr[j + 1] += arr[j] / baseOut | 0;\\n\\t arr[j] %= baseOut;\\n\\t }\\n\\t }\\n\\t }\\n\\n\\t return arr.reverse();\\n\\t }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\n\\t var j,\\n\\t arr = [0],\\n\\t arrL,\\n\\t i = 0,\\n\\t len = str.length;\\n\\n\\t for ( ; i < len; ) {\\n\\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\n\\t arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\n\\n\\t for ( ; j < arr.length; j++ ) {\\n\\n\\t if ( arr[j] > baseOut - 1 ) {\\n\\t if ( arr[j + 1] == null ) arr[j + 1] = 0;\\n\\t arr[j + 1] += arr[j] / baseOut | 0;\\n\\t arr[j] %= baseOut;\\n\\t }\\n\\t }\\n\\t }\\n\\n\\t return arr.reverse();\\n\\t }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n len = str.length;\\n\\n for (; i < len;) {\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\n\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\n\\n for (j = 0; j < arr.length; j++) {\\n\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n }\",\n \"function baseChange(number, newBase) {\\n\\n var newNumber = \\\"\\\";\\n var myStack = new Stack();\\n while(number > 0) {\\n myStack.push(number%newBase);\\n number = Math.floor(number/newBase);\\n }\\n while(!myStack.isEmpty()) {\\n newNumber += myStack.pop();\\n }\\n return newNumber;\\n}\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut( str, baseIn, baseOut ) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for ( ; i < len; ) {\\r\\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\\r\\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\\r\\n\\r\\n for ( ; j < arr.length; j++ ) {\\r\\n\\r\\n if ( arr[j] > baseOut - 1 ) {\\r\\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n len = str.length;\\n\\n for (; i < len;) {\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {}\\n arr[j = 0] += ALPHABET.indexOf(str.charAt(i++));\\n\\n for (; j < arr.length; j++) {\\n\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n }\",\n \"function toBaseOut(str, baseIn, baseOut) {\\n var j,\\n arr = [0],\\n arrL,\\n i = 0,\\n len = str.length;\\n\\n for (; i < len;) {\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {}\\n arr[j = 0] += ALPHABET.indexOf(str.charAt(i++));\\n\\n for (; j < arr.length; j++) {\\n\\n if (arr[j] > baseOut - 1) {\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\n arr[j + 1] += arr[j] / baseOut | 0;\\n arr[j] %= baseOut;\\n }\\n }\\n }\\n\\n return arr.reverse();\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\",\n \"function toBaseOut(str, baseIn, baseOut, alphabet) {\\r\\n var j,\\r\\n arr = [0],\\r\\n arrL,\\r\\n i = 0,\\r\\n len = str.length;\\r\\n\\r\\n for (; i < len;) {\\r\\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\\r\\n\\r\\n arr[0] += alphabet.indexOf(str.charAt(i++));\\r\\n\\r\\n for (j = 0; j < arr.length; j++) {\\r\\n\\r\\n if (arr[j] > baseOut - 1) {\\r\\n if (arr[j + 1] == null) arr[j + 1] = 0;\\r\\n arr[j + 1] += arr[j] / baseOut | 0;\\r\\n arr[j] %= baseOut;\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n return arr.reverse();\\r\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.78933334","0.7787537","0.76196146","0.746665","0.74133676","0.7408443","0.7408443","0.7408443","0.7408443","0.7367569","0.7335649","0.72488385","0.7197895","0.7121101","0.7059255","0.7058206","0.69450194","0.6917524","0.6917524","0.68824667","0.68824667","0.68236697","0.6814816","0.6798944","0.6797506","0.67898643","0.67898643","0.67874205","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.67802835","0.6776346","0.67730635","0.6771581","0.6771581","0.6771581","0.6771581","0.6771581","0.6771581","0.6771581","0.6771581","0.67676973","0.6760945","0.67603624","0.67603624","0.67603624","0.67603624","0.67603624","0.67603624","0.67567784","0.675574","0.6753925","0.66673553","0.6662116","0.6609488","0.65580267","0.6555964","0.65552354","0.65265375","0.6452172","0.6449309","0.6449309","0.6428673","0.64064467","0.64064467","0.6396517","0.6389517","0.63818103","0.63818103","0.63818103","0.63818103","0.63818103","0.63818103","0.63818103","0.63818103","0.63793993","0.63793993","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372","0.6378372"],"string":"[\n \"0.78933334\",\n \"0.7787537\",\n \"0.76196146\",\n \"0.746665\",\n \"0.74133676\",\n \"0.7408443\",\n \"0.7408443\",\n \"0.7408443\",\n \"0.7408443\",\n \"0.7367569\",\n \"0.7335649\",\n \"0.72488385\",\n \"0.7197895\",\n \"0.7121101\",\n \"0.7059255\",\n \"0.7058206\",\n \"0.69450194\",\n \"0.6917524\",\n \"0.6917524\",\n \"0.68824667\",\n \"0.68824667\",\n \"0.68236697\",\n \"0.6814816\",\n \"0.6798944\",\n \"0.6797506\",\n \"0.67898643\",\n \"0.67898643\",\n \"0.67874205\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.67802835\",\n \"0.6776346\",\n \"0.67730635\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.6771581\",\n \"0.67676973\",\n \"0.6760945\",\n \"0.67603624\",\n \"0.67603624\",\n \"0.67603624\",\n \"0.67603624\",\n \"0.67603624\",\n \"0.67603624\",\n \"0.67567784\",\n \"0.675574\",\n \"0.6753925\",\n \"0.66673553\",\n \"0.6662116\",\n \"0.6609488\",\n \"0.65580267\",\n \"0.6555964\",\n \"0.65552354\",\n \"0.65265375\",\n \"0.6452172\",\n \"0.6449309\",\n \"0.6449309\",\n \"0.6428673\",\n \"0.64064467\",\n \"0.64064467\",\n \"0.6396517\",\n \"0.6389517\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63818103\",\n \"0.63793993\",\n \"0.63793993\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\",\n \"0.6378372\"\n]"},"document_score":{"kind":"string","value":"0.81513506"},"document_rank":{"kind":"string","value":"0"}}},{"rowIdx":29,"cells":{"query":{"kind":"string","value":"Redraw the HTML table when needed ( eg when we change the generation)"},"document":{"kind":"string","value":"function redrawHTMLGrid(grid, gridID) {\n var gridHTML = document.getElementById(gridID);\n for (var i = 0; i < height; i++) {\n for (var j = 0; j < width; j++) {\n var cell = gridHTML.rows[i].cells[j];\n if (grid[i][j])\n cell.className = \"selected\";\n else\n cell.className = \"\";\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":["function renderTable() {\n clearTable();\n showTable();\n}","function drawtable()\n{\n // going to use a template for this!\n\n // example table data row { id: \"CDL\", rank: 1949, \"change\": 23, \"winp\" : 84.4, \"run\" : \"wwwwwwwwww\" },\n\n // need in the item s_players,\n // {{:rank}}\n // {{:change}}\n // {{:id}} - initials\n // {{:record}} - win percentage\n // {{:gamerun}} - last ten games results\n\n // the template then executes for each of the elements in this.\n\n // what player do we want? URL format is player.html/INITIALS\n playerid = window.location.href.substring(window.location.href.indexOf('?')+1);\n opponents = get_player_opponents(all_results, playerid);\n player_results = get_player_results(all_results, playerid, opponents)[0];\n\n recent_player_results = get_results_to_display(player_results, playerid, recent_results_to_display);\n var recent_res_template = $.templates(\"#resultTemplate\");\n var htmlOutput = recent_res_template.render(recent_player_results);\n $(\"#rec_res_tbl\").html(htmlOutput);\n\n var opponents_template = $.templates(\"#opponentsTemplate\");\n var opponent_template = create_opponents_template(opponents);\n var htmlOutput = opponents_template.render(opponent_template);\n $(\"#opponents_tbl\").html(htmlOutput);\n\n head_to_head = document.getElementById(\"opp_res_tbl\");\n head_to_head.setAttribute(\"style\", \"height:\" + 15 * player_results.length + \"px\");\n\n slider = document.getElementById(\"head_to_head_range\");\n label = document.getElementById(\"results_output\");\n\n for (var ii = 0; ii < opponents.length; ii++)\n {\n checkbox = document.getElementById(\"opp_check_box_\" + opponents[ii]);\n checkbox.onchange = function() {\n redraw_head_to_head(slider.value);\n };\n }\n change_opponenet_check_boxes(false);\n\n label.value = slider.value; // Display the default slider value\n // Update the current slider value (each time you drag the slider handle)\n slider.oninput = function() {\n label.value = this.value;\n redraw_head_to_head(this.value);\n }\n\n}","function refreshTables() {\n\n\t\t$(\"#biomatcher-data-table\").html(\"
Subject IDOligo NameOligo SeqMismatch ToleranceHit Coordinates
\");\n\t}","redraw() {\n while (this.tbody.firstChild) {\n this.tbody.removeChild(this.tbody.firstChild);\n }\n var filteredRows = this.filterRows();\n var orderedRows = this.sortRows(filteredRows);\n orderedRows.forEach(row => {\n this.tbody.appendChild(row);\n });\n }","function refreshData(){\r\n\t\tvar myTable=$('#'+settings.table_id);\r\n\t\tmyTable.empty();\r\n\t\tmyTable.addClass('table');\r\n\t\tmyTable.addClass('table-bordered');\r\n\t\tmyTable.addClass('table-striped');\r\n\t\tmyTable.addClass('table-hover');\r\n\t\t//add head table\r\n\t\tvar head=$(\"\");\r\n\t\thead.append('\t\t\t\t\t\t\t\t');\r\n\t\tvar tr='';\r\n\t\tfor(var i=0;i'+settings.table_columns[i]+'';\r\n\t\t}\r\n\t\ttr+='';\r\n\t\thead.append(tr);\r\n\t\tmyTable.append(head);\r\n\t\t//add head row\r\n\t\tvar body=$('');\r\n\t\tvar rows=[];\r\n\t\tvar start=0;\r\n\t\tvar end=settings.table_data.length;\r\n\t\tif(settings.paging){\r\n\t\t\tstart=(settings.page-1)*settings.page_items;\r\n\t\t\tend=start+settings.page_items;\r\n\t\t\tif(end>settings.table_data.length){\r\n\t\t\t\tend=settings.table_data.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(var i=start;i'+accounting.formatNumber(row_data[j])+'';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='%'){\r\n\t\t\t\t\ttr+=''+accounting.formatNumber(row_data[j]*100,2)+'%';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='money'){\r\n\t\t\t\t\ttr+=''+accounting.formatMoney(row_data[j])+'';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='short date'){\r\n\t\t\t\t\t\ttr+=''+verveDateConvert(row_data[j]).format('mmm dd')+'';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='date'){\r\n\t\t\t\t\t\ttr+=''+verveDateConvert(row_data[j]).format('yyyy-mm-dd')+'';\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttr+=''+row_data[j]+'';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\ttr+='';\r\n\t\t\trows.push(tr);\r\n\t\t}\r\n\t\tbody.append(rows.join(''));\r\n\t\tmyTable.append(body);\t\r\n\t\t\r\n\t\t//add class sort\r\n\t\tif(settings.sort_by!=''){\r\n\t\t\tvar headArray=myTable.find(\"thead tr th.header[title='\"+settings.sort_by+\"']\").addClass('sort');\r\n\t\t\tif(settings.sort_type=='asc'){\r\n\t\t\t\tmyTable.find(\"thead tr th.header i\").removeClass();\r\n\t\t\t\tmyTable.find(\"thead tr th.header[title='\"+settings.sort_by+\"'] i\").addClass('fa fa-sort-alpha-asc');\r\n\t\t\t}else{\r\n\t\t\t\tmyTable.find(\"thead tr th.header i\").removeClass();\r\n\t\t\t\tmyTable.find(\"thead tr th.header[title='\"+settings.sort_by+\"'] i\").addClass('fa fa-sort-alpha-desc');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t//add sort event\r\n\t\tif(settings.sortable){\r\n\t\t\tmyTable.find(\"thead tr th.header\").click(function(){\r\n\t\t\t\tsettings.sort_by=$(this).attr('title');\r\n\t\t\t\tsort($(this).attr('title'));\r\n\t\t\t});\r\n\t\t}\r\n\t\t//Add onClick Event\r\n\t\tmyTable.find(\"tbody tr\").click(function(){\r\n\t\t\tvar tr=$(this);\r\n\t\t\tvar row=[];\r\n\t\t\ttr.find(\"td\").each(function(){\r\n\t\t\t\trow.push($(this).html());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tsettings.onClickRow(row);\r\n\t\t});\r\n\t\t//\r\n\t\t$('a').click(function(event){\r\n\t\t\tconsole.log();\r\n\t\t\tif($(this).attr('href')=='#'){\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t}","function renderTable() {\n $tbody.innerHTML = \"\";\n console.log(\"rendering\")\n\n for (var i = 0; i < tableData.length; i++) {\n // Get get the current UFO info object and its fields\n var ufoinfo = tableData[i];\n var field = Object.keys(ufoinfo);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < field.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = ufo[field];\n }\n } \n}","function drawTable() {\n var stat = getState(cm);\n _replaceSelection(cm, stat.table, insertTexts.table);\n}","function _redrawTable() {\n if (!_results) {\n return;\n }\n\n var rows = '';\n for (var i in _results) {\n var responder = _results[i];\n rows += '' +\n '' + responder.name + '' +\n '' + responder.occupation + '' +\n '' + responder.city + ', ' + responder.state + '' +\n '' + responder.status + '' +\n '';\n }\n\n $('#responder_results tbody').html(rows);\n }","function redrawTable() {\n if ($scope.redraw) {\n return;\n }\n // reset display styles so column widths are correct when measured below\n angular.element(elem.querySelectorAll('thead, tbody, tfoot')).css('display', '');\n // wrap in $timeout to give table a chance to finish rendering\n $timeout(function () {\n $scope.redraw = true;\n // set widths of columns\n var totalColumnWidth = 0;\n angular.forEach(elem.querySelectorAll('tr:first-child th'), function (thElem, i) {\n var tdElems = elem.querySelector('tbody tr:first-child td:nth-child(' + (i + 1) + ')');\n var tfElems = elem.querySelector('tfoot tr:first-child td:nth-child(' + (i + 1) + ')');\n var columnWidth = Math.ceil(elem.querySelectorAll('thead')[0].offsetWidth / (elem.querySelectorAll('thead th').length || 1));\n if (tdElems) {\n tdElems.style.width = columnWidth + 'px';\n }\n if (thElem) {\n thElem.style.width = columnWidth + 'px';\n }\n if (tfElems) {\n tfElems.style.width = columnWidth + 'px';\n }\n totalColumnWidth = totalColumnWidth + columnWidth;\n });\n // set css styles on thead and tbody\n angular.element(elem.querySelectorAll('thead, tfoot')).css('display', 'block');\n angular.element(elem.querySelectorAll('tbody')).css({\n 'display': 'block',\n 'max-height': $scope.tableMaxHeight || 'inherit',\n 'overflow': 'auto'\n });\n // add missing width to fill the table\n if (totalColumnWidth < elem.offsetWidth) {\n var last = elem.querySelector('tbody tr:first-child td:last-child');\n if (last) {\n last.style.width = (last.offsetWidth + elem.offsetWidth - totalColumnWidth) + 'px';\n last = elem.querySelector('thead tr:first-child th:last-child');\n last.style.width = (last.offsetWidth + elem.offsetWidth - totalColumnWidth) + 'px';\n }\n }\n // reduce width of last column by width of scrollbar\n var tbody = elem.querySelector('tbody');\n var scrollBarWidth = tbody.offsetWidth - tbody.clientWidth;\n if (scrollBarWidth > 0) {\n var lastColumn = elem.querySelector('tbody tr:first-child td:last-child');\n lastColumn.style.width = (parseInt(lastColumn.style.width.replace('px', '')) - scrollBarWidth) + 'px';\n }\n $scope.redraw = false;\n });\n }","updateBody() {\n this.tableBody.innerHTML = '';\n\n if (!this.sortedData.length) {\n let row = this.buildRow('Nothing found', true);\n\n this.tableBody.appendChild(row);\n }\n\n else {\n for (let i = 0; i < this.sortedData.length; i++) {\n let row = this.buildRow(this.sortedData[i]);\n\n this.tableBody.appendChild(row);\n }\n }\n\n this.buildStatistics();\n }","table() {\n this.showtable= ! this.showtable;\n //workaround - table width is incorect when rendered hidden\n //render it after 100 ms again, usually after it is shown, thus calculating\n //correct width\n if (this.showtable) window.setTimeout(function(that){that.ht2.render()},100,this);\n }","function render() {\n\tconsole.log(indicatorData);\n\n\td3.select('table#mipex tbody')\n\t\t.selectAll('tr')\n\t\t.data(indicatorData)\n\t\t.enter()\n\t\t.append('tr')\n\t\t\t.html(rowTemplate);\n\n\t// Inform parent frame of new height\n\tfm.resize()\n}","function redoTableRows() {\n let d3tbody = d3.select(\"tbody\");\n d3tbody.html(\"\");\n generateTableBody(tbody, data, dateText, cityText, stateSelected, shapeSelected)\n}","function updateTable() {\n var rowCount = 5;\n if(pageId == 'page-screen')\n rowCount = 8;\n\n // Build the new table contents\n var html = '';\n for(var i = getGuessesCount() - 1; i >= Math.max(0, getGuessesCount() - rowCount); i--) {\n html += \"\";\n html += \"\" + (i + 1) + \"\\n\";\n html += \"\" + guesses[i].firstName + \"\";\n html += \"\" + guesses[i].weight + \" gram\";\n html += \"\";\n }\n\n // Set the table contents and update it\n $(\"#guess-table > tbody\").html(html);\n $(\"#guess-table\").table(\"refresh\");\n }","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < ufoSightings.length; i++) {\n // Get get the current sightings object and its fields\n var sightings = ufoSightings[i];\n var fields = Object.keys(sightings);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the sightings object, create a new cell at set its inner text to be the current value at the current sightings field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sightings[field];\n }\n }\n}","function refresh() {\n // Clear the table\n $('tbody').empty();\n // Insert each row into the table\n var ind = 0;\n rows.forEach(function(item){\n $('tbody').append('' + item.name + '' +\n item.status + '' + item.wordcount + '' + item.date + '' +\n item.deadline + '');\n ind++;\n });\n}","function updateTable() {\n $(\"#table-body\") .empty();\n for (i = 0; i < trainNames.length; i++) {\n trainName = trainNames [i];\n showTrains();\n };\n \n }","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredDataSet.length; i++) {\n\n // Get the current object and its fields\n var data = filteredDataSet[i];\n var fields = Object.keys(data);\n\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n\n // For every field in the table object, create a new cell at set its inner text to be the current value at the current field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n}","function generateTable() {\n\n // Only render once\n if (isTableClean) {\n disableTableGeneration();\n return;\n }\n\n psdCalculations = getGridData();\n\n // Remove previous table if needed\n if (psdHandsontable) {\n psdHandsontable.destroy();\n }\n\n var container = document.getElementById('exampleTable');\n psdHandsontable = new window.Handsontable(container,\n {\n data: psdCalculations,\n scollV: 'auto',\n scollH: 'auto',\n rowHeaders: true,\n // colHeaders: true \n colHeaders: [\n 'Step', 'freq (1/micron)', 'PSD2 (nm^4)', 'RMS DENSITY', 'RMS^2', 'RMSB^2'\n ],\n columns: [\n { data: 'step' },\n { data: 'freq' },\n //{ data: 'hidden', readOnly: true }, // Calculation column\n { data: 'psd2' },\n { data: 'rmsDensity' },\n { data: 'rms2' },\n { data: 'rmsb2' }\n ]\n });\n disableTableGeneration();\n }","function renderUpdatedDogs() {\n let dogTable = document.querySelector('#table-body');\n dogTable.innerHTML = '';\n getAllDogs();\n}","function redrawTable(data) {\n let tableContent = '';\n for(let i = 0 ;i ' +\n ''+'
'+\n '' +data.recipes[i].title +''\n }\n }\n tableContent += '';\n }\n console.log(tableContent);\n table.innerHTML = tableContent;\n}","function redrawDebugTable() {\n let tbody = '';\n Object.keys(debugTableData).forEach(key => {\n tbody += '';\n tbody += '' + key + '';\n tbody += '' + debugTableData[key].type + '';\n tbody += '' + debugTableData[key].value + '';\n tbody += '';\n });\n\n debugTbody.innerHTML = tbody;\n}","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < sightingData.length; i++) { // Loop through the data object items\n var sighting = sightingData[i]; // Get each data item object\n var fields = Object.keys(sighting); // Get the fields in each data item\n var $row = $tbody.insertRow(i); // Insert a row in the table object\n for (var j = 0; j < fields.length; j++) { // Add a cell for each field in the data item object and populate its content\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}","triggerRedraw() {\n \tlet jtabid = this.idFor('jtab');\n\t$(jtabid).empty();\n\tthis.jsonToTopTable(this, $(jtabid));\n}","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < AlienData.length; i++) {\n // Get get the current address object and its fields\n var Sighting = AlienData[i];\n var fields = Object.keys(Sighting);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = Sighting[field];\n }\n }\n}","function renderTable() {\n $('.request-item').remove();\n\n requests.forEach(function writeToTable(request) {\n $('#request-table').append(request.rowHtml);\n })\n}","function table_fill_empty() {\n pagination_reset();\n $('.crash-table tbody').html(`\n \n -\n -\n -\n -\n `);\n}","function renderTable() {\n $newDataTable.innerHTML = \"\";\n for (var i = 0; i < ufoData.length; i++) {\n // Get the current ufo sighting and its fields\n var sighting = ufoData[i];\n var fields = Object.keys(sighting);\n // Insert a row into the table at position i\n var $row = $newDataTable.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell \n // at set its inner text to be the current value at the \n // current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}","draw() {\r\n // IDs Template: _box, _title, _refresh, _popup, _body, _loading\r\n // IDs Widget: _table\r\n var body = \"#\"+this.id+\"_body\"\r\n // add table\r\n // 0: key\r\n // 1: size\r\n // 2: start\r\n // 3: end\r\n // 4: value\r\n var table = '\\\r\n \\\r\n \\\r\n \\\r\n \\\r\n \\\r\n
Key# EntriesOldestNewestLatest Value
'\r\n $(body).html(table)\r\n // how to render the timestamp\r\n function render_timestamp(data, type, row, meta) {\r\n if (type == \"display\") return gui.date.timestamp_difference(gui.date.now(), data)\r\n else return data\r\n };\r\n // define datatables options\r\n var options = {\r\n \"responsive\": true,\r\n \"dom\": \"Zlfrtip\",\r\n \"fixedColumns\": false,\r\n \"paging\": true,\r\n \"lengthChange\": false,\r\n \"searching\": true,\r\n \"ordering\": true,\r\n \"info\": true,\r\n \"autoWidth\": false,\r\n \"columnDefs\": [ \r\n {\r\n \"targets\" : [2, 3],\r\n \"render\": render_timestamp,\r\n },\r\n {\r\n \"className\": \"dt-center\",\r\n \"targets\": [1, 2, 3]\r\n }\r\n ],\r\n \"language\": {\r\n \"emptyTable\": ''\r\n }\r\n };\r\n // create the table\r\n $(\"#\"+this.id+\"_table\").DataTable(options);\r\n $(\"#\"+this.id+\"_table_text\").html(' Loading')\r\n // ask the database for statistics\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"STATS\"\r\n this.send(message)\r\n }","function renderTable(numProcesses, processPrefix, allocationArr,\n needArr, maxArr, resourcesArr, finished) {\n document.querySelector('#table').innerHTML = table(numProcesses, processPrefix,\n allocationArr, needArr, maxArr, resourcesArr, finished)\n}","function RefreshTable() {\n dc.events.trigger(function () {\n alldata = tableDimension.top(Infinity);\n datatable.fnClearTable();\n datatable.fnAddData(alldata);\n datatable.fnDraw();\n });\n }","function updateTable() {\n\t// Check if plcs finished loading\n\tfor (var i = 0; i < g_plcs.length; ++i) {\n\t\tif (g_plcs[i].err) {\n\t\t\tmoduleStatus(\"Error querying table\");\n\t\t\treturn false;\n\t\t}\n\t\tif (g_plcs[i].ready != READY_ALL) return false;\n\t}\n\n\t$(\"#detail-table-body\").html(\"\");\n\n\tfor (var i = 0; i < g_plcs.length; ++i) {\n\t\tvar row_name = \"detail-table-row-\" + i;\n\t\t$(\"#detail-table-body\").append(\"\");\n\n\t\t$(\"#\" + row_name).append(\"\" + g_plcs[i].name + \"\");\n\n\t\tfor (var j = 0; j < 6; ++j)\n\t\t\t$(\"#\" + row_name).append(\"\" + g_plcs[i].ai[j].val + \"\");\n\n\t\tfor (var j = 0; j < 6; ++j)\n\t\t\t$(\"#\" + row_name).append(\"\" + g_plcs[i].di[j].val + \"\");\n\n\t\tfor (var j = 0; j < 6; ++j) {\n\t\t\tdo_val = g_plcs[i].do[j].val ? \"ON\" : \"OFF\";\n\t\t\tdo_class = \"btn do-button \" + (g_plcs[i].do[j].val ? \"btn-success\" : \"btn-secondary\");\n\t\t\tdo_txt = \"\";\n\t\t\t$(\"#\" + row_name).append(\"\" + do_txt + \"\");\n\t\t}\n\t\tconf_val = g_plcs[i].confirmation ? \"Pend\" : \"OK\";\n\t\tconf_class = \"btn \" + (g_plcs[i].confirmation ? \"btn-warning\" : \"btn-info\")\n\t\t$(\"#\" + row_name).append(\"\");\n\n\t\t$(\"#\" + row_name).append(\"\");\n\t}\n\t$('[data-toggle=\"tooltip\"]').tooltip({trigger : 'hover'});\n\tmoduleStatus(\"Table query OK\");\n}","function render(data) {\r\n\t\t\t\t\t\t$('#slc_Marca').children().remove();\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').children().remove();\r\n\t\t\t\t\t\tvar tabela = $('#tableDiv').append(\r\n\t\t\t\t\t\t\t\t$('
').attr(\"id\", \"tabela\"));\r\n\t\t\t\t\t\tvar tHead = \"\";\r\n\t\t\t\t\t\t$('#tabela').append(tHead);\r\n\t\t\t\t\t\tvar rowH = \" \" + \"ID\" + \"Marca\"\r\n\t\t\t\t\t\t\t\t+ \"Tipo Veiculo\" + \"Modelo\"\r\n\t\t\t\t\t\t\t\t+ \"Status\" + \"Actions\"\r\n\t\t\t\t\t\t\t\t+ \"\";\r\n\t\t\t\t\t\t$('#tableHead').append(rowH);\r\n\r\n\t\t\t\t\t\t$('#tabela').append(\r\n\t\t\t\t\t\t\t\t$('').attr(\"id\", \"tabelaBody\"));\r\n\r\n\t\t\t\t\t\t$.each(data, function(index, value) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar td = $(\"\" + \"\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row1 = $(\"\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.idModelo + \"\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row2 = $(\"\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.idMarca.descMarca\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row3 = $(\"\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.idTipoV.descTipoV\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row4 = $(\"\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.descModelo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row5 = $(\"\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.statusModelo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Efetua A Funcao Ao Clicar No\r\n\t\t\t\t\t\t\t\t\t\t\t// Botao\r\n\t\t\t\t\t\t\t\t\t\t\t// btn-update\r\n\t\t\t\t\t\t\t\t\t\t\tvar buttonUpdate = $(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"btn-update-\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ index)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.click({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}, setInputData);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar buttonRemove = $(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"btn-remove-\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ index)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.click({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}, callRemoveServlet);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row6 = $(\"\");\r\n\t\t\t\t\t\t\t\t\t\t\trow6.append(buttonUpdate);\r\n\t\t\t\t\t\t\t\t\t\t\trow6.append(buttonRemove);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row1);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row2);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row3);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row4);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row5);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row6);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$('#tabela tbody').append(td);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$('#set')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.append('');\r\n\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t// Preenche O Select Marca\r\n\t\t\t\t\t\tgetMarcas();\r\n\r\n\t\t\t\t\t\t// Preenche O Select TipoVeiculo\r\n\t\t\t\t\t\tgetTiposVeiculos();\r\n\r\n\t\t\t\t\t}","function generateTable(){\n if(!table_data.length)\n return;\n //generate first header row with column names\n var tmpl1='';\n for(var i=0;i';\n }\n tmpl1+=' Add';\n tmpl1+='';\n\n //generate rest of the rows\n var tmpl2;\n for(i=0;i';\n tmpl2 += '
'+table_data[i][j]+'
';\n }\n tmpl2 += '';\n tmpl2+='';\n tmpl1=tmpl1.concat(tmpl2);\n }\n\n //generate last row with add function\n tmpl2='';\n for(var j=0;j {\n const cell = new TableCell({\n header: true\n });\n\n this._addResizeHandle(cell, colIndex);\n\n // set preferred width\n if (column.width !== undefined) {\n cell.width = column.width;\n }\n\n // add sort class to header cell\n if (column.sortKey && this._sort.key === column.sortKey ||\n column.sortFn && this._sort.fn === column.sortFn) {\n cell.class.add(CLASS_SORT_CELL);\n if (!this._sort.ascending) {\n cell.class.add(CLASS_SORT_CELL_DESCENDING);\n }\n }\n\n const label = new Label({\n text: column.title\n });\n // make inline to be able to use text-overflow: ellipsis\n label.style.display = 'inline';\n cell.append(label);\n\n // sort observers when clicking on header cell\n cell.on('click', () => this.sortByColumnIndex(colIndex));\n\n headRow.append(cell);\n });\n\n this.head.append(headRow);\n }\n\n if (!this._observers) return;\n\n this._sortObservers();\n\n this._observers.forEach((observer) => {\n const row = this._createRow(observer);\n this.body.append(row);\n });\n }","function _buildTable() {\n // _displayLoading(true);\n _addGradeRange();\n _renderSelects();\n var table = _setupDataTable(renderTable());\n renderFeatures();\n}","function refreshTable(domId) {\n\n //Remove the current table\n $('table').remove();\n var app = quickforms.app;\n //Append the new table with the new options list\n var newJson = [];\n for (var row in quickforms.designer.values) {\n if (quickforms.designer.values[row][quickforms.designer.lookup + 'Order'] >= 0)\n newJson.push(quickforms.designer.values[row]);\n }\n newJson.sort(function (a, b) {\n return parseInt(a[quickforms.designer.lookup + 'Order']) - parseInt(b[quickforms.designer.lookup + 'Order']);\n });\n displayEditingPage(JSON.stringify(newJson), quickforms.designer.lookup);\n }","function GenerateFullTable() {\n\n //debugger;\n\n if((Intern_TableDivName === undefined || Intern_TableDivName === null || Intern_TableDivName === \"\") ||\n (Intern_TableDivElem === undefined || Intern_TableDivElem === null || Intern_TableDivElem === \"\"))\n return;\n\n var Intern_TableHtml = '';\n if (Intern_ArrayOfValues.length !== 0) {\n Intern_TableHtml = Intern_TableHtml + '';\n Intern_TableHtml = Intern_TableHtml + '';\n Intern_TableHtml = Intern_TableHtml + '';\n if (Intern_TableFieldDispNames === undefined || Intern_TableFieldDispNames === null)\n Intern_TableFieldDispNames = Intern_TableFieldIDs;\n $.each(Intern_TableFieldDispNames, function (index, value) {\n Intern_TableHtml = Intern_TableHtml + '';\n });\n if (Setting_IncludeUpDown || Setting_IncludeEdit || Setting_IncludeDelete) {\n Intern_TableHtml = Intern_TableHtml + '';\n }\n Intern_TableHtml = Intern_TableHtml + '';\n Intern_TableHtml = Intern_TableHtml + '';\n\n Intern_TableHtml = Intern_TableHtml + '';\n Intern_TableHtml = Intern_TableHtml + '';\n Intern_TableHtml = Intern_TableHtml + '
';\n Intern_TableHtml = Intern_TableHtml + value;\n Intern_TableHtml = Intern_TableHtml + '';\n Intern_TableHtml = Intern_TableHtml + Disp_OperationsTitle;\n Intern_TableHtml = Intern_TableHtml + '
';\n\n Intern_TableDivElem.html(Intern_TableHtml);\n\n $(\"#\" + Intern_TableDivName + \" tbody\").html(GenerateTableData());\n for (var i = 0; i < Intern_ArrayOfValues.length; i++)\n AddEvents(i);\n Intern_DictConcatInput = null;\n }\n }","function updateTable() {\n\t_formatDatepicker();\n\t_updateTable('table-internal-order', true);\n\t_autoFormattingDate(\"input.datepicker\");\n}","function refreshTable() {\n\t// Empty the table body to refresh\n\tlet tbody = document.getElementById('tbody');\n\ttbody.innerHTML = '';\n\n\t// Loop through todos and add cells.\n\tfor (var i = 0; i < todos.length; i++) {\n\t\tlet todo = todos[i];\n\t\taddTodoCell(todo, i+1);\n\t}\n}","onRowsRerender() {\n this.scheduleDraw(true);\n }","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredrows.length; i++) {\n // Get get the current address object and its fields\n var rows = filteredrows[i];\n var fields = Object.keys(rows);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the rows object, create a new cell at set its inner text to be the current value at the current row's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = rows[field];\n }\n }\n}","function redrawTable(id){ \n clearTable();\n removeFromList(id);\n povoateTable(); \n setupDeleteListener();\n setfilter();\n}","function renderData() {\n tableBody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n var data = tableData[i];\n var rows = Object.keys(data);\n var input = tableBody.insertRow(i);\n for (var j = 0; j < rows.length; j++) {\n var field = rows[j];\n var cell = input.insertCell(j);\n cell.innerText = data[field];\n }\n }\n}","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredData.length; i++) {\n // Get the current object and its fields\n var data = filteredData[i];\n var fields = Object.keys(data);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n}","function drawTable(){\n for (employee of allEmployees){\n newRow(employee);\n }\n}","function drawDynamicTable() {\n try {\n var tableSortingColumns = [\n { orderable: false },null, null, null, null, null, null, null,\n ];\n var tableFilteringColumns = [\n { type: \"null\" },{ type: \"text\" }, { type: \"text\" }, { type: \"text\" }, { type: \"text\" }, { type: \"text\" }, { type: \"text\" }, { type: \"text\" },\n ];\n\n var tableColumnDefs = [\n\n ];\n //select tblletter.id as 'AutoCodeHide', tblletter.title as 'عنوان الخطاب ',tblletter.details as 'تفاصيل الخطاب', tbldepartmen.name as 'صادر من',to_d.name as 'صادر الي',tblUsers.User_Name as 'الراسل', 1 as ' تعديل /حذف' from tblletter inner join tbldepartmen on tblletter.from_dep=tbldepartmen.id inner join tbldepartmen to_d on to_d.id=tblletter.to_dep inner join tblUsers on tblletter.add_by=tblUsers.id where tblletter.type=2 and ISNUll(tblletter.deleted,0)=0\n var initialSortingColumn = 0;\n loadDynamicTable('out_outside_letters', \"AutoCodeHide\", tableColumnDefs, tableFilteringColumns, tableSortingColumns, initialSortingColumn, \"Form\");\n } catch (err) {\n alert(err);\n }\n}","function renderTable(data) {\n var table_data = data.data;\n var height = data.height;\n var width = data.width;\n var table = document.getElementById(\"results-\" + current_tab);\n $(\".no-table#tab-\" + current_tab).hide();\n table.innerHTML = \"\";\n $(\"h5\").hide();\n for (var i = 0; i < height; i++) {\n let row = document.createElement(\"tr\");\n for (var j = 0; j < width; j++) {\n let col;\n if (i == 0 || j == 0) col = document.createElement(\"th\");\n else col = document.createElement(\"td\");\n col.appendChild(document.createTextNode(table_data[i][j]));\n row.appendChild(col);\n }\n table.appendChild(row);\n }\n var current_date = new Date();\n $(\".date#tab-\" + current_tab).text(current_date.toLocaleTimeString());\n $(\"h5\").show();\n}","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredTable.length; i++) {\n var address = filteredTable[i];\n var fields = Object.keys(address);\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = address[field];\n }\n }\n}","renderAndAdjust() {\n this.hot.render();\n\n // Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.\n this.hot.view.adjustElementsSize();\n }","function renderTable() {\n \n // Delete the list of cities prior to adding new city table data \n // (necessary to prevent repeat of table data)\n $(\"tbody\").empty();\n\n // Loop through the array of cities\n for (var i = 0; i < citiesArray.length; i++) {\n // Render new table row and table data elements for each city in the array.\n var tRow = $(\"\");\n var tData = $(\"\");\n var tSpan = $(\"\");\n\n tSpan.addClass(\"city\");\n tData.attr(\"data-name\", citiesArray[i]);\n tData.attr(\"data-index\", i);\n tSpan.text(citiesArray[i]);\n\n let button = $(\"
';\n cell5.innerHTML =\n 'Subtotal: ' +\n item.price * item.numItems +\n \"\";\n cell6.innerHTML =\n '

Remove

';\n }","function rerender_branch_table(tree, test_results, annotations, element) {\n $(element).empty();\n render_branch_table(tree, test_results, annotations, element);\n}","function drawTable() {\n let dow_chart_data = new google.visualization.DataTable();\n dow_chart_data.addColumn('string', 'Δραστηριότητα');\n dow_chart_data.addColumn('string', 'Ημέρα Περισσότερων Εγγραφών');\n dow_chart_data.addRow(['IN_VEHICLE', dow_data['IN_VEHICLE']]);\n dow_chart_data.addRow(['ON_BICYCLE', dow_data['ON_BICYCLE']]);\n dow_chart_data.addRow(['ON_FOOT', dow_data['ON_FOOT']]);\n dow_chart_data.addRow(['RUNNING', dow_data['RUNNING']]);\n dow_chart_data.addRow(['STILL', dow_data['STILL']]);\n dow_chart_data.addRow(['TILTING', dow_data['TILTING']]);\n dow_chart_data.addRow(['UNKNOWN', dow_data['UNKNOWN']]);\n\n var dow_table = new google.visualization.Table(document.getElementById('dow-table-div'));\n dow_table.draw(dow_chart_data, {showRowNumber: false, width: '100%', height: '100%'});\n }","function resetTable() {\n\n // clear the current data\n clearTable();\n \n // use forEach and Object.values to populate the initial table\n tableData.forEach((ufoSighting) => {\n var row = tbody.append(\"tr\");\n Object.values(ufoSighting).forEach(value => {\n var cell = row.append(\"td\");\n cell.text(value);\n cell.attr(\"class\", \"table-style\");\n }); // close second forEach\n }); // close first forEach\n}","function renderTableData(code, changeCurrent) {\r\n const pre = select(`.table-data[data-table-code=\"${code}\"]`)\r\n const tableArray = JSON.parse(pre.textContent)\r\n\r\n if(!changeCurrent) {\r\n currentTable = code\r\n }\r\n\r\n // remove old table content\r\n tableBody.textContent = ''\r\n\r\n tableArray.forEach(obj => {\r\n const specieRow = document.createElement('tr')\r\n // specie link column\r\n const specieLinkCol = document.createElement('td')\r\n const specieLink = document.createElement('a')\r\n specieLink.setAttribute('href', obj.link)\r\n specieLink.textContent = obj.specie\r\n\r\n specieLinkCol.appendChild(specieLink)\r\n\r\n // specie color box\r\n const colorCol = document.createElement('td')\r\n const colorBox = document.createElement('span')\r\n colorBox.classList.add('specie_color-box')\r\n colorBox.style = `background-color: ${obj.color}`\r\n\r\n colorCol.appendChild(colorBox)\r\n\r\n // species months\r\n const monthsCol = document.createElement('td')\r\n const monthsDiv = document.createElement('div')\r\n monthsDiv.classList.add('months')\r\n months.forEach(month => {\r\n const monthBox = document.createElement('span')\r\n monthBox.classList.add('month-box')\r\n\r\n monthsDiv.appendChild(monthBox)\r\n })\r\n\r\n const monthBoxes = selectAll('span.month-box', monthsDiv)\r\n\r\n obj.months.forEach(month => {\r\n monthBoxes[month - 1].classList.add('filled')\r\n })\r\n\r\n monthsCol.appendChild(monthsDiv)\r\n\r\n\r\n // append children to specie\r\n specieRow.appendChild(specieLinkCol)\r\n specieRow.appendChild(colorCol)\r\n specieRow.appendChild(monthsCol)\r\n\r\n tableBody.appendChild(specieRow)\r\n })\r\n }","refreshPage() {\n $(\"#tableMasterHeader tr\").last().remove();\n this.drawFilterForTable(\"#tableMasterHeader\");\n $(\".ASC\").removeClass(\"ASC\");\n $(\".DESC\").removeClass(\"DESC\");\n $(\"#PageSize\").val(50);\n $(\"#offsetRow\").val(1);\n $('#tableMasterHeader th[property=\"RefDate\"]').addClass(\"DESC\");\n var data = this.getValueToLoadData();\n data[\"OrderQuery\"] = resource.OrderBy.RefDateDesc;\n this.order = resource.OrderBy.RefDateDesc;\n this.loadDataMaster(data);\n }","function renderTable() { \r\n $tbody.innerHTML = \"\";\r\n var length = filteredData.length;\r\n for (var i = 0; i < length; i++) {\r\n // Get get the current address object and its fields\r\n var data = filteredData[i]; \r\n var fields = Object.keys(data); \r\n // Create a new row in the tbody, set the index to be i + startingIndex\r\n var $row = $tbody.insertRow(i);\r\n for (var j = 0; j < fields.length; j++) {\r\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\r\n var field = fields[j];\r\n var $cell = $row.insertCell(j);\r\n $cell.innerText = data[field];\r\n }\r\n }\r\n}","function table_reset() {\n $('.crash-table tbody').html(\"\");\n}","function reset() {\n d3.selectAll(\"#tableVis table tr\").style(\"font-weight\", \"normal\");\n destroyVis();\n colleges = Object.keys(current_json);\n autocomp();\n createVis(current_json, current_csv);\n}","function render_table_chunk() {\n\n $tablehead.text('');\n $tablebody.text('');\n \n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\n\n try {\n \n //setting up a header\n var $headrow = $tablehead.append(\"tr\");\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\n\n // setting up a table\n chunkdata.forEach(function(item) {\n var $bodyrow = $tablebody.append('tr');\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\n });\n }\n\n catch (error) {\n console.log('NO data in the dataset');\n $tablehead.append('tr')\n .append('td')\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\n \n d3.selectAll('.pagination')\n .style('display', 'none'); \n }\n\n $currentpage.text(currentPage);\n window.name = JSON.stringify(alien_data);\n numberOfPages = Math.ceil(alien_data.length / perPage);\n \n}","function refreshTable() {\n\t\tvar partners = [\"piston\", \"plumgrid\"];\n\t\tfor (var i = 0; i < partners.length; i++) {\n\t\t\tdoAjaxSelects(partners[i])\n\t\t}\n\t\tsetTimeout(refreshTable, 1000);\n\t}","function drawAppTable() {\n var idTable = new Array('first_app', 'second_app', 'third_app');\n var inc = 0, i = 1;\n var tdEl;\n // add appointments\n for (var field in jsonAppsPerHour) {\n document.getElementById(idTable[inc]).style.display = \"\";\n console.log(\"in first loop idTable[\" + inc + \"] = \" + idTable[inc]);\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].PatientID;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].Fname;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].Lname;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].DocFullName;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].EmployeeID;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].AppointmentID;\n \n inc += 1;\n i = 1;\n }\n if (inc < 3) { // have all table rows been filled?\n for (var i = 2;i >= inc; i--) {\n document.getElementById(idTable[i]).style.display = \"none\";\n }\n }\n}","function buildTable(){\n\n}","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredUFOData.length; i++) {\n\n // Get UFO Data object and its fields\n var UFOdata = filteredUFOData[i];\n var fields = Object.keys(UFOdata);\n\n // Create new row in tbody\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n\n // For every field in the UFOData object create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = UFOdata[field];\n }\n\n }\n\n}","function init() {\n theTable.innerHTML = '';\n makeHeader();\n for(var i = 0; i < Shop.all.length; i++){\n Shop.all[i].render();\n }\n makeFooter();\n}","function remplirTableau() {\r\n tabIsEmpty = false;\r\n tbody.empty();\r\n var html = \"\";\r\n data.forEach(function (element) {\r\n html = '' +\r\n '' + element.order + '' +\r\n '' + element.activity + '' +\r\n '' + element.manager + '' +\r\n '' + element.numofsub + '' +\r\n '';\r\n tbody.append(html);\r\n });\r\n }","function clearContent(){\n\t$('#output').html('
');\n}","function effacerTableau() {\r\n tabIsEmpty = true;\r\n tbody.empty();\r\n }","function reload(){\n\tvar body = document.getElementById(\"body\");\n\twhile(body.firstChild){\n\t\tbody.removeChild(body.firstChild);\n\t}\n\tvar table = document.createElement(\"table\");\n\ttable.id = \"firstTable\";\n\ttable.classList = \"table table-hover\";\n\tvar thead = document.createElement(\"thead\");\n\tthead.id = \"thead\";\n\tthead.classList = \"thead-dark\";\n\tvar tbody = document.createElement(\"tbody\");\n\ttbody.id = \"tbody\";\n\ttable.appendChild(thead);\n\ttable.appendChild(tbody);\n\tbody.appendChild(table);\n}","function drawTable() {\n var id = 1;\n var productData = '';\n\n $(\"#product-table > tbody\").empty();\n\n $.getJSON(\"/Products\", function (data) {\n if (data != 0) {\n $.each(data, function (key, value) {\n productData += '';\n productData += '' + id++ + '';\n productData += ' ' + value.name + '';\n productData += '' + value.code + '';\n productData += '' + value.group_name + '';\n productData += '' + unitArray[value.unit] + '';\n productData += '' + value.description + '';\n productData += ' ';\n productData += '';\n codeOfLastProduct = value.code;\n });\n $(\"#product-table\").append(productData);\n displayTable();\n }\n else {\n removeTable();\n }\n });\n }","renderTable() {\n if (!this.hasSetupRender()) {\n return;\n }\n\n // Iterate through each found schema\n // Each of them will be a table\n this.parsedData.forEach((schemaData, i) => {\n const tbl = document.createElement('table');\n tbl.className = `${this.classNamespace}__table`;\n\n // Caption\n const tblCaption = document.createElement('caption');\n const tblCaptionText = document.createTextNode(`Generated ${this.schemaName} Schema Table #${i + 1}`);\n tblCaption.appendChild(tblCaptionText);\n\n // Table Head\n const tblHead = document.createElement('thead');\n const tblHeadRow = document.createElement('tr');\n const tblHeadTh1 = document.createElement('th');\n const tblHeadTh2 = document.createElement('th');\n const tblHeadTh1Text = document.createTextNode('itemprop');\n const tblHeadTh2Text = document.createTextNode('value');\n tblHeadTh1.appendChild(tblHeadTh1Text);\n tblHeadTh2.appendChild(tblHeadTh2Text);\n tblHeadRow.appendChild(tblHeadTh1);\n tblHeadRow.appendChild(tblHeadTh2);\n tblHead.appendChild(tblHeadRow);\n\n const tblBody = document.createElement('tbody');\n\n generateTableBody(tblBody, schemaData);\n\n // put the in the \n tbl.appendChild(tblCaption);\n tbl.appendChild(tblHead);\n tbl.appendChild(tblBody);\n // appends
into container\n this.containerEl.appendChild(tbl);\n // sets the border attribute of tbl to 0;\n tbl.setAttribute('border', '0');\n });\n\n // Close table btn\n const closeBtn = document.createElement('button');\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('type', 'button');\n closeBtn.className = 'schema-parser__close';\n this.containerEl.appendChild(closeBtn);\n // Add close handler\n closeBtn.addEventListener('click', this.handleClose.bind(this));\n }"],"string":"[\n \"function renderTable() {\\n clearTable();\\n showTable();\\n}\",\n \"function drawtable()\\n{\\n // going to use a template for this!\\n\\n // example table data row { id: \\\"CDL\\\", rank: 1949, \\\"change\\\": 23, \\\"winp\\\" : 84.4, \\\"run\\\" : \\\"wwwwwwwwww\\\" },\\n\\n // need in the item s_players,\\n // {{:rank}}\\n // {{:change}}\\n // {{:id}} - initials\\n // {{:record}} - win percentage\\n // {{:gamerun}} - last ten games results\\n\\n // the template then executes for each of the elements in this.\\n\\n // what player do we want? URL format is player.html/INITIALS\\n playerid = window.location.href.substring(window.location.href.indexOf('?')+1);\\n opponents = get_player_opponents(all_results, playerid);\\n player_results = get_player_results(all_results, playerid, opponents)[0];\\n\\n recent_player_results = get_results_to_display(player_results, playerid, recent_results_to_display);\\n var recent_res_template = $.templates(\\\"#resultTemplate\\\");\\n var htmlOutput = recent_res_template.render(recent_player_results);\\n $(\\\"#rec_res_tbl\\\").html(htmlOutput);\\n\\n var opponents_template = $.templates(\\\"#opponentsTemplate\\\");\\n var opponent_template = create_opponents_template(opponents);\\n var htmlOutput = opponents_template.render(opponent_template);\\n $(\\\"#opponents_tbl\\\").html(htmlOutput);\\n\\n head_to_head = document.getElementById(\\\"opp_res_tbl\\\");\\n head_to_head.setAttribute(\\\"style\\\", \\\"height:\\\" + 15 * player_results.length + \\\"px\\\");\\n\\n slider = document.getElementById(\\\"head_to_head_range\\\");\\n label = document.getElementById(\\\"results_output\\\");\\n\\n for (var ii = 0; ii < opponents.length; ii++)\\n {\\n checkbox = document.getElementById(\\\"opp_check_box_\\\" + opponents[ii]);\\n checkbox.onchange = function() {\\n redraw_head_to_head(slider.value);\\n };\\n }\\n change_opponenet_check_boxes(false);\\n\\n label.value = slider.value; // Display the default slider value\\n // Update the current slider value (each time you drag the slider handle)\\n slider.oninput = function() {\\n label.value = this.value;\\n redraw_head_to_head(this.value);\\n }\\n\\n}\",\n \"function refreshTables() {\\n\\n\\t\\t$(\\\"#biomatcher-data-table\\\").html(\\\"
Subject IDOligo NameOligo SeqMismatch ToleranceHit Coordinates
\\\");\\n\\t}\",\n \"redraw() {\\n while (this.tbody.firstChild) {\\n this.tbody.removeChild(this.tbody.firstChild);\\n }\\n var filteredRows = this.filterRows();\\n var orderedRows = this.sortRows(filteredRows);\\n orderedRows.forEach(row => {\\n this.tbody.appendChild(row);\\n });\\n }\",\n \"function refreshData(){\\r\\n\\t\\tvar myTable=$('#'+settings.table_id);\\r\\n\\t\\tmyTable.empty();\\r\\n\\t\\tmyTable.addClass('table');\\r\\n\\t\\tmyTable.addClass('table-bordered');\\r\\n\\t\\tmyTable.addClass('table-striped');\\r\\n\\t\\tmyTable.addClass('table-hover');\\r\\n\\t\\t//add head table\\r\\n\\t\\tvar head=$(\\\"\\\");\\r\\n\\t\\thead.append('\\t\\t\\t\\t\\t\\t\\t\\t');\\r\\n\\t\\tvar tr='';\\r\\n\\t\\tfor(var i=0;i'+settings.table_columns[i]+'';\\r\\n\\t\\t}\\r\\n\\t\\ttr+='';\\r\\n\\t\\thead.append(tr);\\r\\n\\t\\tmyTable.append(head);\\r\\n\\t\\t//add head row\\r\\n\\t\\tvar body=$('');\\r\\n\\t\\tvar rows=[];\\r\\n\\t\\tvar start=0;\\r\\n\\t\\tvar end=settings.table_data.length;\\r\\n\\t\\tif(settings.paging){\\r\\n\\t\\t\\tstart=(settings.page-1)*settings.page_items;\\r\\n\\t\\t\\tend=start+settings.page_items;\\r\\n\\t\\t\\tif(end>settings.table_data.length){\\r\\n\\t\\t\\t\\tend=settings.table_data.length;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\tfor(var i=start;i'+accounting.formatNumber(row_data[j])+'';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='%'){\\r\\n\\t\\t\\t\\t\\ttr+=''+accounting.formatNumber(row_data[j]*100,2)+'%';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='money'){\\r\\n\\t\\t\\t\\t\\ttr+=''+accounting.formatMoney(row_data[j])+'';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='short date'){\\r\\n\\t\\t\\t\\t\\t\\ttr+=''+verveDateConvert(row_data[j]).format('mmm dd')+'';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='date'){\\r\\n\\t\\t\\t\\t\\t\\ttr+=''+verveDateConvert(row_data[j]).format('yyyy-mm-dd')+'';\\r\\n\\t\\t\\t\\t}else{\\r\\n\\t\\t\\t\\t\\ttr+=''+row_data[j]+'';\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\ttr+='';\\r\\n\\t\\t\\trows.push(tr);\\r\\n\\t\\t}\\r\\n\\t\\tbody.append(rows.join(''));\\r\\n\\t\\tmyTable.append(body);\\t\\r\\n\\t\\t\\r\\n\\t\\t//add class sort\\r\\n\\t\\tif(settings.sort_by!=''){\\r\\n\\t\\t\\tvar headArray=myTable.find(\\\"thead tr th.header[title='\\\"+settings.sort_by+\\\"']\\\").addClass('sort');\\r\\n\\t\\t\\tif(settings.sort_type=='asc'){\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header i\\\").removeClass();\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header[title='\\\"+settings.sort_by+\\\"'] i\\\").addClass('fa fa-sort-alpha-asc');\\r\\n\\t\\t\\t}else{\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header i\\\").removeClass();\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header[title='\\\"+settings.sort_by+\\\"'] i\\\").addClass('fa fa-sort-alpha-desc');\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t}\\r\\n\\t\\t//add sort event\\r\\n\\t\\tif(settings.sortable){\\r\\n\\t\\t\\tmyTable.find(\\\"thead tr th.header\\\").click(function(){\\r\\n\\t\\t\\t\\tsettings.sort_by=$(this).attr('title');\\r\\n\\t\\t\\t\\tsort($(this).attr('title'));\\r\\n\\t\\t\\t});\\r\\n\\t\\t}\\r\\n\\t\\t//Add onClick Event\\r\\n\\t\\tmyTable.find(\\\"tbody tr\\\").click(function(){\\r\\n\\t\\t\\tvar tr=$(this);\\r\\n\\t\\t\\tvar row=[];\\r\\n\\t\\t\\ttr.find(\\\"td\\\").each(function(){\\r\\n\\t\\t\\t\\trow.push($(this).html());\\r\\n\\t\\t\\t});\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tsettings.onClickRow(row);\\r\\n\\t\\t});\\r\\n\\t\\t//\\r\\n\\t\\t$('a').click(function(event){\\r\\n\\t\\t\\tconsole.log();\\r\\n\\t\\t\\tif($(this).attr('href')=='#'){\\r\\n\\t\\t\\t\\tevent.preventDefault();\\r\\n\\t\\t\\t}\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n console.log(\\\"rendering\\\")\\n\\n for (var i = 0; i < tableData.length; i++) {\\n // Get get the current UFO info object and its fields\\n var ufoinfo = tableData[i];\\n var field = Object.keys(ufoinfo);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < field.length; j++) {\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = ufo[field];\\n }\\n } \\n}\",\n \"function drawTable() {\\n var stat = getState(cm);\\n _replaceSelection(cm, stat.table, insertTexts.table);\\n}\",\n \"function _redrawTable() {\\n if (!_results) {\\n return;\\n }\\n\\n var rows = '';\\n for (var i in _results) {\\n var responder = _results[i];\\n rows += '' +\\n '' + responder.name + '' +\\n '' + responder.occupation + '' +\\n '' + responder.city + ', ' + responder.state + '' +\\n '' + responder.status + '' +\\n '';\\n }\\n\\n $('#responder_results tbody').html(rows);\\n }\",\n \"function redrawTable() {\\n if ($scope.redraw) {\\n return;\\n }\\n // reset display styles so column widths are correct when measured below\\n angular.element(elem.querySelectorAll('thead, tbody, tfoot')).css('display', '');\\n // wrap in $timeout to give table a chance to finish rendering\\n $timeout(function () {\\n $scope.redraw = true;\\n // set widths of columns\\n var totalColumnWidth = 0;\\n angular.forEach(elem.querySelectorAll('tr:first-child th'), function (thElem, i) {\\n var tdElems = elem.querySelector('tbody tr:first-child td:nth-child(' + (i + 1) + ')');\\n var tfElems = elem.querySelector('tfoot tr:first-child td:nth-child(' + (i + 1) + ')');\\n var columnWidth = Math.ceil(elem.querySelectorAll('thead')[0].offsetWidth / (elem.querySelectorAll('thead th').length || 1));\\n if (tdElems) {\\n tdElems.style.width = columnWidth + 'px';\\n }\\n if (thElem) {\\n thElem.style.width = columnWidth + 'px';\\n }\\n if (tfElems) {\\n tfElems.style.width = columnWidth + 'px';\\n }\\n totalColumnWidth = totalColumnWidth + columnWidth;\\n });\\n // set css styles on thead and tbody\\n angular.element(elem.querySelectorAll('thead, tfoot')).css('display', 'block');\\n angular.element(elem.querySelectorAll('tbody')).css({\\n 'display': 'block',\\n 'max-height': $scope.tableMaxHeight || 'inherit',\\n 'overflow': 'auto'\\n });\\n // add missing width to fill the table\\n if (totalColumnWidth < elem.offsetWidth) {\\n var last = elem.querySelector('tbody tr:first-child td:last-child');\\n if (last) {\\n last.style.width = (last.offsetWidth + elem.offsetWidth - totalColumnWidth) + 'px';\\n last = elem.querySelector('thead tr:first-child th:last-child');\\n last.style.width = (last.offsetWidth + elem.offsetWidth - totalColumnWidth) + 'px';\\n }\\n }\\n // reduce width of last column by width of scrollbar\\n var tbody = elem.querySelector('tbody');\\n var scrollBarWidth = tbody.offsetWidth - tbody.clientWidth;\\n if (scrollBarWidth > 0) {\\n var lastColumn = elem.querySelector('tbody tr:first-child td:last-child');\\n lastColumn.style.width = (parseInt(lastColumn.style.width.replace('px', '')) - scrollBarWidth) + 'px';\\n }\\n $scope.redraw = false;\\n });\\n }\",\n \"updateBody() {\\n this.tableBody.innerHTML = '';\\n\\n if (!this.sortedData.length) {\\n let row = this.buildRow('Nothing found', true);\\n\\n this.tableBody.appendChild(row);\\n }\\n\\n else {\\n for (let i = 0; i < this.sortedData.length; i++) {\\n let row = this.buildRow(this.sortedData[i]);\\n\\n this.tableBody.appendChild(row);\\n }\\n }\\n\\n this.buildStatistics();\\n }\",\n \"table() {\\n this.showtable= ! this.showtable;\\n //workaround - table width is incorect when rendered hidden\\n //render it after 100 ms again, usually after it is shown, thus calculating\\n //correct width\\n if (this.showtable) window.setTimeout(function(that){that.ht2.render()},100,this);\\n }\",\n \"function render() {\\n\\tconsole.log(indicatorData);\\n\\n\\td3.select('table#mipex tbody')\\n\\t\\t.selectAll('tr')\\n\\t\\t.data(indicatorData)\\n\\t\\t.enter()\\n\\t\\t.append('tr')\\n\\t\\t\\t.html(rowTemplate);\\n\\n\\t// Inform parent frame of new height\\n\\tfm.resize()\\n}\",\n \"function redoTableRows() {\\n let d3tbody = d3.select(\\\"tbody\\\");\\n d3tbody.html(\\\"\\\");\\n generateTableBody(tbody, data, dateText, cityText, stateSelected, shapeSelected)\\n}\",\n \"function updateTable() {\\n var rowCount = 5;\\n if(pageId == 'page-screen')\\n rowCount = 8;\\n\\n // Build the new table contents\\n var html = '';\\n for(var i = getGuessesCount() - 1; i >= Math.max(0, getGuessesCount() - rowCount); i--) {\\n html += \\\"\\\";\\n html += \\\"\\\" + (i + 1) + \\\"\\\\n\\\";\\n html += \\\"\\\" + guesses[i].firstName + \\\"\\\";\\n html += \\\"\\\" + guesses[i].weight + \\\" gram\\\";\\n html += \\\"\\\";\\n }\\n\\n // Set the table contents and update it\\n $(\\\"#guess-table > tbody\\\").html(html);\\n $(\\\"#guess-table\\\").table(\\\"refresh\\\");\\n }\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < ufoSightings.length; i++) {\\n // Get get the current sightings object and its fields\\n var sightings = ufoSightings[i];\\n var fields = Object.keys(sightings);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the sightings object, create a new cell at set its inner text to be the current value at the current sightings field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = sightings[field];\\n }\\n }\\n}\",\n \"function refresh() {\\n // Clear the table\\n $('tbody').empty();\\n // Insert each row into the table\\n var ind = 0;\\n rows.forEach(function(item){\\n $('tbody').append('' + item.name + '' +\\n item.status + '' + item.wordcount + '' + item.date + '' +\\n item.deadline + '');\\n ind++;\\n });\\n}\",\n \"function updateTable() {\\n $(\\\"#table-body\\\") .empty();\\n for (i = 0; i < trainNames.length; i++) {\\n trainName = trainNames [i];\\n showTrains();\\n };\\n \\n }\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredDataSet.length; i++) {\\n\\n // Get the current object and its fields\\n var data = filteredDataSet[i];\\n var fields = Object.keys(data);\\n\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n\\n // For every field in the table object, create a new cell at set its inner text to be the current value at the current field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = data[field];\\n }\\n }\\n}\",\n \"function generateTable() {\\n\\n // Only render once\\n if (isTableClean) {\\n disableTableGeneration();\\n return;\\n }\\n\\n psdCalculations = getGridData();\\n\\n // Remove previous table if needed\\n if (psdHandsontable) {\\n psdHandsontable.destroy();\\n }\\n\\n var container = document.getElementById('exampleTable');\\n psdHandsontable = new window.Handsontable(container,\\n {\\n data: psdCalculations,\\n scollV: 'auto',\\n scollH: 'auto',\\n rowHeaders: true,\\n // colHeaders: true \\n colHeaders: [\\n 'Step', 'freq (1/micron)', 'PSD2 (nm^4)', 'RMS DENSITY', 'RMS^2', 'RMSB^2'\\n ],\\n columns: [\\n { data: 'step' },\\n { data: 'freq' },\\n //{ data: 'hidden', readOnly: true }, // Calculation column\\n { data: 'psd2' },\\n { data: 'rmsDensity' },\\n { data: 'rms2' },\\n { data: 'rmsb2' }\\n ]\\n });\\n disableTableGeneration();\\n }\",\n \"function renderUpdatedDogs() {\\n let dogTable = document.querySelector('#table-body');\\n dogTable.innerHTML = '';\\n getAllDogs();\\n}\",\n \"function redrawTable(data) {\\n let tableContent = '';\\n for(let i = 0 ;i ' +\\n ''+'
'+\\n '' +data.recipes[i].title +''\\n }\\n }\\n tableContent += '';\\n }\\n console.log(tableContent);\\n table.innerHTML = tableContent;\\n}\",\n \"function redrawDebugTable() {\\n let tbody = '';\\n Object.keys(debugTableData).forEach(key => {\\n tbody += '';\\n tbody += '' + key + '';\\n tbody += '' + debugTableData[key].type + '';\\n tbody += '' + debugTableData[key].value + '';\\n tbody += '';\\n });\\n\\n debugTbody.innerHTML = tbody;\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < sightingData.length; i++) { // Loop through the data object items\\n var sighting = sightingData[i]; // Get each data item object\\n var fields = Object.keys(sighting); // Get the fields in each data item\\n var $row = $tbody.insertRow(i); // Insert a row in the table object\\n for (var j = 0; j < fields.length; j++) { // Add a cell for each field in the data item object and populate its content\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = sighting[field];\\n }\\n }\\n}\",\n \"triggerRedraw() {\\n \\tlet jtabid = this.idFor('jtab');\\n\\t$(jtabid).empty();\\n\\tthis.jsonToTopTable(this, $(jtabid));\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < AlienData.length; i++) {\\n // Get get the current address object and its fields\\n var Sighting = AlienData[i];\\n var fields = Object.keys(Sighting);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = Sighting[field];\\n }\\n }\\n}\",\n \"function renderTable() {\\n $('.request-item').remove();\\n\\n requests.forEach(function writeToTable(request) {\\n $('#request-table').append(request.rowHtml);\\n })\\n}\",\n \"function table_fill_empty() {\\n pagination_reset();\\n $('.crash-table tbody').html(`\\n \\n -\\n -\\n -\\n -\\n `);\\n}\",\n \"function renderTable() {\\n $newDataTable.innerHTML = \\\"\\\";\\n for (var i = 0; i < ufoData.length; i++) {\\n // Get the current ufo sighting and its fields\\n var sighting = ufoData[i];\\n var fields = Object.keys(sighting);\\n // Insert a row into the table at position i\\n var $row = $newDataTable.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the address object, create a new cell \\n // at set its inner text to be the current value at the \\n // current address's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = sighting[field];\\n }\\n }\\n}\",\n \"draw() {\\r\\n // IDs Template: _box, _title, _refresh, _popup, _body, _loading\\r\\n // IDs Widget: _table\\r\\n var body = \\\"#\\\"+this.id+\\\"_body\\\"\\r\\n // add table\\r\\n // 0: key\\r\\n // 1: size\\r\\n // 2: start\\r\\n // 3: end\\r\\n // 4: value\\r\\n var table = '\\\\\\r\\n \\\\\\r\\n \\\\\\r\\n \\\\\\r\\n \\\\\\r\\n \\\\\\r\\n
Key# EntriesOldestNewestLatest Value
'\\r\\n $(body).html(table)\\r\\n // how to render the timestamp\\r\\n function render_timestamp(data, type, row, meta) {\\r\\n if (type == \\\"display\\\") return gui.date.timestamp_difference(gui.date.now(), data)\\r\\n else return data\\r\\n };\\r\\n // define datatables options\\r\\n var options = {\\r\\n \\\"responsive\\\": true,\\r\\n \\\"dom\\\": \\\"Zlfrtip\\\",\\r\\n \\\"fixedColumns\\\": false,\\r\\n \\\"paging\\\": true,\\r\\n \\\"lengthChange\\\": false,\\r\\n \\\"searching\\\": true,\\r\\n \\\"ordering\\\": true,\\r\\n \\\"info\\\": true,\\r\\n \\\"autoWidth\\\": false,\\r\\n \\\"columnDefs\\\": [ \\r\\n {\\r\\n \\\"targets\\\" : [2, 3],\\r\\n \\\"render\\\": render_timestamp,\\r\\n },\\r\\n {\\r\\n \\\"className\\\": \\\"dt-center\\\",\\r\\n \\\"targets\\\": [1, 2, 3]\\r\\n }\\r\\n ],\\r\\n \\\"language\\\": {\\r\\n \\\"emptyTable\\\": ''\\r\\n }\\r\\n };\\r\\n // create the table\\r\\n $(\\\"#\\\"+this.id+\\\"_table\\\").DataTable(options);\\r\\n $(\\\"#\\\"+this.id+\\\"_table_text\\\").html(' Loading')\\r\\n // ask the database for statistics\\r\\n var message = new Message(gui)\\r\\n message.recipient = \\\"controller/db\\\"\\r\\n message.command = \\\"STATS\\\"\\r\\n this.send(message)\\r\\n }\",\n \"function renderTable(numProcesses, processPrefix, allocationArr,\\n needArr, maxArr, resourcesArr, finished) {\\n document.querySelector('#table').innerHTML = table(numProcesses, processPrefix,\\n allocationArr, needArr, maxArr, resourcesArr, finished)\\n}\",\n \"function RefreshTable() {\\n dc.events.trigger(function () {\\n alldata = tableDimension.top(Infinity);\\n datatable.fnClearTable();\\n datatable.fnAddData(alldata);\\n datatable.fnDraw();\\n });\\n }\",\n \"function updateTable() {\\n\\t// Check if plcs finished loading\\n\\tfor (var i = 0; i < g_plcs.length; ++i) {\\n\\t\\tif (g_plcs[i].err) {\\n\\t\\t\\tmoduleStatus(\\\"Error querying table\\\");\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\tif (g_plcs[i].ready != READY_ALL) return false;\\n\\t}\\n\\n\\t$(\\\"#detail-table-body\\\").html(\\\"\\\");\\n\\n\\tfor (var i = 0; i < g_plcs.length; ++i) {\\n\\t\\tvar row_name = \\\"detail-table-row-\\\" + i;\\n\\t\\t$(\\\"#detail-table-body\\\").append(\\\"\\\");\\n\\n\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + g_plcs[i].name + \\\"\\\");\\n\\n\\t\\tfor (var j = 0; j < 6; ++j)\\n\\t\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + g_plcs[i].ai[j].val + \\\"\\\");\\n\\n\\t\\tfor (var j = 0; j < 6; ++j)\\n\\t\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + g_plcs[i].di[j].val + \\\"\\\");\\n\\n\\t\\tfor (var j = 0; j < 6; ++j) {\\n\\t\\t\\tdo_val = g_plcs[i].do[j].val ? \\\"ON\\\" : \\\"OFF\\\";\\n\\t\\t\\tdo_class = \\\"btn do-button \\\" + (g_plcs[i].do[j].val ? \\\"btn-success\\\" : \\\"btn-secondary\\\");\\n\\t\\t\\tdo_txt = \\\"\\\";\\n\\t\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + do_txt + \\\"\\\");\\n\\t\\t}\\n\\t\\tconf_val = g_plcs[i].confirmation ? \\\"Pend\\\" : \\\"OK\\\";\\n\\t\\tconf_class = \\\"btn \\\" + (g_plcs[i].confirmation ? \\\"btn-warning\\\" : \\\"btn-info\\\")\\n\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\");\\n\\n\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\");\\n\\t}\\n\\t$('[data-toggle=\\\"tooltip\\\"]').tooltip({trigger : 'hover'});\\n\\tmoduleStatus(\\\"Table query OK\\\");\\n}\",\n \"function render(data) {\\r\\n\\t\\t\\t\\t\\t\\t$('#slc_Marca').children().remove();\\r\\n\\t\\t\\t\\t\\t\\t$('#slc_TipoVeiculo').children().remove();\\r\\n\\t\\t\\t\\t\\t\\tvar tabela = $('#tableDiv').append(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$('
').attr(\\\"id\\\", \\\"tabela\\\"));\\r\\n\\t\\t\\t\\t\\t\\tvar tHead = \\\"\\\";\\r\\n\\t\\t\\t\\t\\t\\t$('#tabela').append(tHead);\\r\\n\\t\\t\\t\\t\\t\\tvar rowH = \\\" \\\" + \\\"ID\\\" + \\\"Marca\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"Tipo Veiculo\\\" + \\\"Modelo\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"Status\\\" + \\\"Actions\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\";\\r\\n\\t\\t\\t\\t\\t\\t$('#tableHead').append(rowH);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$('#tabela').append(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$('').attr(\\\"id\\\", \\\"tabelaBody\\\"));\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$.each(data, function(index, value) {\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar td = $(\\\"\\\" + \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row1 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.idModelo + \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row2 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.idMarca.descMarca\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row3 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.idTipoV.descTipoV\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row4 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.descModelo\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row5 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.statusModelo\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// Efetua A Funcao Ao Clicar No\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// Botao\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// btn-update\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar buttonUpdate = $(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.attr(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"id\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"btn-update-\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ index)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.click({\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tp1 : this\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t}, setInputData);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar buttonRemove = $(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.attr(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"id\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"btn-remove-\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ index)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.click({\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tp1 : this\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t}, callRemoveServlet);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row6 = $(\\\"\\\");\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\trow6.append(buttonUpdate);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\trow6.append(buttonRemove);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row1);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row2);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row3);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row4);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row5);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row6);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$('#tabela tbody').append(td);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$('#set')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.append('');\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t})\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t// Preenche O Select Marca\\r\\n\\t\\t\\t\\t\\t\\tgetMarcas();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t// Preenche O Select TipoVeiculo\\r\\n\\t\\t\\t\\t\\t\\tgetTiposVeiculos();\\r\\n\\r\\n\\t\\t\\t\\t\\t}\",\n \"function generateTable(){\\n if(!table_data.length)\\n return;\\n //generate first header row with column names\\n var tmpl1='';\\n for(var i=0;i';\\n }\\n tmpl1+=' Add';\\n tmpl1+='';\\n\\n //generate rest of the rows\\n var tmpl2;\\n for(i=0;i';\\n tmpl2 += '
'+table_data[i][j]+'
';\\n }\\n tmpl2 += '';\\n tmpl2+='';\\n tmpl1=tmpl1.concat(tmpl2);\\n }\\n\\n //generate last row with add function\\n tmpl2='';\\n for(var j=0;j {\\n const cell = new TableCell({\\n header: true\\n });\\n\\n this._addResizeHandle(cell, colIndex);\\n\\n // set preferred width\\n if (column.width !== undefined) {\\n cell.width = column.width;\\n }\\n\\n // add sort class to header cell\\n if (column.sortKey && this._sort.key === column.sortKey ||\\n column.sortFn && this._sort.fn === column.sortFn) {\\n cell.class.add(CLASS_SORT_CELL);\\n if (!this._sort.ascending) {\\n cell.class.add(CLASS_SORT_CELL_DESCENDING);\\n }\\n }\\n\\n const label = new Label({\\n text: column.title\\n });\\n // make inline to be able to use text-overflow: ellipsis\\n label.style.display = 'inline';\\n cell.append(label);\\n\\n // sort observers when clicking on header cell\\n cell.on('click', () => this.sortByColumnIndex(colIndex));\\n\\n headRow.append(cell);\\n });\\n\\n this.head.append(headRow);\\n }\\n\\n if (!this._observers) return;\\n\\n this._sortObservers();\\n\\n this._observers.forEach((observer) => {\\n const row = this._createRow(observer);\\n this.body.append(row);\\n });\\n }\",\n \"function _buildTable() {\\n // _displayLoading(true);\\n _addGradeRange();\\n _renderSelects();\\n var table = _setupDataTable(renderTable());\\n renderFeatures();\\n}\",\n \"function refreshTable(domId) {\\n\\n //Remove the current table\\n $('table').remove();\\n var app = quickforms.app;\\n //Append the new table with the new options list\\n var newJson = [];\\n for (var row in quickforms.designer.values) {\\n if (quickforms.designer.values[row][quickforms.designer.lookup + 'Order'] >= 0)\\n newJson.push(quickforms.designer.values[row]);\\n }\\n newJson.sort(function (a, b) {\\n return parseInt(a[quickforms.designer.lookup + 'Order']) - parseInt(b[quickforms.designer.lookup + 'Order']);\\n });\\n displayEditingPage(JSON.stringify(newJson), quickforms.designer.lookup);\\n }\",\n \"function GenerateFullTable() {\\n\\n //debugger;\\n\\n if((Intern_TableDivName === undefined || Intern_TableDivName === null || Intern_TableDivName === \\\"\\\") ||\\n (Intern_TableDivElem === undefined || Intern_TableDivElem === null || Intern_TableDivElem === \\\"\\\"))\\n return;\\n\\n var Intern_TableHtml = '';\\n if (Intern_ArrayOfValues.length !== 0) {\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n if (Intern_TableFieldDispNames === undefined || Intern_TableFieldDispNames === null)\\n Intern_TableFieldDispNames = Intern_TableFieldIDs;\\n $.each(Intern_TableFieldDispNames, function (index, value) {\\n Intern_TableHtml = Intern_TableHtml + '';\\n });\\n if (Setting_IncludeUpDown || Setting_IncludeEdit || Setting_IncludeDelete) {\\n Intern_TableHtml = Intern_TableHtml + '';\\n }\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '
';\\n Intern_TableHtml = Intern_TableHtml + value;\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + Disp_OperationsTitle;\\n Intern_TableHtml = Intern_TableHtml + '
';\\n\\n Intern_TableDivElem.html(Intern_TableHtml);\\n\\n $(\\\"#\\\" + Intern_TableDivName + \\\" tbody\\\").html(GenerateTableData());\\n for (var i = 0; i < Intern_ArrayOfValues.length; i++)\\n AddEvents(i);\\n Intern_DictConcatInput = null;\\n }\\n }\",\n \"function updateTable() {\\n\\t_formatDatepicker();\\n\\t_updateTable('table-internal-order', true);\\n\\t_autoFormattingDate(\\\"input.datepicker\\\");\\n}\",\n \"function refreshTable() {\\n\\t// Empty the table body to refresh\\n\\tlet tbody = document.getElementById('tbody');\\n\\ttbody.innerHTML = '';\\n\\n\\t// Loop through todos and add cells.\\n\\tfor (var i = 0; i < todos.length; i++) {\\n\\t\\tlet todo = todos[i];\\n\\t\\taddTodoCell(todo, i+1);\\n\\t}\\n}\",\n \"onRowsRerender() {\\n this.scheduleDraw(true);\\n }\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredrows.length; i++) {\\n // Get get the current address object and its fields\\n var rows = filteredrows[i];\\n var fields = Object.keys(rows);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the rows object, create a new cell at set its inner text to be the current value at the current row's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = rows[field];\\n }\\n }\\n}\",\n \"function redrawTable(id){ \\n clearTable();\\n removeFromList(id);\\n povoateTable(); \\n setupDeleteListener();\\n setfilter();\\n}\",\n \"function renderData() {\\n tableBody.innerHTML = \\\"\\\";\\n for (var i = 0; i < tableData.length; i++) {\\n var data = tableData[i];\\n var rows = Object.keys(data);\\n var input = tableBody.insertRow(i);\\n for (var j = 0; j < rows.length; j++) {\\n var field = rows[j];\\n var cell = input.insertCell(j);\\n cell.innerText = data[field];\\n }\\n }\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredData.length; i++) {\\n // Get the current object and its fields\\n var data = filteredData[i];\\n var fields = Object.keys(data);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = data[field];\\n }\\n }\\n}\",\n \"function drawTable(){\\n for (employee of allEmployees){\\n newRow(employee);\\n }\\n}\",\n \"function drawDynamicTable() {\\n try {\\n var tableSortingColumns = [\\n { orderable: false },null, null, null, null, null, null, null,\\n ];\\n var tableFilteringColumns = [\\n { type: \\\"null\\\" },{ type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" },\\n ];\\n\\n var tableColumnDefs = [\\n\\n ];\\n //select tblletter.id as 'AutoCodeHide', tblletter.title as 'عنوان الخطاب ',tblletter.details as 'تفاصيل الخطاب', tbldepartmen.name as 'صادر من',to_d.name as 'صادر الي',tblUsers.User_Name as 'الراسل', 1 as ' تعديل /حذف' from tblletter inner join tbldepartmen on tblletter.from_dep=tbldepartmen.id inner join tbldepartmen to_d on to_d.id=tblletter.to_dep inner join tblUsers on tblletter.add_by=tblUsers.id where tblletter.type=2 and ISNUll(tblletter.deleted,0)=0\\n var initialSortingColumn = 0;\\n loadDynamicTable('out_outside_letters', \\\"AutoCodeHide\\\", tableColumnDefs, tableFilteringColumns, tableSortingColumns, initialSortingColumn, \\\"Form\\\");\\n } catch (err) {\\n alert(err);\\n }\\n}\",\n \"function renderTable(data) {\\n var table_data = data.data;\\n var height = data.height;\\n var width = data.width;\\n var table = document.getElementById(\\\"results-\\\" + current_tab);\\n $(\\\".no-table#tab-\\\" + current_tab).hide();\\n table.innerHTML = \\\"\\\";\\n $(\\\"h5\\\").hide();\\n for (var i = 0; i < height; i++) {\\n let row = document.createElement(\\\"tr\\\");\\n for (var j = 0; j < width; j++) {\\n let col;\\n if (i == 0 || j == 0) col = document.createElement(\\\"th\\\");\\n else col = document.createElement(\\\"td\\\");\\n col.appendChild(document.createTextNode(table_data[i][j]));\\n row.appendChild(col);\\n }\\n table.appendChild(row);\\n }\\n var current_date = new Date();\\n $(\\\".date#tab-\\\" + current_tab).text(current_date.toLocaleTimeString());\\n $(\\\"h5\\\").show();\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredTable.length; i++) {\\n var address = filteredTable[i];\\n var fields = Object.keys(address);\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = address[field];\\n }\\n }\\n}\",\n \"renderAndAdjust() {\\n this.hot.render();\\n\\n // Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.\\n this.hot.view.adjustElementsSize();\\n }\",\n \"function renderTable() {\\n \\n // Delete the list of cities prior to adding new city table data \\n // (necessary to prevent repeat of table data)\\n $(\\\"tbody\\\").empty();\\n\\n // Loop through the array of cities\\n for (var i = 0; i < citiesArray.length; i++) {\\n // Render new table row and table data elements for each city in the array.\\n var tRow = $(\\\"\\\");\\n var tData = $(\\\"\\\");\\n var tSpan = $(\\\"\\\");\\n\\n tSpan.addClass(\\\"city\\\");\\n tData.attr(\\\"data-name\\\", citiesArray[i]);\\n tData.attr(\\\"data-index\\\", i);\\n tSpan.text(citiesArray[i]);\\n\\n let button = $(\\\"';\\n cell5.innerHTML =\\n 'Subtotal: ' +\\n item.price * item.numItems +\\n \\\"\\\";\\n cell6.innerHTML =\\n '

Remove

';\\n }\",\n \"function rerender_branch_table(tree, test_results, annotations, element) {\\n $(element).empty();\\n render_branch_table(tree, test_results, annotations, element);\\n}\",\n \"function drawTable() {\\n let dow_chart_data = new google.visualization.DataTable();\\n dow_chart_data.addColumn('string', 'Δραστηριότητα');\\n dow_chart_data.addColumn('string', 'Ημέρα Περισσότερων Εγγραφών');\\n dow_chart_data.addRow(['IN_VEHICLE', dow_data['IN_VEHICLE']]);\\n dow_chart_data.addRow(['ON_BICYCLE', dow_data['ON_BICYCLE']]);\\n dow_chart_data.addRow(['ON_FOOT', dow_data['ON_FOOT']]);\\n dow_chart_data.addRow(['RUNNING', dow_data['RUNNING']]);\\n dow_chart_data.addRow(['STILL', dow_data['STILL']]);\\n dow_chart_data.addRow(['TILTING', dow_data['TILTING']]);\\n dow_chart_data.addRow(['UNKNOWN', dow_data['UNKNOWN']]);\\n\\n var dow_table = new google.visualization.Table(document.getElementById('dow-table-div'));\\n dow_table.draw(dow_chart_data, {showRowNumber: false, width: '100%', height: '100%'});\\n }\",\n \"function resetTable() {\\n\\n // clear the current data\\n clearTable();\\n \\n // use forEach and Object.values to populate the initial table\\n tableData.forEach((ufoSighting) => {\\n var row = tbody.append(\\\"tr\\\");\\n Object.values(ufoSighting).forEach(value => {\\n var cell = row.append(\\\"td\\\");\\n cell.text(value);\\n cell.attr(\\\"class\\\", \\\"table-style\\\");\\n }); // close second forEach\\n }); // close first forEach\\n}\",\n \"function renderTableData(code, changeCurrent) {\\r\\n const pre = select(`.table-data[data-table-code=\\\"${code}\\\"]`)\\r\\n const tableArray = JSON.parse(pre.textContent)\\r\\n\\r\\n if(!changeCurrent) {\\r\\n currentTable = code\\r\\n }\\r\\n\\r\\n // remove old table content\\r\\n tableBody.textContent = ''\\r\\n\\r\\n tableArray.forEach(obj => {\\r\\n const specieRow = document.createElement('tr')\\r\\n // specie link column\\r\\n const specieLinkCol = document.createElement('td')\\r\\n const specieLink = document.createElement('a')\\r\\n specieLink.setAttribute('href', obj.link)\\r\\n specieLink.textContent = obj.specie\\r\\n\\r\\n specieLinkCol.appendChild(specieLink)\\r\\n\\r\\n // specie color box\\r\\n const colorCol = document.createElement('td')\\r\\n const colorBox = document.createElement('span')\\r\\n colorBox.classList.add('specie_color-box')\\r\\n colorBox.style = `background-color: ${obj.color}`\\r\\n\\r\\n colorCol.appendChild(colorBox)\\r\\n\\r\\n // species months\\r\\n const monthsCol = document.createElement('td')\\r\\n const monthsDiv = document.createElement('div')\\r\\n monthsDiv.classList.add('months')\\r\\n months.forEach(month => {\\r\\n const monthBox = document.createElement('span')\\r\\n monthBox.classList.add('month-box')\\r\\n\\r\\n monthsDiv.appendChild(monthBox)\\r\\n })\\r\\n\\r\\n const monthBoxes = selectAll('span.month-box', monthsDiv)\\r\\n\\r\\n obj.months.forEach(month => {\\r\\n monthBoxes[month - 1].classList.add('filled')\\r\\n })\\r\\n\\r\\n monthsCol.appendChild(monthsDiv)\\r\\n\\r\\n\\r\\n // append children to specie\\r\\n specieRow.appendChild(specieLinkCol)\\r\\n specieRow.appendChild(colorCol)\\r\\n specieRow.appendChild(monthsCol)\\r\\n\\r\\n tableBody.appendChild(specieRow)\\r\\n })\\r\\n }\",\n \"refreshPage() {\\n $(\\\"#tableMasterHeader tr\\\").last().remove();\\n this.drawFilterForTable(\\\"#tableMasterHeader\\\");\\n $(\\\".ASC\\\").removeClass(\\\"ASC\\\");\\n $(\\\".DESC\\\").removeClass(\\\"DESC\\\");\\n $(\\\"#PageSize\\\").val(50);\\n $(\\\"#offsetRow\\\").val(1);\\n $('#tableMasterHeader th[property=\\\"RefDate\\\"]').addClass(\\\"DESC\\\");\\n var data = this.getValueToLoadData();\\n data[\\\"OrderQuery\\\"] = resource.OrderBy.RefDateDesc;\\n this.order = resource.OrderBy.RefDateDesc;\\n this.loadDataMaster(data);\\n }\",\n \"function renderTable() { \\r\\n $tbody.innerHTML = \\\"\\\";\\r\\n var length = filteredData.length;\\r\\n for (var i = 0; i < length; i++) {\\r\\n // Get get the current address object and its fields\\r\\n var data = filteredData[i]; \\r\\n var fields = Object.keys(data); \\r\\n // Create a new row in the tbody, set the index to be i + startingIndex\\r\\n var $row = $tbody.insertRow(i);\\r\\n for (var j = 0; j < fields.length; j++) {\\r\\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\\r\\n var field = fields[j];\\r\\n var $cell = $row.insertCell(j);\\r\\n $cell.innerText = data[field];\\r\\n }\\r\\n }\\r\\n}\",\n \"function table_reset() {\\n $('.crash-table tbody').html(\\\"\\\");\\n}\",\n \"function reset() {\\n d3.selectAll(\\\"#tableVis table tr\\\").style(\\\"font-weight\\\", \\\"normal\\\");\\n destroyVis();\\n colleges = Object.keys(current_json);\\n autocomp();\\n createVis(current_json, current_csv);\\n}\",\n \"function render_table_chunk() {\\n\\n $tablehead.text('');\\n $tablebody.text('');\\n \\n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\\n\\n try {\\n \\n //setting up a header\\n var $headrow = $tablehead.append(\\\"tr\\\");\\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\\n\\n // setting up a table\\n chunkdata.forEach(function(item) {\\n var $bodyrow = $tablebody.append('tr');\\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\\n });\\n }\\n\\n catch (error) {\\n console.log('NO data in the dataset');\\n $tablehead.append('tr')\\n .append('td')\\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\\n \\n d3.selectAll('.pagination')\\n .style('display', 'none'); \\n }\\n\\n $currentpage.text(currentPage);\\n window.name = JSON.stringify(alien_data);\\n numberOfPages = Math.ceil(alien_data.length / perPage);\\n \\n}\",\n \"function refreshTable() {\\n\\t\\tvar partners = [\\\"piston\\\", \\\"plumgrid\\\"];\\n\\t\\tfor (var i = 0; i < partners.length; i++) {\\n\\t\\t\\tdoAjaxSelects(partners[i])\\n\\t\\t}\\n\\t\\tsetTimeout(refreshTable, 1000);\\n\\t}\",\n \"function drawAppTable() {\\n var idTable = new Array('first_app', 'second_app', 'third_app');\\n var inc = 0, i = 1;\\n var tdEl;\\n // add appointments\\n for (var field in jsonAppsPerHour) {\\n document.getElementById(idTable[inc]).style.display = \\\"\\\";\\n console.log(\\\"in first loop idTable[\\\" + inc + \\\"] = \\\" + idTable[inc]);\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].PatientID;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].Fname;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].Lname;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].DocFullName;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].EmployeeID;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].AppointmentID;\\n \\n inc += 1;\\n i = 1;\\n }\\n if (inc < 3) { // have all table rows been filled?\\n for (var i = 2;i >= inc; i--) {\\n document.getElementById(idTable[i]).style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function buildTable(){\\n\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredUFOData.length; i++) {\\n\\n // Get UFO Data object and its fields\\n var UFOdata = filteredUFOData[i];\\n var fields = Object.keys(UFOdata);\\n\\n // Create new row in tbody\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n\\n // For every field in the UFOData object create a new cell at set its inner text to be the current value at the current address's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = UFOdata[field];\\n }\\n\\n }\\n\\n}\",\n \"function init() {\\n theTable.innerHTML = '';\\n makeHeader();\\n for(var i = 0; i < Shop.all.length; i++){\\n Shop.all[i].render();\\n }\\n makeFooter();\\n}\",\n \"function remplirTableau() {\\r\\n tabIsEmpty = false;\\r\\n tbody.empty();\\r\\n var html = \\\"\\\";\\r\\n data.forEach(function (element) {\\r\\n html = '' +\\r\\n '' + element.order + '' +\\r\\n '' + element.activity + '' +\\r\\n '' + element.manager + '' +\\r\\n '' + element.numofsub + '' +\\r\\n '';\\r\\n tbody.append(html);\\r\\n });\\r\\n }\",\n \"function clearContent(){\\n\\t$('#output').html('
');\\n}\",\n \"function effacerTableau() {\\r\\n tabIsEmpty = true;\\r\\n tbody.empty();\\r\\n }\",\n \"function reload(){\\n\\tvar body = document.getElementById(\\\"body\\\");\\n\\twhile(body.firstChild){\\n\\t\\tbody.removeChild(body.firstChild);\\n\\t}\\n\\tvar table = document.createElement(\\\"table\\\");\\n\\ttable.id = \\\"firstTable\\\";\\n\\ttable.classList = \\\"table table-hover\\\";\\n\\tvar thead = document.createElement(\\\"thead\\\");\\n\\tthead.id = \\\"thead\\\";\\n\\tthead.classList = \\\"thead-dark\\\";\\n\\tvar tbody = document.createElement(\\\"tbody\\\");\\n\\ttbody.id = \\\"tbody\\\";\\n\\ttable.appendChild(thead);\\n\\ttable.appendChild(tbody);\\n\\tbody.appendChild(table);\\n}\",\n \"function drawTable() {\\n var id = 1;\\n var productData = '';\\n\\n $(\\\"#product-table > tbody\\\").empty();\\n\\n $.getJSON(\\\"/Products\\\", function (data) {\\n if (data != 0) {\\n $.each(data, function (key, value) {\\n productData += '';\\n productData += '' + id++ + '';\\n productData += ' ' + value.name + '';\\n productData += '' + value.code + '';\\n productData += '' + value.group_name + '';\\n productData += '' + unitArray[value.unit] + '';\\n productData += '' + value.description + '';\\n productData += ' ';\\n productData += '';\\n codeOfLastProduct = value.code;\\n });\\n $(\\\"#product-table\\\").append(productData);\\n displayTable();\\n }\\n else {\\n removeTable();\\n }\\n });\\n }\",\n \"renderTable() {\\n if (!this.hasSetupRender()) {\\n return;\\n }\\n\\n // Iterate through each found schema\\n // Each of them will be a table\\n this.parsedData.forEach((schemaData, i) => {\\n const tbl = document.createElement('table');\\n tbl.className = `${this.classNamespace}__table`;\\n\\n // Caption\\n const tblCaption = document.createElement('caption');\\n const tblCaptionText = document.createTextNode(`Generated ${this.schemaName} Schema Table #${i + 1}`);\\n tblCaption.appendChild(tblCaptionText);\\n\\n // Table Head\\n const tblHead = document.createElement('thead');\\n const tblHeadRow = document.createElement('tr');\\n const tblHeadTh1 = document.createElement('th');\\n const tblHeadTh2 = document.createElement('th');\\n const tblHeadTh1Text = document.createTextNode('itemprop');\\n const tblHeadTh2Text = document.createTextNode('value');\\n tblHeadTh1.appendChild(tblHeadTh1Text);\\n tblHeadTh2.appendChild(tblHeadTh2Text);\\n tblHeadRow.appendChild(tblHeadTh1);\\n tblHeadRow.appendChild(tblHeadTh2);\\n tblHead.appendChild(tblHeadRow);\\n\\n const tblBody = document.createElement('tbody');\\n\\n generateTableBody(tblBody, schemaData);\\n\\n // put the in the \\n tbl.appendChild(tblCaption);\\n tbl.appendChild(tblHead);\\n tbl.appendChild(tblBody);\\n // appends
into container\\n this.containerEl.appendChild(tbl);\\n // sets the border attribute of tbl to 0;\\n tbl.setAttribute('border', '0');\\n });\\n\\n // Close table btn\\n const closeBtn = document.createElement('button');\\n closeBtn.setAttribute('aria-label', 'Close');\\n closeBtn.setAttribute('type', 'button');\\n closeBtn.className = 'schema-parser__close';\\n this.containerEl.appendChild(closeBtn);\\n // Add close handler\\n closeBtn.addEventListener('click', this.handleClose.bind(this));\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.7407916","0.73421526","0.731697","0.7130859","0.70566887","0.68977284","0.6853059","0.67965204","0.6790126","0.67550945","0.67364925","0.66919464","0.6648768","0.6648","0.66468537","0.6614461","0.6550473","0.65374005","0.6521049","0.6520708","0.6518475","0.6507798","0.6489031","0.6475376","0.6457053","0.6447409","0.6446392","0.63909656","0.6389993","0.63896865","0.63894475","0.63862705","0.63778657","0.63638604","0.63584983","0.63336426","0.6329898","0.6325228","0.6315492","0.63098437","0.6308456","0.63011056","0.6291633","0.62906194","0.6286708","0.62790257","0.6278808","0.6275707","0.6270439","0.62698215","0.6269473","0.6266523","0.62581134","0.6257615","0.62393355","0.62353265","0.62348413","0.6213935","0.6213625","0.6212537","0.6212475","0.62110966","0.62084347","0.62067896","0.61994284","0.6198757","0.6195235","0.61923605","0.61901754","0.61899155","0.61749935","0.6173306","0.616825","0.6165843","0.61592937","0.61421597","0.6140533","0.6137206","0.61332047","0.61331904","0.61318433","0.61221015","0.6120195","0.61198705","0.61152565","0.611268","0.6109116","0.61077565","0.6105203","0.60969776","0.6093599","0.60924274","0.6089217","0.60847336","0.6071179","0.60691625","0.6067262","0.60660106","0.606497","0.60611016","0.6044294"],"string":"[\n \"0.7407916\",\n \"0.73421526\",\n \"0.731697\",\n \"0.7130859\",\n \"0.70566887\",\n \"0.68977284\",\n \"0.6853059\",\n \"0.67965204\",\n \"0.6790126\",\n \"0.67550945\",\n \"0.67364925\",\n \"0.66919464\",\n \"0.6648768\",\n \"0.6648\",\n \"0.66468537\",\n \"0.6614461\",\n \"0.6550473\",\n \"0.65374005\",\n \"0.6521049\",\n \"0.6520708\",\n \"0.6518475\",\n \"0.6507798\",\n \"0.6489031\",\n \"0.6475376\",\n \"0.6457053\",\n \"0.6447409\",\n \"0.6446392\",\n \"0.63909656\",\n \"0.6389993\",\n \"0.63896865\",\n \"0.63894475\",\n \"0.63862705\",\n \"0.63778657\",\n \"0.63638604\",\n \"0.63584983\",\n \"0.63336426\",\n \"0.6329898\",\n \"0.6325228\",\n \"0.6315492\",\n \"0.63098437\",\n \"0.6308456\",\n \"0.63011056\",\n \"0.6291633\",\n \"0.62906194\",\n \"0.6286708\",\n \"0.62790257\",\n \"0.6278808\",\n \"0.6275707\",\n \"0.6270439\",\n \"0.62698215\",\n \"0.6269473\",\n \"0.6266523\",\n \"0.62581134\",\n \"0.6257615\",\n \"0.62393355\",\n \"0.62353265\",\n \"0.62348413\",\n \"0.6213935\",\n \"0.6213625\",\n \"0.6212537\",\n \"0.6212475\",\n \"0.62110966\",\n \"0.62084347\",\n \"0.62067896\",\n \"0.61994284\",\n \"0.6198757\",\n \"0.6195235\",\n \"0.61923605\",\n \"0.61901754\",\n \"0.61899155\",\n \"0.61749935\",\n \"0.6173306\",\n \"0.616825\",\n \"0.6165843\",\n \"0.61592937\",\n \"0.61421597\",\n \"0.6140533\",\n \"0.6137206\",\n \"0.61332047\",\n \"0.61331904\",\n \"0.61318433\",\n \"0.61221015\",\n \"0.6120195\",\n \"0.61198705\",\n \"0.61152565\",\n \"0.611268\",\n \"0.6109116\",\n \"0.61077565\",\n \"0.6105203\",\n \"0.60969776\",\n \"0.6093599\",\n \"0.60924274\",\n \"0.6089217\",\n \"0.60847336\",\n \"0.6071179\",\n \"0.60691625\",\n \"0.6067262\",\n \"0.60660106\",\n \"0.606497\",\n \"0.60611016\",\n \"0.6044294\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":30,"cells":{"query":{"kind":"string","value":"Draw a grid (html table) according to the input values for height and width of user"},"document":{"kind":"string","value":"function drawHTMLGrid(height, width, gridID) {\n var gridHTML = document.getElementById(gridID);\n // Clear previous table and stop game of life algorithm\n gridHTML.innerHTML = \"\";\n clearInterval(globalInterval);\n // Create html table\n for (var i = 0; i < height; i++) {\n var row = gridHTML.insertRow(0);\n for (var j = 0; j < width; j++) {\n var cell = row.insertCell(0);\n cell.innerHTML = \"\";\n }\n }\n // Onclick a table element, change its class \n $(\".grid td\").click(function () {\n if (this.className == \"\")\n this.className = \"selected\";\n else\n this.className = \"\";\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 makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('');\n for (let j = 0; j < width; j++) {\n row.append('');\n }\n canvas.append(row);\n }\n}","function makeGrid (){\nvar in1= $('#input_height').val();\nvar in2= $('#input_width').val();\n$(\"#pixel_canvas\").html(table(in1,in2)); }","function makeGrid(inputHeight, inputWidth) {\n var grid = '';\n\n for (let i = 0; i < inputHeight; i++) {\n grid += '';\n for (let w = 0; w < inputWidth; w++) {\n grid += '';\n };\n grid += '';\n };\n\n //append grid to the table\n pixelCanvas.innerHTML = grid;\n}","function makeGrid() {\n // reset pixel canvas\n $(\"#pixelCanvas\").html(\"\");\n // Select size input\n height = $(\"#inputHeight\").val();\n width = $(\"#inputWeight\").val();\n //loop to add table cells and rows according to user input\n for (let x = 0; x < height; x++) {\n $('#pixelCanvas').append('');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('');\n });\n }\n}","function makeGrid(){\n\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\n\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\n\n\tfor(var i=0;i\"); //creating rows\n\t\tfor(var j=0;j\"); //creating columns\n\t\t}\n\t}\n}","function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" \");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" \");\n }\n}","function makeGrid(){\r\n $('#pixel_canvas').children().remove();\r\n row=$('#input_height').val();\r\n column=$('#input_width').val();\r\n var i=0;\r\n while(i');\r\n for(var j=0;j');\r\n }\r\n i++;\r\n }\r\n }","function makeGrid(event) {\n// Your code goes here!\n event.preventDefault();\n let height = heightInput.value;\n let width = widthInput.value;\n console.log(height + \",\" + width);\n while (pixelCanvas.firstChild) {\n pixelCanvas.removeChild(pixelCanvas.firstChild);\n }\n\n for (let i = 0; i < height; i++) {\n let newRow = document.createElement(\"tr\");\n for (let j = 0; j < width; j++) {\n let newTd = document.createElement(\"td\");\n newRow.appendChild(newTd);\n }\n pixelCanvas.append(newRow);\n }\n}","function makeGrid(inputWidth, inputHeight) {\n\tlet table = \"\";\n\n\tfor (let row = 0; row < inputHeight; row++) {\n\t\t$('.row').remove();\n\t\ttable += \"\";\n\t\tfor (let column = 0; column < inputWidth; column++) {\n\t\t\tif (column % 2 === 0 && row % 2 === 1) {\n\t\t\t\ttable += \"\";\n\t\t\t} else if (column % 2 === 1 && row % 2 === 0) {\n\t\t\t\ttable += \"\";\n\t\t\t} else {\n\t\t\t\ttable += \"\";\n\t\t\t}\n\t\t}\n\t\ttable += \"\";\n\t}\n\tpixelCanvas.append(table);\n}","function makeGrid() {\n\n // get the table element\n const canvas = document.getElementById('pixelCanvas');\n // reset grid\n while(canvas.firstChild) {\n canvas.removeChild(canvas.firstChild);\n }\n\n\n var width = sizeForm.width.value;\n var height = sizeForm.height.value;\n console.debug(width);\n console.debug(height);\n \n // create grid with height and width inputs\n for(y = 0; y < height; y++) {\n row = canvas.appendChild(document.createElement('TR'));\n for(x = 0; x < width; x++) {\n cell = row.appendChild(document.createElement('TD'));\n }\n }\n\n canvas.addEventListener('click', changeColor);\n\n}","function createGrid(width, height) {\n\n}","function makeGrid() {\n\t// hide the Grid by defult to show it in an animation style\n\ttable.hide();\n\ttable.empty();\n\n\tconst width = $('#input_width').val() ;\n\tconst height = $('#input_height').val() ;\n\n\t// no create the Grid !!\n\t// create the rows first (height).\n\tfor(var i = 0; i < height; i++) {\n\t\ttable.append('') ;\n\t}\n\t// then we create the columns(width).\n\tfor(var i = 0; i < width; i++) {\n\t\t$('.rows').append('') ;\n\t}\n}","function makeGrid(e) {\n // Select color input\n // const colorPicked = document.getElementById('colorPicker').value;\n // Select size input\n //height (tr)\n let inputHeight = document.getElementById('inputHeight').value;\n // console.log(inputHeight);\n //width (td)\n let inputWidth = document.getElementById('inputWidth').value;\n // console.log(inputWidth);\n // canvas\n let pixelCnvs = document.getElementById('pixelCanvas');\n pixelCnvs.innerHTML = '';\n // adding tr and td to the table\n let tableBody = document.createElement('tbody');\n for(let i = 0; i < inputHeight; i++) {\n let tableRow = document.createElement('tr');\n for (let j = 0; j < inputWidth; j++) {\n let tableColumn = document.createElement('td');\n tableColumn.appendChild(document.createTextNode(''));\n tableRow.appendChild(tableColumn);\n }\n tableBody.appendChild(tableRow);\n }\n pixelCnvs.appendChild(tableBody);\n e.preventDefault();\n\n}","function makeGrid(evt) {\n\t//access current height and width\n\txCell = $(\"#inputWidth\").val();\n\tyCell = $(\"#inputHeight\").val(); \n\t//access table element\n\ttable = $(\"#pixelCanvas\");\n\trows =\"\";//rows\n\tcols =\"\";//cols\n\t//create xCell no of row.\n\tfor(var r=1; r<=yCell; r++){\n\t\trows = rows + \"\";\n\t}\n\t//create ycell no of column in each row.\n\tfor(var c=1; c<=xCell; c++){\n\t\tcols = cols + \"\";\n\t}\n\t//create table with above rows and cols.\n\ttable.html(rows);\n\t$(\"tr\").html(cols);\n\t//do not submit.\n\tevt.preventDefault();\n}","function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('')\n }\n }\n}","function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function","function makeGrid(){\n\tfor(let row = 0; row < inputHeight.value; row++){\n\t\tconst tableRow = pixelCanvas.insertRow(row);\n\t\tfor(let cell = 0; cell < inputWidth.value; cell++){\n\t\t\tconst cellBlock = tableRow.insertCell(cell);\n\t\t}\n\t}\n}","function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('');\n }\n\n }","function makeGrid() {\n // Avoid the creation of repeating elements (h3, h4 tags)\n setInitialStates();\n\n const tableHeight = $('#input_height').val();\n const tableWidth = $('#input_width').val();\n\n // clear the old canvas\n myTable.children().remove();\n\n //Set maximum limit for number inputs\n if(tableHeight>50||tableWidth>50){\n alert(\"Please Insert a Number Between 1 and 50 for GRID Height & Width\");\n // Function the removes the unnecessary info tags (at this point)\n setInitialStates();\n // Reset the input values\n $(\"form input[type=number]\").val(\"1\");\n return true;\n }else {\n // Create the table\n for (let n = 1; n<=tableHeight; n++){\n // Create rows\n myTable.append('');\n for(let m = 1; m<=tableWidth; m++){\n $('tr').last().append('');\n }\n }\n // Add the extra info\n addInfo();\n }\n}","function makeGrid() {\n\n //Get nb of rows and cols input\n const rows = $(\"#inputHeight\").val();\n const cols = $(\"#inputWidth\").val();\n \n //the table\n const table = $(\"#pixelCanvas\");\n \n //Reset to the empty tabl, in case one already created\n table.children().remove();\n \n //Make rows\n for (let i = 0; i < rows; i++) {\n table.append(\"\");\n //Create cols\n for (let j = 0; j < cols; j++) {\n table.children().last().append(\"\");\n }\n }\n \n //Listen for cell clicks\n table.on(\"click\", \"td\", function() {\n //Get color from color picker\n let color = $(\"input#colorPicker\").val();\n //Apply color to cell\n $(this).attr(\"bgcolor\", color);\n });\n }","function makeGrid(height, width) {\n\n for (let i = 0; i < height; i++){\n const rows = document.createElement(\"tr\");\n for (let j = 0; j < width; j++){\n const cells = document.createElement(\"td\");\n rows.appendChild(cells);\n cells.setAttribute(\"id\", \"cell\" + [i]+[j]);\n cells.setAttribute(\"onclick\", \"drawPixels(this.id)\");\n }\n table.appendChild(rows);\n }\n}","function makeGrid(height, width) {\n table;\n var grid = '';\n\n for (var i = 0; i < height; i++){\n grid += '';\n for (var j = 0; j < width; j++){\n grid += '';\n }\n grid += '';\n }\n table.innerHTML = grid;\n addClickEventToCells();\n}","function makeGrid(height, width) {\n // create rows\n for (let i = 0; i < height; i++) {\n let row = document.createElement('tr');\n table_element.appendChild(row);\n // create columns\n for (let j = 0; j < width; j++) {\n let column = document.createElement('td');\n row.appendChild(column);\n // add event to cell\n column.addEventListener('mousedown', function () {\n let color = color_value.value;\n this.style.backgroundColor = color;\n });\n }\n }\n}","function makeGrid() {\n\n// Your code goes here!\n var height, width, grid, gridrow;\n height = $('#inputHeight').val();\n width = $('#inputWeight').val();\n grid = $('#pixelCanvas');\n gridrow = $('#pixelCanvas tr');\n\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++)\n grid.append('tr');\n }\n gridrow.append('td');\n}","function makeGrid() {\n\n let h = height.value;\n let w = width.value;\n\n // Clear table\n for (let i = table.rows.length; i > 0 ; i--) {\n table.deleteRow(i - 1);\n }\n\n for (let y = 0; y < h; y++) {\n const newTr = document.createElement('tr');\n table.appendChild(newTr);\n for (let x = 0; x < w; x++) {\n const newTd = document.createElement('td');\n table.lastChild.appendChild(newTd);\n }\n }\n\n let cell = table.querySelectorAll('td');\n\n for (let i = 0; i < cell.length; i++) {\n cell.item(i).addEventListener('click', function () {\n this.style.backgroundColor = color.value;\n });\n }\n}","function makeGrid(height,width,table){\n for(var r=0;r 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\n // $('.warning p').css('visibility', 'visible');\n // $('.warning p').fadeOut(7000, function() {\n // $(this).css('display', 'block');\n // $(this).css('visibility', 'hidden');\n // });\n // } else {\n\n // Actual function making all hard work :)\n for (let i = 0; i < canvasHeight; i++) {\n $('#pixel_canvas').append('');\n for (let i = 0; i < canvasWidth; i++) {\n $('tr:last-of-type').append('');\n };\n };\n}","function makeGrid() {\n // Removing previous grid if it exists\n $('tr').remove();\n // Setting variables for width and height\n const canvasWidth = $('#input_width').val();\n const canvasHeight = $('#input_height').val();\n // Conditional for checking correct input\n // NOT NEEDED ANYMORE\n\n // if (((canvasWidth < 1) || (canvasWidth > 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\n // $('.warning p').css('visibility', 'visible');\n // $('.warning p').fadeOut(7000, function() {\n // $(this).css('display', 'block');\n // $(this).css('visibility', 'hidden');\n // });\n // } else {\n\n // Actual function making all hard work :)\n for (let i = 0; i < canvasHeight; i++) {\n $('#pixel_canvas').append('');\n for (let i = 0; i < canvasWidth; i++) {\n $('tr:last-of-type').append('');\n };\n };\n}","function makeGrid(height,width) {\n\n// Your code goes here!\n event.preventDefault();\n var stgTable = \"\"\n for(var intCountHeight = 0; intCountHeight < height; intCountHeight++) {\n stgTable = stgTable + \"\";\n for(var intCountWidth = 0; intCountWidth < width; intCountWidth++) {\n stgTable = stgTable + \"\"\n };\n stgTable = stgTable + \"\";\n };\n\n tblElement.innerHTML = stgTable;\n\n}","function makeGrid(height, width) {\n // set size of canvas\n for (var i = 0; i < height.value; i++) {\n const row = canvas.insertRow(i); // calls the function to set size rows\n for (var j = 0; j < width.value; j++) {\n const cell = row.insertCell(j); // cal the function to set size of insertCell\n cell.addEventListner(\"click\", fillSquare);\n }\n }\n}","function makeGrid() {\n\n let height = document.getElementById('inputHeight').value;\n let width = document.getElementById('inputWidth').value;\n let table = document.getElementById('pixelCanvas');\n\n console.log(height, width)\n// clear table\ntable.innerHTML = '';\ncolor.value = '#000000'\n for (var i=0; i\"));\n\t\tfor(j = 0; j < width; j++){\n\t\t\t$(\"tr\").last().append($(\"\"));\n\t\t}\t\n\t}\n\n\t$(\"td\").on('click', function(event){\n\t\tconst painting = $('#colorPicker').val(); // Select color input\n\t\t$(event.target).css('background-color', painting); //painting the background of td with color picked by user\n\t});\n\n}","function makeGrid() {\r\n // Your code goes here!\r\n var height,width,table;\r\n\r\n //the value of height and width\r\n var height=$(\"#input_height\").val();\r\n var width=$(\"#input_width\").val();\r\n\r\n var table=$(\"#pixel_canvas\");\r\n\r\n\r\n //to create new table, we must delete the prev\r\n table.children().remove();\r\n\r\n //to create rows and columns\r\n for (var i=0; i\");\r\n for (var j=0; j\");\r\n }\r\n }\r\n\r\n //make event listener when we click on any cell, color it\r\n table.on(\"click\",\"td\",function() {\r\n var color=$(\"input[type='color']\").val();\r\n $(this).attr(\"bgcolor\",color);\r\n });\r\n}","function makeGrid() {\n\tlet\trowNUM = $('#inputHeight').val();\n\tlet\tcolumnNUM = $('#inputWeight').val();\n\t$('table').children().remove();\n\t\n\tfor(let i = 0;i < rowNUM; i++) {\n\t\t$('table').append('');\n\t\t}\n\tfor (let j = 0; j < columnNUM; j++) {\n\t\t$('tr').append('');\n\t\t}\n\t\n\t//上色\n\t$('td').on('click',function() {\n\tvar color = $('#colorPicker').val();\n\t$(this).attr('bgcolor', color);\n})\n}","function makeCells() {\n const rows = InputHeight.val();\n const cols = InputWidth.val();\n const pixelSize = InputSize.val() + 'px';\n const TotalCells = rows * cols;\n // Setting memory limit for undo-redo operations\n UndoLimit = (TotalCells < 400) ? 5 : (TotalCells < 1600) ? 3 : 2;\n // \"Start drawing\" button goes to the normal mode\n SubmitBtn.removeClass('pulse');\n // Creating table rows\n for (let i = 0; i < rows; i++) {\n Canvas.append('');\n }\n CanvasTr = $('.tr');\n // Creating cells to every row\n for (let j = 0; j < cols; j++) {\n CanvasTr.append('\"));\n for (let col = 0; col < width; col++) {\n $(\"tr\")\n .last()\n .append($(\"\"));\n\n $(\"td\").attr(\"class\", \"pixel\");\n }\n }\n}","function createDivs(gridDimension, canvasSize) {\n $(\".container\").children().remove();\n $(\".container\").append(\"
');\n }\n CanvasTd = $('.td');\n CanvasTr.css('height', pixelSize);\n CanvasTd.css('width', pixelSize);\n isSmthOnCanvas = false;\n // Turning off the context menu over canvas\n Canvas.contextmenu(function () {\n return false;\n })\n // Adding a delay for avoid overloading browser by simultaneously animation\n if (body.hasClass('checked') == false) {\n setTimeout(function () {\n CanvasBgr.slideToggle(250);\n }, 700);\n // For hiding useless elements\n body.addClass('checked');\n }\n else {\n CanvasBgr.slideToggle(250);\n };\n drawing();\n manageHistory();\n }","function makeGrid(height, width) {\n for (let row = 0; row < height; row++) {\n $(\"#pixelCanvas\").append($(\"
\");\n for(i=0; i< gridDimension; i++) {\n $(\".container\").append(\"\");\n for(j=0; j < gridDimension; j++) {\n $(\".container\").append(\"\")\n $(\"td\").css(\"height\", canvasSize/gridDimension);\n $(\"td\").css(\"width\", canvasSize/gridDimension);\n }\n $(\".container\").append(\"\");\n }\n $(\".container\").append(\"
\");\n drawOnCanvas(getColor());\n}","function makeGrid() {\n removeGrid();\n let rows = gridHeight.val();\n let columns = gridWidth.val();\n //Add Row to the Table\n for (let addRow = 0; addRow < rows; addRow++) {\n grid.append('');\n };\n //Add column to the table\n for (let addColumn = 0; addColumn < columns; addColumn++) {\n $(\"tr\").each(function() {\n $(this).append('');\n });\n }\n}","function makeGrid() {\nconst gridHeight = document.getElementById(\"inputHeight\").value;\nconst gridWidth = document.getElementById(\"inputWidth\").value;\nconst pixelCanvas = document.getElementById(\"pixel_Canvas\"); \npixelCanvas.innerText=\"\"; // empty table \n\nfor (let h=0; h (row) for each number on our height input\n for (var row = 0; row < Height; row++) {\n let newrow = tableplace.insertRow(row);\n// 4. We do a loop, inside the loop of step 4, to create a new column for each number on the input width\n for (var columns = 0; columns < Widht; columns++) {\n let newcell = newrow.insertCell(columns);\n //With this function Im going to let the user colored and specific square\n newcell.addEventListener(\"click\", function () {\n newcell.style.backgroundColor = color.value\n })\n }\n }\nevent1.preventDefault();\n}","function makeGrid() {\n\n// Your code goes here!\n\n const height = $(\"#input_height\").val();\n const width = $(\"#input_width\").val();\n const table = $(\"#pixel_canvas\");\n\n // Remove previous table\n table.children().remove();\n\n // Set the table\n for(let r = 0; r < height; r++ ){\n let tr = document.createElement(\"tr\");\n table.append(tr);\n\n for(let w = 0; w < width; w++){\n let td = document.createElement(\"td\");\n tr.append(td);\n }\n\n }\n\n // Submit the form and call function to set the grid\n $(\"#sizePicker\").submit(function(event){\n event.preventDefault();\n makeGrid();\n });\n\n // Declare clickable mouse event\n let mouseDown = false;\n\n $(\"td\").mousedown(function(event){\n mouseDown = true;\n const color = $(\"#colorPicker\").val();\n $(this).css(\"background\", color);\n // Mouse drag for drawing\n $(\"td\").mousemove(function(event){\n event.preventDefault();\n // Check if mouse is clicked and being held\n if(mouseDown === true){\n $(this).css(\"background\",color);\n }else{\n mouseDown = false;\n } \n });\n });\n\n // Mouse click release\n $(\"td\").mouseup(function(){\n mouseDown = false;\n });\n\n // Disable dragging when the pointer is outside the table\n $(\"#pixel_canvas\").mouseleave(\"td\",function(){\n mouseDown = false;\n });\n}","function insertTableCells(){\n const pixelCanvas = document.getElementById('pixelCanvas');\n const heightInput = document.getElementById('inputHeight');\n const widthInput = document.getElementById('inputWidth');\n\n for (let row = 0; row < heightInput.value; row++){\n tr = document.createElement('tr');\n trList.push(tr); // will add rows to trList to use them in cleanGrid\n pixelCanvas.appendChild(tr);\n for (let column = 0; column < widthInput.value; column++) {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n}","function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('');\n\t\t\t}\n\t\t$('#pixelCanvas').append('');\n\t}\n}","function makeGrid() {\n\tconst inputHeight = document.getElementById('inputHeight').value;//get the height value given by the user\n\tconst inputWidth = document.getElementById('inputWidth').value;//get the width value given by the user\n\tconst pixelCanvas = document.getElementById('pixelCanvas');// create a variable for the table\n pixelCanvas.innerHTML = \"\";//create a table. also reset the table after a new submit\n for (let x = 0; x < inputHeight; x++) {\n var row = document.createElement('tr');\n pixelCanvas.appendChild(row);//insert new element row in the table \n for (let y = 0; y < inputWidth; y++) {\n var column = document.createElement('td');\n row.appendChild(column); // insert new element column in the table\n\t\t\tcolumn.addEventListener('mousedown', function(e) { //implement clickListener on the td element\n \t\t\tlet color = document.getElementById('colorPicker').value;// get the color that the user has selected. i use let so that the color changes everytime the user choose a new one.\n \t\te.target.style.backgroundColor = color; // paint the td with the color\n\t\t\t})\n }\n }\n}","function makeGrid() {\n\n\t// Your code goes here!\n\t\n\tlet submit = $('input[type=\"submit\"]');\n\tlet canvas = $('#pixelCanvas');\n\tlet colorPicker = $('#colorPicker');\n\n\tsubmit.on('click', function(e){\n\t\te.preventDefault();\n\t\tcanvas.empty();\n\t\tlet height = $('#inputHeight').val();\n\t\tlet width = $('#inputWeight').val();\n\t\tconsole.log(height);\n\t\tconsole.log(width);\n\t\taddRows(height, width);\n\t});\n\t\n\tfunction addRows(height,width){\n\t\tfor(var i=0; i < height; i++) {\n\t\t\tcanvas.append('');\n\t\t}addColumns(width);\n\t}\n\t\n\tfunction addColumns(width){\n\t\tfor(var i=0; i ',{class:'cells'});\n\t\t\n\t\t\tcell.on('click',function(e){\n\t\t\t\te.preventDefault()\n\t\t\t\tlet color = colorPicker.val();\n\t\t\t\t$(this).css('background-color', color);\n\t\t\t});\n\n\t\t\t$('tr').append(cell);\n\t\t}\n\t}\n\n\t$('#clear').on('click', function(e){\n\t\te.preventDefault();\n\t\t$('.cells').css('background-color','');\n\t})\n}","function makeGrid() {\n canvas.find('tbody').remove();\n\n //submit button size changes to fit grid size\n var gridRows = heightInput.val();\n var gridCol = weightInput.val();\n\n //tbody set to the table\n canvas.append('');\n\n var canvasBody = canvas.find('tbody');\n\n //drawing grid rows\n for (var i = 0; i < gridRows; i++) {\n canvasBody.append('');\n }\n\n //draw grid col\n for (var i = 0; i < gridCol; i++) {\n canvas.find('tr').append('');\n }\n }","function makeGrid() {\n // prevent submit button from reloading page\n event.preventDefault();\n const grid = document.querySelector(\"table\");\n // clear any previously created table\n grid.innerHTML = \"\";\n // get the users size input\n const size = getSize();\n const width = size[0];\n const height = size[1];\n for (let y = 0; y < height; y++) {\n // table row is intitialized inside the for loop so as to create a different in each loop\n const tableRow = document.createElement(\"tr\");\n grid.appendChild(tableRow);\n for (let x = 0; x < width; x++) {\n const tableColumn = document.createElement(\"td\");\n tableRow.appendChild(tableColumn);\n }\n }\n grid.addEventListener(\"click\", setCellColor);\n}","function makeGrid(height, width) {//takes the width and height input from the user\r\n $('tr').remove(); //remove previous table if any\r\n for(var i =1; i<=width;i++){\r\n $('#pixelCanvas').append('');//the tableid plus table data\r\n for (var j =1; j <=height; j++){\r\n $('#table' + i).append('');\n };\n \n let trs = document.querySelectorAll(\"tr\");\n console.log(`trs.length is ${trs.length}`);\n for (let i = 0 ; i < gridWidth ; i++) { \n console.log(`before building column ${i} of ${gridWidth}`);\n \n for (let tr = 0; tr < trs.length; tr++) {\n console.log(`before building on tr ${tr} of ${trs.length}`);\n trs[tr].insertAdjacentHTML('beforeend', '');\n }\n }\n \n // creates the css background color decided before submit grid creation\n console.log(`background color is ${backgroundColor}`);\n //create variable for all cells\n let gridCells = document.querySelectorAll(\"td\");\n //paint all cells of the grid iterating through the nodelist gridCells\n for (let gridCell = 0; gridCell < gridCells.length; gridCell++) {\n console.log(`painting BG gridCell ${gridCell} of ${gridCells.length}`);\n gridCells[gridCell].style.backgroundColor = backgroundColor;\n }\n \n }","function makeGrid(HEIGHT,WIDTH) {\n\n// Your code goes here!\nfor (let i = 0; i < HEIGHT; i++) {\n $PCANVA.append('');\n };\n\n for (let i = 0; i < WIDTH; i++) {\n $('tr').append('');\n };\n}","function drawGrid() {\n noFill();\n stroke(230, 50);\n strokeWeight(2);\n\n for (let j = 0; j < config.numRows; j++) {\n for (let i = 0; i < config.numCols; i++) {\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\n }\n }\n }","function makeGrid() {\n //remove previous table if exists\n $('#gridTable').remove();\n const height = document.getElementById('input_height').value;\n const width = document.getElementById('input_width').value;\n\n\n // create table\n const table = document.createElement('table');\n table.id = \"gridTable\";\n\n // add rows and columns to the table\n for (let i = 0; i < height; ++i) {\n const row = table.insertRow(i);\n for (let j = 0; j < width; ++j) {\n const cell = row.insertCell(j);\n\n // add event listener to each cell such that\n // it is fillied with selected color when clicked\n cell.addEventListener('click', (e) => {\n changeColor(e);\n });\n }\n }\n\n // append the table to the canvas\n document.getElementById('pixel_canvas').append(table);\n}","function makeGrid(height, width) {\n\n\tfor(var x = 0; x < height; x++){\n\t\tlet row = table.insertRow(x); \n\t\tfor(var y = 0; y < width; y++){\n\t\t\tlet cell = row.insertCell(y);\n\t\t\tcell.addEventListener('click', function(event){\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcell.style.background = penColor.value; \n\t\t\t})\n\t\t}\n\t}\n\n\n}","function makeGrid(height,width) {\n //let row = table.insertRow(0);\n //let cell = row.insertCell(0);\n\n for (let i = 0; i <= height; i++){\n let row = table.insertRow(i); // for the rows\n for (let k = 0; k <= width; k++){\n let cell = row.insertCell(k); // for the columns\n // added eventListeners to each cell\n cell.addEventListener('click', (e) => {\n // to change the color of each cell clicked\n cell.style.backgroundColor = color.value;\n console.log(e);\n });\n \n }\n }\n\n // console.log(height,width);\n // Your code goes here!\n}","function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }","function table(size){\r\n\tvar div=document.getElementById(\"div\"); //select the div to draw grid on it\r\n\tvar createTable=document.createElement(\"table\"); \r\n\tdiv.appendChild(createTable); \r\n\tvar rows=[];\r\n\tvar rowsData=[];\r\n\tfor(var i=0;i\");\r\n\t\t createTable.appendChild(rows[i][0]);\r\n\t\t for(var j=0;j\");\r\n tdEle.css(\"width\",\"35px\");\r\n tdEle.css(\"height\",\"15px\");\r\n rowsData.push(tdEle);\r\n\t\t\t rows[i].append(tdEle); \r\n\t\t } \r\n\t}\r\n createTable.setAttribute(\"border\",\"1\");\r\n\tcreateTable.style.width=\"80%\";\r\n\t$(\"td\").on(\"click\",triggerTile); //set click event on the cells of the grid\r\n\treturn rowsData; //return array of cells\r\n}","function drawHlGrid(){\n\tvar obj = gridSize();\n\tvar canvas = document.getElementById('hl_grid');\n\t\n\tvar context = canvas.getContext('2d');\n\tcontext.scale(dpr,dpr);\n\t\n\t//Set the canvas size\n\tcanvas.width = (obj.colWidth * obj.cols+0.5)*dpr;\n\tcanvas.height = (obj.rowHeight*obj.rows+0.5)*dpr;\n\t\n\tcanvas.style.width = `${obj.colWidth * obj.cols+0.5}px`;\n\tcanvas.style.height = `${obj.rowHeight*obj.rows+0.5}px`;\n\tcontext.scale(dpr,dpr);\n\n}","function makeGrid(height, width) {\n\n for (let r = 0; r < height; r++) {\n let row = shape.insertRow(r);\n\n for (let c = 0; c < width; c++) {\n let cell = row.insertCell(c);\n\n cell.addEventListener('click', (event) => {\n cell.style.backgroundColor = chooseColor.value;\n });\n }\n }\n}","function drawgrid(tabinput, xbeg, y, plotwidth, plotheight, xaxistics, majorint) {\n\n var colwidth = plotwidth / tabinput.getRowCount();\n\n stroke(gridstroke);\n strokeWeight(gridweight);\n let x = xbeg;\n // columns\n for (let i = 0; i < xaxistics; i++) {\n if (!(i % majorint)) { strokeWeight(gridweight * 2) };\n line(x, y, x, y - plotheight);\n x += plotwidth / tabinput.getRowCount();\n strokeWeight(gridweight);\n };\n\n strokeWeight(gridweight * 2);\n line(x, y, x, y - plotheight);\n strokeWeight(gridweight);\n x += plotwidth / table.getRowCount();\n\n\n\n // rows\n\n}","function makeGrid() {\n\n// defining variables\n\nvar rowNumber = $('#input_height').val();\nvar colNumber = $('#input_width').val();\nvar table = $('#pixel_canvas');\n\ntable.children().remove();\n\n// adding rows\n\tfor(var i = 0; i < rowNumber; i++) {\n\t\ttable.append(\"\");\n\n\t\t//adding columns\n\t\tfor (var j = 0; j < colNumber; j++) {\n\t\t\ttable.children().last().append(\"\");\n\t\t}\n\t}\n\n// Event Listener table cell click\n\ttable.children().on('click', 'td', function() {\n\t\tvar color = $(\"input[type='color']\").val();\n\t\t$(this).attr('bgcolor', color);\n\t});\n\n// Event Listener table cell doubleclick\n\ttable.children().on('dblclick', 'td', function() {\n\t\t$(this).attr('bgcolor', 'transparent');\n\t});\n\n}","function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"
\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}","function makeGrid(form) {\n const height = form.input_height.value;\n const width = form.input_width.value;\n $('tr').remove();\n $('table').append(returnTable(height, width));\n}","function makeGrid() {\n\t\tfor(let col = 0; col < gridHeight; col++){\n\t\t\tconst cellRow = $(''); //CREATES TABLE ROWS\n\t\t\tcanvas.append(cellRow);\n\t\t\tfor (let row = 0; row < gridWidth; row++){\n\t\t\t\tconst cell = $('');\n\t\t\t\tcellRow.append(cell);\n\t\t\t};\n\t\t};\n\t}","function drawGrid() {\n let dotCount = Number(inputDotCount.value);\n let dotSize = Number(inputDotSize.value);\n let desiredGridWidth = Number(inputGridWidth.value);\n let columnCount = Math.floor(desiredGridWidth / dotSize);\n\n // dette er bare for å vise ønsket bredde på grid\n // (faktisk bredde styres også av prikkstørrelse)\n widthIndicator.style.width = desiredGridWidth + 'px';\n\n // sette hvor mye man skal øke/minke input-feltet for gridbredde når man bruker pil opp/ned\n inputGridWidth.step = dotSize;\n\n grid.style.gridTemplateColumns = `repeat(${columnCount}, ${dotSize}px)`;\n grid.style.gridAutoRows = dotSize + 'px';\n\n let html = '';\n for (let i = 0; i < dotCount; i++) {\n html += '
';\n }\n\n grid.innerHTML = html;\n}","function agpMakeGrid(evt) {\n // turn off the default event processing for the submit event\n evt.preventDefault();\n // reset the default canvas color to white as the default\n document.getElementById(\"colorPicker\").value = \"#ffffff\";\n\n // remove any existing art work\n let agpPixelCanvas=document.getElementById('pixelCanvas');\n while (agpPixelCanvas.hasChildNodes()) {\n agpPixelCanvas.removeChild(agpPixelCanvas.firstChild);\n }\n\n // retrieve the grid heoght and width\n let agpGridHeight=document.getElementById('inputHeight').value;\n let agpGridWidth=document.getElementById('inputWidth').value;\n\n // create the row elements and within those, the individual table cells\n for (var j=0;j\").find(\"div:last\").css({\r\n\t\t\t\t\"width\": cell_size,\r\n\t\t\t\t\"height\": cell_size\r\n\t\t\t});\r\n\t\t}\r\n\t\t//end the line\r\n\t\t$(\"#grid\").append(\"
\");\r\n\t}\r\n}","function makeGrid() {\n let body = $(\"#pixel_canvas\")[0];\n // $(body).html() = \"\";\n rowVal = $(\"#input_height\").val();\n colVal = $(\"#input_width\").val();\n for (let r = 0; r < rowVal; r++) {\n let row = body.insertRow(r);\n for (let c = 0; c < colVal; c++) {\n let cell = row.insertCell(c);\n $(cell).on('click', function(evt) {\n evt.target.style.backgroundColor = $(\"#colorPicker\").val();\n this.style.borderColor = \"#000\";\n });\n }\n }\n return false;\n}","function generateGrid(x = 4, y= 4){\n /* This function will generate a grid of x by y size */\n var html = \"\";\n\n for (let i = 0;i < y; i++) {\n for(let j = 0;j < x; j ++) {\n var content = getValue(i,j);\n if (j == 0){\n if (content == ''){\n html += \"\" + content + \"\";\n }\n else if( content == 2){\n html += \"\"+ content +\"\";\n }\n else if (content == 4){\n html += \"\"+ content +\"\";\n }\n else if (content == 8){\n html += \"\"+ content +\"\";\n }\n else if (content == 16){\n html += \"\"+ content +\"\";\n }\n else if (content == 32){\n html += \"\"+ content +\"\";\n }\n else if (content == 64){\n html += \"\"+ content +\"\";\n }\n else if (content == 128){\n html += \"\"+ content +\"\";\n }\n else if (content == 256){\n html += \"\"+ content +\"\";\n }\n else if (content == 512){\n html += \"\"+ content +\"\";\n }\n else if (content == 1024){\n html += \"\"+ content +\"\";\n }\n else if (content >= 2048){\n html += \"\"+ content +\"\";\n }\n }\n else if (j < x - 1){\n if (content == ''){\n html += \"\" + content + \"\";\n }\n else if( content == 2){\n html += \"\"+ content +\"\";\n }\n else if (content == 4){\n html += \"\"+ content +\"\";\n }\n else if (content == 8){\n html += \"\"+ content +\"\";\n }\n else if (content == 16){\n html += \"\"+ content +\"\";\n }\n else if (content == 32){\n html += \"\"+ content +\"\";\n }\n else if (content == 64){\n html += \"\"+ content +\"\";\n }\n else if (content == 128){\n html += \"\"+ content +\"\";\n }\n else if (content == 256){\n html += \"\"+ content +\"\";\n }\n else if (content == 512){\n html += \"\"+ content +\"\";\n }\n else if (content == 1024){\n html += \"\"+ content +\"\";\n }\n else if (content >= 2048){\n html += \"\"+ content +\"\";\n } \n }\n else if (j == x -1){\n if (content == ''){\n html += \"\" + content + \"\";\n }\n else if( content == 2){\n html += \"\"+ content +\"\";\n }\n else if (content == 4){\n html += \"\"+ content +\"\";\n }\n else if (content == 8){\n html += \"\"+ content +\"\";\n }\n else if (content == 16){\n html += \"\"+ content +\"\";\n }\n else if (content == 32){\n html += \"\"+ content +\"\";\n }\n else if (content == 64){\n html += \"\"+ content +\"\";\n }\n else if (content == 128){\n html += \"\"+ content +\"\";\n }\n else if (content == 256){\n html += \"\"+ content +\"\";\n }\n else if (content == 512){\n html += \"\"+ content +\"\";\n }\n else if (content == 1024){\n html += \"\"+ content +\"\";\n }\n else if (content >= 2048){\n html += \"\"+ content +\"\";\n }\n } \n }\n }\n return html;\n}","function makeGrid() {\n\tevent.preventDefault();\n\tconst height = document.getElementById(\"input_height\").value;\n\tconst width = document.getElementById(\"input_width\").value;\n\tlet table = document.getElementById(\"pixel_canvas\");\n\tconst delELeCell = document.getElementsByClassName(\"cell\");\n\t//console.log(delELeCell.length);\n\tlet k = delELeCell.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delELeCell[k].parentNode;\n\t\tparent.removeChild(delELeCell[k]);\n\t\tk--;\n\t}\n\n\tconst delRow = document.getElementsByClassName(\"row\");\n\tk = delRow.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delRow[k].parentNode;\n\t\tparent.removeChild(delRow[k]);\n\t\tk--;\n\t}\n\n\tfor(let i = 0; i < height; i++){\n\t\tconst row = document.createElement(\"tr\");\n\t\trow.setAttribute(\"id\", `row_${i}`);\n\t\trow.setAttribute(\"class\", \"row\");\n\t\ttable.appendChild(row);\n\t\t//const findRow = document.getElementById(`row_${}`)\n\t\tfor(let j = 0; j < width; j++){\n\t\t\tconst column = document.createElement(`td`);\n\t\t\tcolumn.setAttribute(\"id\", `cell_${i}_${j}`);\n\t\t\tcolumn.setAttribute(\"class\", \"cell\");\n\t\t\trow.appendChild(column);\n\t\t}\n\t}\n\tconst buttonLen = document.getElementsByTagName(\"button\");\n\tif(buttonLen.length === 0){\n\t\tconst button = document.createElement(\"button\");\n\t\tconst text = document.createTextNode(\"Reset\");\n\t\tbutton.appendChild(text);\n\t\tdocument.getElementsByTagName(\"body\")[0].appendChild(button);\n\t}\n}","function createGrid(h, v){\n let width = 960 / h;\n for (var i = 1; i <= v * h; i++) {\n var div = document.createElement('div');\n div.className = 'cell';\n div.style.border = 'solid 1px black';\n container.appendChild(div);\n container.appendChild(br);\n }\n cellsEvent();\n container.style.display = 'grid';\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\n container.style.justifyContent = 'center';\n}","function makeGrid(gridHeight, gridWidth) {\n while (PIXEL_CANVAS.firstChild){\n \tPIXEL_CANVAS.removeChild(PIXEL_CANVAS.firstChild);\n }\n\n //Create the grid rows\n for (let gridRow = 0; gridRow < gridHeight; gridRow++) {\n const newRow = document.createElement('tr');\n PIXEL_CANVAS.appendChild(newRow);\n // insertAdjacentHTML('beforeend', '');\n for (let i = 0; i < gridWidth; i++) {\n const newCell = document.createElement('td');\n newRow.appendChild(newCell);\n }\n }\n}","function makeGrid(height, width) {\n \n// Your code goes here!\n// Create rows and columns\n \n for (let rows = 0; rows < height; rows++) {\n let row = table.insertRow(rows);\n for (var columns = 0; columns < width; columns++) {\n let cell = row.insertCell(columns);\n \n// Allow user to color each, individual cell\n \n cell.addEventListener('click', (e) => { \n let color = document.getElementById('colorPicker');\n cell.style.backgroundColor = color.value;\n });\n }\n }\n}","function makeGrid() {\n gridCanvas.innerHTML = \"\";\n var rowCount = gridHeight.value;\n var cellCount = gridWidth.value;\n for (let r = 0; r < rowCount; r++) {\n var tr = document.createElement(\"tr\");\n gridCanvas.appendChild(tr);\n var newRow = gridCanvas.insertRow(r);\n \n for (let c = 0; c < cellCount; c++) {\n var td = document.createElement(\"td\");\n tr.appendChild(td);\n td.addEventListener('click', fillGrid); //Event listeners are properly added to the grid squares (and not to the border or the table itself).\n var cell = newRow.insertCell(c);\n cell.addEventListener('click', fillGrid);\n }\n }\n}","function makeGrid(x,y) {\n $('#pixel_canvas').empty();\n for(let i=0; i');\n $('#pixel_canvas').append(row);\n for(let j=0; j');\n }\n }\n}","function makeGrid(){\n\n table.innerHTML =''; //czyszczenie tabeli\n\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\n\n for(let h = 0; h < gridHeight.value; h++){\n let tr = document.createElement('tr');\n fragment.appendChild(tr);\n for(let w = 0; w < gridWitdh.value; w++){\n let td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n table.appendChild(fragment);\n colorSet();\n colorClick();\n colorRemove();\n}","function makeCells() {\n let rowsI = document.getElementById('rows-input');\n let columnsI = document.getElementById('columns-input');\n let cellAmount = rowsI.value * columnsI.value;\n console.log(rowsI.value);\n console.log(columnsI.value);\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\n for (i = 0; i < cellAmount; i++){\n let cell = document.createElement('div');\n cell.className = 'cell';\n cell.id = `cell-${i}`;\n board.appendChild(cell);\n }\n}","function makeGrid(height, width) {\n\n//console.log(height.value, width.value);\n \n//const row = table.insertRow(0);\n//const cell = row.insertCell(0);\n\n// Your code goes here!\nfor(let i = 0; i <= height; i++){\n let row = table.insertRow(i);\n for(let j = 0; j <= width; j++){\n let cell = row.insertCell(j);\n cell.addEventListener('click',(e) => {\n console.log(e);\n cell.style.background = color.value;\n });\n }\n}\n\n}","function makeGrid(h,w) {\n for(let i = 1; i <= h; i++) {\n grid.append(\"\");\n let j = 1;\n while (j <= w){\n $(\"tr\")\n .last()\n .append(\"\");\n j++;\n }\n } \n}","function makeGrid(h,l) {\n // Remove previous grid if any\n $(grid).children().remove();\n // Loops to draw new Grid\n for (i=0 ; i\"); // Add a cell at the end of the current row\n }\n }\n}","function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}","function plot(rows = 36, cols = 64) {\n\n /* 'c' will contain the whole generated html rect tags string to change innerhtml of enclosing div */\n /* 'y' will denote the 'y' coordinate where the next grid must be placed */\n let c = \"\", y = 0;\n\n /* Looping for each row */\n for (let i = 0; i < rows; i++) {\n\n /* 'x' is a coordinate denoting where the next grid must be placed */\n var x = 0;\n\n /* For each row we will loop for each column present in the Grid */\n for (let j = 0; j < cols; j++) {\n\n /* 'colr' will store the rest grid color which is dark gray currently */\n let colr = grid_color;\n\n /* If the Rectange present in the grid is on the border side then change the color in order to highlight borders */\n if(i === 0 || j === 0 || i === rows - 1 || j === cols - 1){\n colr = border_color;\n }\n\n /* Creating a rect tag that is appending in 'c' for now and will be updated to innerhtml of enclosing div */\n /* I know you will be wondering about the id given to each rect :-\n * Each rect must be provided with id in order to do anything with the corresponding rect.\n * Operations like coloring the grid as well saving saving any number in corresponding matrix needs an id of the rect.\n * Hence id is important to allot to each rect to make further changes in matrix on which whole algo is based.\n * In order to assing every rect id i decided to allot their corresponding row_number + : + col_number to be as id\n * As with this scenario it is easy to remember and will be unique for every rect tag. \n */\n c += ``;\n\n /* Incrementing the 'x' coordinate as we have width of 30px and hence 'x' coordinate for next rect will be +30 from current pos. */\n x += 30;\n }\n\n /* Incrementing the 'y' coordinate as we have placed sufficient rect in 1 row now need to advance 'y' as height of each rect \n is 30px hence for every rect in next column the y coordinate will be +30*/\n y += 30;\n }\n\n /* At last after creating rect tags using loops, now update innerHtml of enclosing div with id='container'[grid.html] */\n document.getElementById(\"container\").innerHTML = c;\n\n /* I wanted to preplace the Source - coordinate so at rect with id='src_crd' will be coloured green */\n document.getElementById(src_crd).style.fill = \"rgb(0, 255, 0)\";\n matrix[split(src_crd, 0)][split(src_crd, 1)] = 1; /* Update the pos as '1' to denote source location */\n\n /* I wanted to preplace the Destination - coordinate so at rect with id='dst_crd' will be coloured Red */\n document.getElementById(dst_crd).style.fill = \"rgb(255, 0, 0)\";\n matrix[split(dst_crd, 0)][split(dst_crd, 1)] = 2; /* Update the pos as '2' to denote Destination location */\n\n }","function makeGrid() {\n const GRID = $(\"#pixel_canvas\");\n\n // Select size input\n const COLUMNS = $(\"#input_width\").val();\n const ROWS = $(\"#input_height\").val();\n\n // Clears the table\n GRID.children().remove();\n\n // Limit the grid size to avoid browser crash\n if (COLUMNS <= 50 && ROWS <= 50) {\n // Adds new rows\n for (let i = 0; i < ROWS; i++) {\n GRID.append(\"\");\n\n // Adds new columns\n for (let j = 0; j < COLUMNS; j++)\n GRID.children()\n .last()\n .append(\"\");\n }\n }\n\n // Selects the grid tile\n tile = GRID.find(\"td\");\n\n // Allows the interaction with the grid\n tile.click(function() {\n // Selects color input\n let colorPicker;\n color = $(\"#colorPicker\").val();\n $(this).attr(\"bgcolor\", color);\n });\n // Erases single cell color\n tile.on(\"dblclick\", function() {\n let colorPicker;\n color = $(\"#colorPicker\").val();\n $(this).removeAttr(\"bgcolor\");\n });\n\n // Executes the action on the table and allows the color selection\n GRID.on(\"click\", \"td\", function() {\n const COLOR = $(\"input[type = 'color']#colorPicker\").val();\n $(this).attr(\"background-color\", COLOR);\n });\n}","function makeGrid(squaresPerSide) {\n\n //Add div rows(basically tr), to act as rows\n for (var i = 0; i < squaresPerSide; i++) {\n $('#pad').append('
');\n }\n\n //Add div squares(basically td), to ever row\n for (var i = 0; i < squaresPerSide; i++) {\n $('.row').append('
');\n }\n\n //Set square size= giant grid div divided by sqperside\n var squareDimension = $('#pad').width() / squaresPerSide;\n $('.square').css({\n 'height': squareDimension,\n 'width': squareDimension\n });\n}","drawGrid() {\n\n for (let i = 0; i <= HEIGHT; i += SQUARE_SIDE) {\n line(0, i, WIDTH, i);\n }\n for (let i = 0; i <= WIDTH; i += SQUARE_SIDE) {\n line(i, 0, i, HEIGHT);\n }\n\n }","function grid() {\n\tvar spaceX = 64;\n\tvar spaceY = spaceX;\n\n\tstroke(200);\n\tfor (var i = 64; i < width; i += 64) {\n\t\tline(i, 0, i, height);\n\t}\n\tfor (var i = 64; i < height; i += 64) {\n\t\tline(0, i, width, i);\n\t}\n}","function makeGrid() {\n\n const pixelGrid = document.querySelector('#pixelCanvas');\n\n pixelGrid.innerHTML = ''; //Clears previous grid\n\n inputHeight = document.querySelector('#inputHeight').value;\n inputWidth = document.querySelector('#inputWidth').value;\n\n if (inputHeight > 100) { //Limit grid height\n inputHeight = 100;\n };\n\n if (inputWidth > 100) { //Limit grid width\n inputWidth = 100;\n }\n\n //Get user selected color and set pixel color\n function colorClick() {\n color = document.querySelector('#colorPicker').value;\n event.target.style.backgroundColor = color;\n }\n\n // Build grid based on user form input\n for (var height = 0; height < inputHeight; ++height) { //Loop creates rows\n const newRow = document.createElement('tr');\n pixelGrid.appendChild(newRow);\n for (var width = 0; width < inputWidth; ++width) { //Loop create pixels\n const newPixel = document.createElement('td');\n newRow.appendChild(newPixel);\n newPixel.addEventListener('click', colorClick);//Add click event to pixels\n }\n }\n}","function makeGrid() {\n //variables to get canvas element,height,width\n var table = $(\"#pixelCanvas\");\n var gridHeight = $(\"#inputHeight\");\n var gridWidth = $(\"#inputWeight\");\n table.children().remove();\n for (x = 0; x < gridHeight.val(); x++) {\n table.append('');\n }\n rows = $('tr');\n for (y = 0; y < gridWidth.val(); y++) {\n rows.append('');\n } \n table.on( 'click','td', function() { \n var color = $(\"#colorPicker\"); \n $(this).attr('bgcolor', color.val()); \n });\n}","function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"
\");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}","function makeGrid() {\n $(\"tr\").remove();\n for (var h = 0; h < canvasHeight; h++) {\n var row = \"\";\n for (var w = 0; w < canvasWidth; w++) {\n tdNo++;\n row += '';\n }\n row += \"\";\n\n canvasCtl.append(row);\n }\n}","function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('
');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('
')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }","function makeGrid() {\r\n\r\n // Your code goes here!\r\n\r\n // Getting the grid height value from user\r\n const gridHeight = document.getElementById('inputHeight').value;\r\n // Getting the grid width value from user\r\n const gridWidth = document.getElementById('inputWidth').value;\r\n // Canvas table vairable\r\n const tableCanvas = document.getElementById('pixelCanvas');\r\n\r\n // Reset values to start\r\n tableCanvas.innerHTML = '';\r\n\r\n // Loop for inserting the rows\r\n for (let i = 0; i < gridHeight; i++) {\r\n let r = tableCanvas.insertRow(i);\r\n // Nested loop for inserting the cells\r\n for (let j = 0; j < gridWidth; j++) {\r\n let c = r.insertCell(j);\r\n // Action for the cells\r\n c.addEventListener('click', function(action) {\r\n // If the cell was pressed, the background color will change to the selected color\r\n action.target.style.backgroundColor = document.getElementById('colorPicker').value;\r\n });\r\n }\r\n }\r\n \r\n}","function makeGrid(input1, input2) {\n // make the table\n var table = document.getElementById('pixelCanvas');\n //to remove the table if the user decied to make another table\n table.innerHTML = \"\";\n // the loop here for row in table t\n for (var i = 0; i < input1; i++) {\n var row = document.createElement('tr');\n\n // the inner loopp for the cell and when user click in one of cell changed the color\n for (var j = 0; j < input2; j++) {\n var cell = document.createElement('td');\n row.appendChild(cell);\n cell.addEventListener('click', function(e) {\n var color = document.getElementById('colorPicker').value;\n e.target.style.backgroundColor = color;\n })\n }\n table.appendChild(row);\n }\n}"],"string":"[\n \"function makeGrid() {\\n const height = inputHeight.val();\\n const width = inputWidth.val();\\n\\n for (let i = 0; i < height; i++) {\\n const row = $('');\\n for (let j = 0; j < width; j++) {\\n row.append('');\\n }\\n canvas.append(row);\\n }\\n}\",\n \"function makeGrid (){\\nvar in1= $('#input_height').val();\\nvar in2= $('#input_width').val();\\n$(\\\"#pixel_canvas\\\").html(table(in1,in2)); }\",\n \"function makeGrid(inputHeight, inputWidth) {\\n var grid = '';\\n\\n for (let i = 0; i < inputHeight; i++) {\\n grid += '';\\n for (let w = 0; w < inputWidth; w++) {\\n grid += '';\\n };\\n grid += '';\\n };\\n\\n //append grid to the table\\n pixelCanvas.innerHTML = grid;\\n}\",\n \"function makeGrid() {\\n // reset pixel canvas\\n $(\\\"#pixelCanvas\\\").html(\\\"\\\");\\n // Select size input\\n height = $(\\\"#inputHeight\\\").val();\\n width = $(\\\"#inputWeight\\\").val();\\n //loop to add table cells and rows according to user input\\n for (let x = 0; x < height; x++) {\\n $('#pixelCanvas').append('');\\n }\\n for (let y = 0; y < width; y++) {\\n $('#pixelCanvas tr').each(function () {\\n $(this).append('');\\n });\\n }\\n}\",\n \"function makeGrid(){\\n\\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\\n\\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\\n\\n\\tfor(var i=0;i\\\"); //creating rows\\n\\t\\tfor(var j=0;j\\\"); //creating columns\\n\\t\\t}\\n\\t}\\n}\",\n \"function makeGrid() {\\n var {width, height} = size_input();\\n\\n for (rowNum = 0; rowNum < height; rowNum++) {\\n grid.append(\\\" \\\");\\n }\\n for (colNum = 0; colNum < width; colNum++) {\\n $(\\\"#pixel_canvas tr\\\").append(\\\" \\\");\\n }\\n}\",\n \"function makeGrid(){\\r\\n $('#pixel_canvas').children().remove();\\r\\n row=$('#input_height').val();\\r\\n column=$('#input_width').val();\\r\\n var i=0;\\r\\n while(i');\\r\\n for(var j=0;j');\\r\\n }\\r\\n i++;\\r\\n }\\r\\n }\",\n \"function makeGrid(event) {\\n// Your code goes here!\\n event.preventDefault();\\n let height = heightInput.value;\\n let width = widthInput.value;\\n console.log(height + \\\",\\\" + width);\\n while (pixelCanvas.firstChild) {\\n pixelCanvas.removeChild(pixelCanvas.firstChild);\\n }\\n\\n for (let i = 0; i < height; i++) {\\n let newRow = document.createElement(\\\"tr\\\");\\n for (let j = 0; j < width; j++) {\\n let newTd = document.createElement(\\\"td\\\");\\n newRow.appendChild(newTd);\\n }\\n pixelCanvas.append(newRow);\\n }\\n}\",\n \"function makeGrid(inputWidth, inputHeight) {\\n\\tlet table = \\\"\\\";\\n\\n\\tfor (let row = 0; row < inputHeight; row++) {\\n\\t\\t$('.row').remove();\\n\\t\\ttable += \\\"\\\";\\n\\t\\tfor (let column = 0; column < inputWidth; column++) {\\n\\t\\t\\tif (column % 2 === 0 && row % 2 === 1) {\\n\\t\\t\\t\\ttable += \\\"\\\";\\n\\t\\t\\t} else if (column % 2 === 1 && row % 2 === 0) {\\n\\t\\t\\t\\ttable += \\\"\\\";\\n\\t\\t\\t} else {\\n\\t\\t\\t\\ttable += \\\"\\\";\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\ttable += \\\"\\\";\\n\\t}\\n\\tpixelCanvas.append(table);\\n}\",\n \"function makeGrid() {\\n\\n // get the table element\\n const canvas = document.getElementById('pixelCanvas');\\n // reset grid\\n while(canvas.firstChild) {\\n canvas.removeChild(canvas.firstChild);\\n }\\n\\n\\n var width = sizeForm.width.value;\\n var height = sizeForm.height.value;\\n console.debug(width);\\n console.debug(height);\\n \\n // create grid with height and width inputs\\n for(y = 0; y < height; y++) {\\n row = canvas.appendChild(document.createElement('TR'));\\n for(x = 0; x < width; x++) {\\n cell = row.appendChild(document.createElement('TD'));\\n }\\n }\\n\\n canvas.addEventListener('click', changeColor);\\n\\n}\",\n \"function createGrid(width, height) {\\n\\n}\",\n \"function makeGrid() {\\n\\t// hide the Grid by defult to show it in an animation style\\n\\ttable.hide();\\n\\ttable.empty();\\n\\n\\tconst width = $('#input_width').val() ;\\n\\tconst height = $('#input_height').val() ;\\n\\n\\t// no create the Grid !!\\n\\t// create the rows first (height).\\n\\tfor(var i = 0; i < height; i++) {\\n\\t\\ttable.append('') ;\\n\\t}\\n\\t// then we create the columns(width).\\n\\tfor(var i = 0; i < width; i++) {\\n\\t\\t$('.rows').append('') ;\\n\\t}\\n}\",\n \"function makeGrid(e) {\\n // Select color input\\n // const colorPicked = document.getElementById('colorPicker').value;\\n // Select size input\\n //height (tr)\\n let inputHeight = document.getElementById('inputHeight').value;\\n // console.log(inputHeight);\\n //width (td)\\n let inputWidth = document.getElementById('inputWidth').value;\\n // console.log(inputWidth);\\n // canvas\\n let pixelCnvs = document.getElementById('pixelCanvas');\\n pixelCnvs.innerHTML = '';\\n // adding tr and td to the table\\n let tableBody = document.createElement('tbody');\\n for(let i = 0; i < inputHeight; i++) {\\n let tableRow = document.createElement('tr');\\n for (let j = 0; j < inputWidth; j++) {\\n let tableColumn = document.createElement('td');\\n tableColumn.appendChild(document.createTextNode(''));\\n tableRow.appendChild(tableColumn);\\n }\\n tableBody.appendChild(tableRow);\\n }\\n pixelCnvs.appendChild(tableBody);\\n e.preventDefault();\\n\\n}\",\n \"function makeGrid(evt) {\\n\\t//access current height and width\\n\\txCell = $(\\\"#inputWidth\\\").val();\\n\\tyCell = $(\\\"#inputHeight\\\").val(); \\n\\t//access table element\\n\\ttable = $(\\\"#pixelCanvas\\\");\\n\\trows =\\\"\\\";//rows\\n\\tcols =\\\"\\\";//cols\\n\\t//create xCell no of row.\\n\\tfor(var r=1; r<=yCell; r++){\\n\\t\\trows = rows + \\\"\\\";\\n\\t}\\n\\t//create ycell no of column in each row.\\n\\tfor(var c=1; c<=xCell; c++){\\n\\t\\tcols = cols + \\\"\\\";\\n\\t}\\n\\t//create table with above rows and cols.\\n\\ttable.html(rows);\\n\\t$(\\\"tr\\\").html(cols);\\n\\t//do not submit.\\n\\tevt.preventDefault();\\n}\",\n \"function makeGrid(height,width) {\\n for (let r = 0; r < height; r++) {\\n $('#pixel_canvas').prepend('');\\n for (let d = 0; d < width; d++) {\\n $('tr').first().append('')\\n }\\n }\\n}\",\n \"function makeGrid(height, width) {\\r\\n// Grid is cleared\\r\\n pixelCanvas.empty();\\r\\n// Create new grid\\r\\n// Create rows\\r\\n for (let row = 0; row < height; row++) {\\r\\n let tableRow = $('');\\r\\n// Create columns\\r\\n for (let col = 0; col < width; col++) {\\r\\n let tableCell = $('');\\r\\n// Append table data to create grid\\r\\n tableRow.append(tableCell);\\r\\n }// End col for loop\\r\\n pixelCanvas.append(tableRow);\\r\\n }// End row for loop\\r\\n }// End makeGrid function\",\n \"function makeGrid(){\\n\\tfor(let row = 0; row < inputHeight.value; row++){\\n\\t\\tconst tableRow = pixelCanvas.insertRow(row);\\n\\t\\tfor(let cell = 0; cell < inputWidth.value; cell++){\\n\\t\\t\\tconst cellBlock = tableRow.insertCell(cell);\\n\\t\\t}\\n\\t}\\n}\",\n \"function makeGrid() {\\n canvas.find('tablebody').remove();\\n\\n // \\\"submit\\\" the size form to update the grid size\\n let gridRows = gridHeight.val();\\n let gridCol = gridWeight.val();\\n\\n // set tablebody to the table\\n canvas.append('');\\n\\n let canvasBody = canvas.find('tablebody');\\n\\n // draw grid row\\n for (let i = 0; i < gridRows; i++) {\\n canvasBody.append('');\\n }\\n\\n // draw grid col\\nfor (let i = 0; i < gridCol; i++) {\\n canvas.find('tr').append('');\\n }\\n\\n }\",\n \"function makeGrid() {\\n // Avoid the creation of repeating elements (h3, h4 tags)\\n setInitialStates();\\n\\n const tableHeight = $('#input_height').val();\\n const tableWidth = $('#input_width').val();\\n\\n // clear the old canvas\\n myTable.children().remove();\\n\\n //Set maximum limit for number inputs\\n if(tableHeight>50||tableWidth>50){\\n alert(\\\"Please Insert a Number Between 1 and 50 for GRID Height & Width\\\");\\n // Function the removes the unnecessary info tags (at this point)\\n setInitialStates();\\n // Reset the input values\\n $(\\\"form input[type=number]\\\").val(\\\"1\\\");\\n return true;\\n }else {\\n // Create the table\\n for (let n = 1; n<=tableHeight; n++){\\n // Create rows\\n myTable.append('');\\n for(let m = 1; m<=tableWidth; m++){\\n $('tr').last().append('');\\n }\\n }\\n // Add the extra info\\n addInfo();\\n }\\n}\",\n \"function makeGrid() {\\n\\n //Get nb of rows and cols input\\n const rows = $(\\\"#inputHeight\\\").val();\\n const cols = $(\\\"#inputWidth\\\").val();\\n \\n //the table\\n const table = $(\\\"#pixelCanvas\\\");\\n \\n //Reset to the empty tabl, in case one already created\\n table.children().remove();\\n \\n //Make rows\\n for (let i = 0; i < rows; i++) {\\n table.append(\\\"\\\");\\n //Create cols\\n for (let j = 0; j < cols; j++) {\\n table.children().last().append(\\\"\\\");\\n }\\n }\\n \\n //Listen for cell clicks\\n table.on(\\\"click\\\", \\\"td\\\", function() {\\n //Get color from color picker\\n let color = $(\\\"input#colorPicker\\\").val();\\n //Apply color to cell\\n $(this).attr(\\\"bgcolor\\\", color);\\n });\\n }\",\n \"function makeGrid(height, width) {\\n\\n for (let i = 0; i < height; i++){\\n const rows = document.createElement(\\\"tr\\\");\\n for (let j = 0; j < width; j++){\\n const cells = document.createElement(\\\"td\\\");\\n rows.appendChild(cells);\\n cells.setAttribute(\\\"id\\\", \\\"cell\\\" + [i]+[j]);\\n cells.setAttribute(\\\"onclick\\\", \\\"drawPixels(this.id)\\\");\\n }\\n table.appendChild(rows);\\n }\\n}\",\n \"function makeGrid(height, width) {\\n table;\\n var grid = '';\\n\\n for (var i = 0; i < height; i++){\\n grid += '';\\n for (var j = 0; j < width; j++){\\n grid += '';\\n }\\n grid += '';\\n }\\n table.innerHTML = grid;\\n addClickEventToCells();\\n}\",\n \"function makeGrid(height, width) {\\n // create rows\\n for (let i = 0; i < height; i++) {\\n let row = document.createElement('tr');\\n table_element.appendChild(row);\\n // create columns\\n for (let j = 0; j < width; j++) {\\n let column = document.createElement('td');\\n row.appendChild(column);\\n // add event to cell\\n column.addEventListener('mousedown', function () {\\n let color = color_value.value;\\n this.style.backgroundColor = color;\\n });\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\n// Your code goes here!\\n var height, width, grid, gridrow;\\n height = $('#inputHeight').val();\\n width = $('#inputWeight').val();\\n grid = $('#pixelCanvas');\\n gridrow = $('#pixelCanvas tr');\\n\\n for (var x = 0; x < width; x++) {\\n for (var y = 0; y < height; y++)\\n grid.append('tr');\\n }\\n gridrow.append('td');\\n}\",\n \"function makeGrid() {\\n\\n let h = height.value;\\n let w = width.value;\\n\\n // Clear table\\n for (let i = table.rows.length; i > 0 ; i--) {\\n table.deleteRow(i - 1);\\n }\\n\\n for (let y = 0; y < h; y++) {\\n const newTr = document.createElement('tr');\\n table.appendChild(newTr);\\n for (let x = 0; x < w; x++) {\\n const newTd = document.createElement('td');\\n table.lastChild.appendChild(newTd);\\n }\\n }\\n\\n let cell = table.querySelectorAll('td');\\n\\n for (let i = 0; i < cell.length; i++) {\\n cell.item(i).addEventListener('click', function () {\\n this.style.backgroundColor = color.value;\\n });\\n }\\n}\",\n \"function makeGrid(height,width,table){\\n for(var r=0;r 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\\n // $('.warning p').css('visibility', 'visible');\\n // $('.warning p').fadeOut(7000, function() {\\n // $(this).css('display', 'block');\\n // $(this).css('visibility', 'hidden');\\n // });\\n // } else {\\n\\n // Actual function making all hard work :)\\n for (let i = 0; i < canvasHeight; i++) {\\n $('#pixel_canvas').append('');\\n for (let i = 0; i < canvasWidth; i++) {\\n $('tr:last-of-type').append('');\\n };\\n };\\n}\",\n \"function makeGrid() {\\n // Removing previous grid if it exists\\n $('tr').remove();\\n // Setting variables for width and height\\n const canvasWidth = $('#input_width').val();\\n const canvasHeight = $('#input_height').val();\\n // Conditional for checking correct input\\n // NOT NEEDED ANYMORE\\n\\n // if (((canvasWidth < 1) || (canvasWidth > 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\\n // $('.warning p').css('visibility', 'visible');\\n // $('.warning p').fadeOut(7000, function() {\\n // $(this).css('display', 'block');\\n // $(this).css('visibility', 'hidden');\\n // });\\n // } else {\\n\\n // Actual function making all hard work :)\\n for (let i = 0; i < canvasHeight; i++) {\\n $('#pixel_canvas').append('');\\n for (let i = 0; i < canvasWidth; i++) {\\n $('tr:last-of-type').append('');\\n };\\n };\\n}\",\n \"function makeGrid(height,width) {\\n\\n// Your code goes here!\\n event.preventDefault();\\n var stgTable = \\\"\\\"\\n for(var intCountHeight = 0; intCountHeight < height; intCountHeight++) {\\n stgTable = stgTable + \\\"\\\";\\n for(var intCountWidth = 0; intCountWidth < width; intCountWidth++) {\\n stgTable = stgTable + \\\"\\\"\\n };\\n stgTable = stgTable + \\\"\\\";\\n };\\n\\n tblElement.innerHTML = stgTable;\\n\\n}\",\n \"function makeGrid(height, width) {\\n // set size of canvas\\n for (var i = 0; i < height.value; i++) {\\n const row = canvas.insertRow(i); // calls the function to set size rows\\n for (var j = 0; j < width.value; j++) {\\n const cell = row.insertCell(j); // cal the function to set size of insertCell\\n cell.addEventListner(\\\"click\\\", fillSquare);\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\n let height = document.getElementById('inputHeight').value;\\n let width = document.getElementById('inputWidth').value;\\n let table = document.getElementById('pixelCanvas');\\n\\n console.log(height, width)\\n// clear table\\ntable.innerHTML = '';\\ncolor.value = '#000000'\\n for (var i=0; i\\\"));\\n\\t\\tfor(j = 0; j < width; j++){\\n\\t\\t\\t$(\\\"tr\\\").last().append($(\\\"\\\"));\\n\\t\\t}\\t\\n\\t}\\n\\n\\t$(\\\"td\\\").on('click', function(event){\\n\\t\\tconst painting = $('#colorPicker').val(); // Select color input\\n\\t\\t$(event.target).css('background-color', painting); //painting the background of td with color picked by user\\n\\t});\\n\\n}\",\n \"function makeGrid() {\\r\\n // Your code goes here!\\r\\n var height,width,table;\\r\\n\\r\\n //the value of height and width\\r\\n var height=$(\\\"#input_height\\\").val();\\r\\n var width=$(\\\"#input_width\\\").val();\\r\\n\\r\\n var table=$(\\\"#pixel_canvas\\\");\\r\\n\\r\\n\\r\\n //to create new table, we must delete the prev\\r\\n table.children().remove();\\r\\n\\r\\n //to create rows and columns\\r\\n for (var i=0; i\\\");\\r\\n for (var j=0; j\\\");\\r\\n }\\r\\n }\\r\\n\\r\\n //make event listener when we click on any cell, color it\\r\\n table.on(\\\"click\\\",\\\"td\\\",function() {\\r\\n var color=$(\\\"input[type='color']\\\").val();\\r\\n $(this).attr(\\\"bgcolor\\\",color);\\r\\n });\\r\\n}\",\n \"function makeGrid() {\\n\\tlet\\trowNUM = $('#inputHeight').val();\\n\\tlet\\tcolumnNUM = $('#inputWeight').val();\\n\\t$('table').children().remove();\\n\\t\\n\\tfor(let i = 0;i < rowNUM; i++) {\\n\\t\\t$('table').append('');\\n\\t\\t}\\n\\tfor (let j = 0; j < columnNUM; j++) {\\n\\t\\t$('tr').append('');\\n\\t\\t}\\n\\t\\n\\t//上色\\n\\t$('td').on('click',function() {\\n\\tvar color = $('#colorPicker').val();\\n\\t$(this).attr('bgcolor', color);\\n})\\n}\",\n \"function makeCells() {\\n const rows = InputHeight.val();\\n const cols = InputWidth.val();\\n const pixelSize = InputSize.val() + 'px';\\n const TotalCells = rows * cols;\\n // Setting memory limit for undo-redo operations\\n UndoLimit = (TotalCells < 400) ? 5 : (TotalCells < 1600) ? 3 : 2;\\n // \\\"Start drawing\\\" button goes to the normal mode\\n SubmitBtn.removeClass('pulse');\\n // Creating table rows\\n for (let i = 0; i < rows; i++) {\\n Canvas.append('');\\n }\\n CanvasTr = $('.tr');\\n // Creating cells to every row\\n for (let j = 0; j < cols; j++) {\\n CanvasTr.append('');\\n }\\n CanvasTd = $('.td');\\n CanvasTr.css('height', pixelSize);\\n CanvasTd.css('width', pixelSize);\\n isSmthOnCanvas = false;\\n // Turning off the context menu over canvas\\n Canvas.contextmenu(function () {\\n return false;\\n })\\n // Adding a delay for avoid overloading browser by simultaneously animation\\n if (body.hasClass('checked') == false) {\\n setTimeout(function () {\\n CanvasBgr.slideToggle(250);\\n }, 700);\\n // For hiding useless elements\\n body.addClass('checked');\\n }\\n else {\\n CanvasBgr.slideToggle(250);\\n };\\n drawing();\\n manageHistory();\\n }\",\n \"function makeGrid(height, width) {\\n for (let row = 0; row < height; row++) {\\n $(\\\"#pixelCanvas\\\").append($(\\\"\\\"));\\n for (let col = 0; col < width; col++) {\\n $(\\\"tr\\\")\\n .last()\\n .append($(\\\"\\\"));\\n\\n $(\\\"td\\\").attr(\\\"class\\\", \\\"pixel\\\");\\n }\\n }\\n}\",\n \"function createDivs(gridDimension, canvasSize) {\\n $(\\\".container\\\").children().remove();\\n $(\\\".container\\\").append(\\\"\\\");\\n for(i=0; i< gridDimension; i++) {\\n $(\\\".container\\\").append(\\\"\\\");\\n for(j=0; j < gridDimension; j++) {\\n $(\\\".container\\\").append(\\\"\\\")\\n $(\\\"td\\\").css(\\\"height\\\", canvasSize/gridDimension);\\n $(\\\"td\\\").css(\\\"width\\\", canvasSize/gridDimension);\\n }\\n $(\\\".container\\\").append(\\\"\\\");\\n }\\n $(\\\".container\\\").append(\\\"
\\\");\\n drawOnCanvas(getColor());\\n}\",\n \"function makeGrid() {\\n removeGrid();\\n let rows = gridHeight.val();\\n let columns = gridWidth.val();\\n //Add Row to the Table\\n for (let addRow = 0; addRow < rows; addRow++) {\\n grid.append('');\\n };\\n //Add column to the table\\n for (let addColumn = 0; addColumn < columns; addColumn++) {\\n $(\\\"tr\\\").each(function() {\\n $(this).append('');\\n });\\n }\\n}\",\n \"function makeGrid() {\\nconst gridHeight = document.getElementById(\\\"inputHeight\\\").value;\\nconst gridWidth = document.getElementById(\\\"inputWidth\\\").value;\\nconst pixelCanvas = document.getElementById(\\\"pixel_Canvas\\\"); \\npixelCanvas.innerText=\\\"\\\"; // empty table \\n\\nfor (let h=0; h (row) for each number on our height input\\n for (var row = 0; row < Height; row++) {\\n let newrow = tableplace.insertRow(row);\\n// 4. We do a loop, inside the loop of step 4, to create a new column for each number on the input width\\n for (var columns = 0; columns < Widht; columns++) {\\n let newcell = newrow.insertCell(columns);\\n //With this function Im going to let the user colored and specific square\\n newcell.addEventListener(\\\"click\\\", function () {\\n newcell.style.backgroundColor = color.value\\n })\\n }\\n }\\nevent1.preventDefault();\\n}\",\n \"function makeGrid() {\\n\\n// Your code goes here!\\n\\n const height = $(\\\"#input_height\\\").val();\\n const width = $(\\\"#input_width\\\").val();\\n const table = $(\\\"#pixel_canvas\\\");\\n\\n // Remove previous table\\n table.children().remove();\\n\\n // Set the table\\n for(let r = 0; r < height; r++ ){\\n let tr = document.createElement(\\\"tr\\\");\\n table.append(tr);\\n\\n for(let w = 0; w < width; w++){\\n let td = document.createElement(\\\"td\\\");\\n tr.append(td);\\n }\\n\\n }\\n\\n // Submit the form and call function to set the grid\\n $(\\\"#sizePicker\\\").submit(function(event){\\n event.preventDefault();\\n makeGrid();\\n });\\n\\n // Declare clickable mouse event\\n let mouseDown = false;\\n\\n $(\\\"td\\\").mousedown(function(event){\\n mouseDown = true;\\n const color = $(\\\"#colorPicker\\\").val();\\n $(this).css(\\\"background\\\", color);\\n // Mouse drag for drawing\\n $(\\\"td\\\").mousemove(function(event){\\n event.preventDefault();\\n // Check if mouse is clicked and being held\\n if(mouseDown === true){\\n $(this).css(\\\"background\\\",color);\\n }else{\\n mouseDown = false;\\n } \\n });\\n });\\n\\n // Mouse click release\\n $(\\\"td\\\").mouseup(function(){\\n mouseDown = false;\\n });\\n\\n // Disable dragging when the pointer is outside the table\\n $(\\\"#pixel_canvas\\\").mouseleave(\\\"td\\\",function(){\\n mouseDown = false;\\n });\\n}\",\n \"function insertTableCells(){\\n const pixelCanvas = document.getElementById('pixelCanvas');\\n const heightInput = document.getElementById('inputHeight');\\n const widthInput = document.getElementById('inputWidth');\\n\\n for (let row = 0; row < heightInput.value; row++){\\n tr = document.createElement('tr');\\n trList.push(tr); // will add rows to trList to use them in cleanGrid\\n pixelCanvas.appendChild(tr);\\n for (let column = 0; column < widthInput.value; column++) {\\n td = document.createElement('td');\\n tr.appendChild(td);\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\tfor (y = 0; y < sizeY; y++ ){\\n\\t\\t$('#pixelCanvas').append('');\\n\\t\\t\\tfor(x = 0; x< sizeX; x++ ){\\n\\t\\t\\t\\t$('#pixelCanvas tr:last-child').append('');\\n\\t\\t\\t}\\n\\t\\t$('#pixelCanvas').append('');\\n\\t}\\n}\",\n \"function makeGrid() {\\n\\tconst inputHeight = document.getElementById('inputHeight').value;//get the height value given by the user\\n\\tconst inputWidth = document.getElementById('inputWidth').value;//get the width value given by the user\\n\\tconst pixelCanvas = document.getElementById('pixelCanvas');// create a variable for the table\\n pixelCanvas.innerHTML = \\\"\\\";//create a table. also reset the table after a new submit\\n for (let x = 0; x < inputHeight; x++) {\\n var row = document.createElement('tr');\\n pixelCanvas.appendChild(row);//insert new element row in the table \\n for (let y = 0; y < inputWidth; y++) {\\n var column = document.createElement('td');\\n row.appendChild(column); // insert new element column in the table\\n\\t\\t\\tcolumn.addEventListener('mousedown', function(e) { //implement clickListener on the td element\\n \\t\\t\\tlet color = document.getElementById('colorPicker').value;// get the color that the user has selected. i use let so that the color changes everytime the user choose a new one.\\n \\t\\te.target.style.backgroundColor = color; // paint the td with the color\\n\\t\\t\\t})\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\n\\t// Your code goes here!\\n\\t\\n\\tlet submit = $('input[type=\\\"submit\\\"]');\\n\\tlet canvas = $('#pixelCanvas');\\n\\tlet colorPicker = $('#colorPicker');\\n\\n\\tsubmit.on('click', function(e){\\n\\t\\te.preventDefault();\\n\\t\\tcanvas.empty();\\n\\t\\tlet height = $('#inputHeight').val();\\n\\t\\tlet width = $('#inputWeight').val();\\n\\t\\tconsole.log(height);\\n\\t\\tconsole.log(width);\\n\\t\\taddRows(height, width);\\n\\t});\\n\\t\\n\\tfunction addRows(height,width){\\n\\t\\tfor(var i=0; i < height; i++) {\\n\\t\\t\\tcanvas.append('');\\n\\t\\t}addColumns(width);\\n\\t}\\n\\t\\n\\tfunction addColumns(width){\\n\\t\\tfor(var i=0; i ',{class:'cells'});\\n\\t\\t\\n\\t\\t\\tcell.on('click',function(e){\\n\\t\\t\\t\\te.preventDefault()\\n\\t\\t\\t\\tlet color = colorPicker.val();\\n\\t\\t\\t\\t$(this).css('background-color', color);\\n\\t\\t\\t});\\n\\n\\t\\t\\t$('tr').append(cell);\\n\\t\\t}\\n\\t}\\n\\n\\t$('#clear').on('click', function(e){\\n\\t\\te.preventDefault();\\n\\t\\t$('.cells').css('background-color','');\\n\\t})\\n}\",\n \"function makeGrid() {\\n canvas.find('tbody').remove();\\n\\n //submit button size changes to fit grid size\\n var gridRows = heightInput.val();\\n var gridCol = weightInput.val();\\n\\n //tbody set to the table\\n canvas.append('');\\n\\n var canvasBody = canvas.find('tbody');\\n\\n //drawing grid rows\\n for (var i = 0; i < gridRows; i++) {\\n canvasBody.append('');\\n }\\n\\n //draw grid col\\n for (var i = 0; i < gridCol; i++) {\\n canvas.find('tr').append('');\\n }\\n }\",\n \"function makeGrid() {\\n // prevent submit button from reloading page\\n event.preventDefault();\\n const grid = document.querySelector(\\\"table\\\");\\n // clear any previously created table\\n grid.innerHTML = \\\"\\\";\\n // get the users size input\\n const size = getSize();\\n const width = size[0];\\n const height = size[1];\\n for (let y = 0; y < height; y++) {\\n // table row is intitialized inside the for loop so as to create a different in each loop\\n const tableRow = document.createElement(\\\"tr\\\");\\n grid.appendChild(tableRow);\\n for (let x = 0; x < width; x++) {\\n const tableColumn = document.createElement(\\\"td\\\");\\n tableRow.appendChild(tableColumn);\\n }\\n }\\n grid.addEventListener(\\\"click\\\", setCellColor);\\n}\",\n \"function makeGrid(height, width) {//takes the width and height input from the user\\r\\n $('tr').remove(); //remove previous table if any\\r\\n for(var i =1; i<=width;i++){\\r\\n $('#pixelCanvas').append('');//the tableid plus table data\\r\\n for (var j =1; j <=height; j++){\\r\\n $('#table' + i).append('');\\n };\\n \\n let trs = document.querySelectorAll(\\\"tr\\\");\\n console.log(`trs.length is ${trs.length}`);\\n for (let i = 0 ; i < gridWidth ; i++) { \\n console.log(`before building column ${i} of ${gridWidth}`);\\n \\n for (let tr = 0; tr < trs.length; tr++) {\\n console.log(`before building on tr ${tr} of ${trs.length}`);\\n trs[tr].insertAdjacentHTML('beforeend', '');\\n }\\n }\\n \\n // creates the css background color decided before submit grid creation\\n console.log(`background color is ${backgroundColor}`);\\n //create variable for all cells\\n let gridCells = document.querySelectorAll(\\\"td\\\");\\n //paint all cells of the grid iterating through the nodelist gridCells\\n for (let gridCell = 0; gridCell < gridCells.length; gridCell++) {\\n console.log(`painting BG gridCell ${gridCell} of ${gridCells.length}`);\\n gridCells[gridCell].style.backgroundColor = backgroundColor;\\n }\\n \\n }\",\n \"function makeGrid(HEIGHT,WIDTH) {\\n\\n// Your code goes here!\\nfor (let i = 0; i < HEIGHT; i++) {\\n $PCANVA.append('');\\n };\\n\\n for (let i = 0; i < WIDTH; i++) {\\n $('tr').append('');\\n };\\n}\",\n \"function drawGrid() {\\n noFill();\\n stroke(230, 50);\\n strokeWeight(2);\\n\\n for (let j = 0; j < config.numRows; j++) {\\n for (let i = 0; i < config.numCols; i++) {\\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\\n }\\n }\\n }\",\n \"function makeGrid() {\\n //remove previous table if exists\\n $('#gridTable').remove();\\n const height = document.getElementById('input_height').value;\\n const width = document.getElementById('input_width').value;\\n\\n\\n // create table\\n const table = document.createElement('table');\\n table.id = \\\"gridTable\\\";\\n\\n // add rows and columns to the table\\n for (let i = 0; i < height; ++i) {\\n const row = table.insertRow(i);\\n for (let j = 0; j < width; ++j) {\\n const cell = row.insertCell(j);\\n\\n // add event listener to each cell such that\\n // it is fillied with selected color when clicked\\n cell.addEventListener('click', (e) => {\\n changeColor(e);\\n });\\n }\\n }\\n\\n // append the table to the canvas\\n document.getElementById('pixel_canvas').append(table);\\n}\",\n \"function makeGrid(height, width) {\\n\\n\\tfor(var x = 0; x < height; x++){\\n\\t\\tlet row = table.insertRow(x); \\n\\t\\tfor(var y = 0; y < width; y++){\\n\\t\\t\\tlet cell = row.insertCell(y);\\n\\t\\t\\tcell.addEventListener('click', function(event){\\n\\t\\t\\t\\tevent.preventDefault();\\n\\t\\t\\t\\tcell.style.background = penColor.value; \\n\\t\\t\\t})\\n\\t\\t}\\n\\t}\\n\\n\\n}\",\n \"function makeGrid(height,width) {\\n //let row = table.insertRow(0);\\n //let cell = row.insertCell(0);\\n\\n for (let i = 0; i <= height; i++){\\n let row = table.insertRow(i); // for the rows\\n for (let k = 0; k <= width; k++){\\n let cell = row.insertCell(k); // for the columns\\n // added eventListeners to each cell\\n cell.addEventListener('click', (e) => {\\n // to change the color of each cell clicked\\n cell.style.backgroundColor = color.value;\\n console.log(e);\\n });\\n \\n }\\n }\\n\\n // console.log(height,width);\\n // Your code goes here!\\n}\",\n \"function makeGrid() {\\n pixelCanvas.innerHTML = \\\"\\\";\\n for (let i = 0; i < gridHeight;i++) {\\n const tr = document.createElement(\\\"tr\\\");\\n for(let j = 0; j < gridWidth; j++){\\n const td = document.createElement(\\\"td\\\");\\n tr.appendChild(td);\\n }\\n fragment.appendChild(tr);\\n }\",\n \"function table(size){\\r\\n\\tvar div=document.getElementById(\\\"div\\\"); //select the div to draw grid on it\\r\\n\\tvar createTable=document.createElement(\\\"table\\\"); \\r\\n\\tdiv.appendChild(createTable); \\r\\n\\tvar rows=[];\\r\\n\\tvar rowsData=[];\\r\\n\\tfor(var i=0;i\\\");\\r\\n\\t\\t createTable.appendChild(rows[i][0]);\\r\\n\\t\\t for(var j=0;j\\\");\\r\\n tdEle.css(\\\"width\\\",\\\"35px\\\");\\r\\n tdEle.css(\\\"height\\\",\\\"15px\\\");\\r\\n rowsData.push(tdEle);\\r\\n\\t\\t\\t rows[i].append(tdEle); \\r\\n\\t\\t } \\r\\n\\t}\\r\\n createTable.setAttribute(\\\"border\\\",\\\"1\\\");\\r\\n\\tcreateTable.style.width=\\\"80%\\\";\\r\\n\\t$(\\\"td\\\").on(\\\"click\\\",triggerTile); //set click event on the cells of the grid\\r\\n\\treturn rowsData; //return array of cells\\r\\n}\",\n \"function drawHlGrid(){\\n\\tvar obj = gridSize();\\n\\tvar canvas = document.getElementById('hl_grid');\\n\\t\\n\\tvar context = canvas.getContext('2d');\\n\\tcontext.scale(dpr,dpr);\\n\\t\\n\\t//Set the canvas size\\n\\tcanvas.width = (obj.colWidth * obj.cols+0.5)*dpr;\\n\\tcanvas.height = (obj.rowHeight*obj.rows+0.5)*dpr;\\n\\t\\n\\tcanvas.style.width = `${obj.colWidth * obj.cols+0.5}px`;\\n\\tcanvas.style.height = `${obj.rowHeight*obj.rows+0.5}px`;\\n\\tcontext.scale(dpr,dpr);\\n\\n}\",\n \"function makeGrid(height, width) {\\n\\n for (let r = 0; r < height; r++) {\\n let row = shape.insertRow(r);\\n\\n for (let c = 0; c < width; c++) {\\n let cell = row.insertCell(c);\\n\\n cell.addEventListener('click', (event) => {\\n cell.style.backgroundColor = chooseColor.value;\\n });\\n }\\n }\\n}\",\n \"function drawgrid(tabinput, xbeg, y, plotwidth, plotheight, xaxistics, majorint) {\\n\\n var colwidth = plotwidth / tabinput.getRowCount();\\n\\n stroke(gridstroke);\\n strokeWeight(gridweight);\\n let x = xbeg;\\n // columns\\n for (let i = 0; i < xaxistics; i++) {\\n if (!(i % majorint)) { strokeWeight(gridweight * 2) };\\n line(x, y, x, y - plotheight);\\n x += plotwidth / tabinput.getRowCount();\\n strokeWeight(gridweight);\\n };\\n\\n strokeWeight(gridweight * 2);\\n line(x, y, x, y - plotheight);\\n strokeWeight(gridweight);\\n x += plotwidth / table.getRowCount();\\n\\n\\n\\n // rows\\n\\n}\",\n \"function makeGrid() {\\n\\n// defining variables\\n\\nvar rowNumber = $('#input_height').val();\\nvar colNumber = $('#input_width').val();\\nvar table = $('#pixel_canvas');\\n\\ntable.children().remove();\\n\\n// adding rows\\n\\tfor(var i = 0; i < rowNumber; i++) {\\n\\t\\ttable.append(\\\"\\\");\\n\\n\\t\\t//adding columns\\n\\t\\tfor (var j = 0; j < colNumber; j++) {\\n\\t\\t\\ttable.children().last().append(\\\"\\\");\\n\\t\\t}\\n\\t}\\n\\n// Event Listener table cell click\\n\\ttable.children().on('click', 'td', function() {\\n\\t\\tvar color = $(\\\"input[type='color']\\\").val();\\n\\t\\t$(this).attr('bgcolor', color);\\n\\t});\\n\\n// Event Listener table cell doubleclick\\n\\ttable.children().on('dblclick', 'td', function() {\\n\\t\\t$(this).attr('bgcolor', 'transparent');\\n\\t});\\n\\n}\",\n \"function generateGrid(x) {\\n \\tfor (var rows = 0; rows < x; rows++) {\\n \\tfor (var columns = 0; columns < x; columns++) {\\n \\t$('#container').append(\\\"
\\\");\\n };\\n };\\n $('.cell').width(720/x);\\n $('.cell').height(720/x);\\n\\t\\tpaint();\\n}\",\n \"function makeGrid(form) {\\n const height = form.input_height.value;\\n const width = form.input_width.value;\\n $('tr').remove();\\n $('table').append(returnTable(height, width));\\n}\",\n \"function makeGrid() {\\n\\t\\tfor(let col = 0; col < gridHeight; col++){\\n\\t\\t\\tconst cellRow = $(''); //CREATES TABLE ROWS\\n\\t\\t\\tcanvas.append(cellRow);\\n\\t\\t\\tfor (let row = 0; row < gridWidth; row++){\\n\\t\\t\\t\\tconst cell = $('');\\n\\t\\t\\t\\tcellRow.append(cell);\\n\\t\\t\\t};\\n\\t\\t};\\n\\t}\",\n \"function drawGrid() {\\n let dotCount = Number(inputDotCount.value);\\n let dotSize = Number(inputDotSize.value);\\n let desiredGridWidth = Number(inputGridWidth.value);\\n let columnCount = Math.floor(desiredGridWidth / dotSize);\\n\\n // dette er bare for å vise ønsket bredde på grid\\n // (faktisk bredde styres også av prikkstørrelse)\\n widthIndicator.style.width = desiredGridWidth + 'px';\\n\\n // sette hvor mye man skal øke/minke input-feltet for gridbredde når man bruker pil opp/ned\\n inputGridWidth.step = dotSize;\\n\\n grid.style.gridTemplateColumns = `repeat(${columnCount}, ${dotSize}px)`;\\n grid.style.gridAutoRows = dotSize + 'px';\\n\\n let html = '';\\n for (let i = 0; i < dotCount; i++) {\\n html += '
';\\n }\\n\\n grid.innerHTML = html;\\n}\",\n \"function agpMakeGrid(evt) {\\n // turn off the default event processing for the submit event\\n evt.preventDefault();\\n // reset the default canvas color to white as the default\\n document.getElementById(\\\"colorPicker\\\").value = \\\"#ffffff\\\";\\n\\n // remove any existing art work\\n let agpPixelCanvas=document.getElementById('pixelCanvas');\\n while (agpPixelCanvas.hasChildNodes()) {\\n agpPixelCanvas.removeChild(agpPixelCanvas.firstChild);\\n }\\n\\n // retrieve the grid heoght and width\\n let agpGridHeight=document.getElementById('inputHeight').value;\\n let agpGridWidth=document.getElementById('inputWidth').value;\\n\\n // create the row elements and within those, the individual table cells\\n for (var j=0;j\\\").find(\\\"div:last\\\").css({\\r\\n\\t\\t\\t\\t\\\"width\\\": cell_size,\\r\\n\\t\\t\\t\\t\\\"height\\\": cell_size\\r\\n\\t\\t\\t});\\r\\n\\t\\t}\\r\\n\\t\\t//end the line\\r\\n\\t\\t$(\\\"#grid\\\").append(\\\"
\\\");\\r\\n\\t}\\r\\n}\",\n \"function makeGrid() {\\n let body = $(\\\"#pixel_canvas\\\")[0];\\n // $(body).html() = \\\"\\\";\\n rowVal = $(\\\"#input_height\\\").val();\\n colVal = $(\\\"#input_width\\\").val();\\n for (let r = 0; r < rowVal; r++) {\\n let row = body.insertRow(r);\\n for (let c = 0; c < colVal; c++) {\\n let cell = row.insertCell(c);\\n $(cell).on('click', function(evt) {\\n evt.target.style.backgroundColor = $(\\\"#colorPicker\\\").val();\\n this.style.borderColor = \\\"#000\\\";\\n });\\n }\\n }\\n return false;\\n}\",\n \"function generateGrid(x = 4, y= 4){\\n /* This function will generate a grid of x by y size */\\n var html = \\\"\\\";\\n\\n for (let i = 0;i < y; i++) {\\n for(let j = 0;j < x; j ++) {\\n var content = getValue(i,j);\\n if (j == 0){\\n if (content == ''){\\n html += \\\"\\\" + content + \\\"\\\";\\n }\\n else if( content == 2){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 4){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 8){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 16){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 32){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 64){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 128){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 256){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 512){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 1024){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content >= 2048){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n }\\n else if (j < x - 1){\\n if (content == ''){\\n html += \\\"\\\" + content + \\\"\\\";\\n }\\n else if( content == 2){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 4){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 8){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 16){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 32){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 64){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 128){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 256){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 512){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 1024){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content >= 2048){\\n html += \\\"\\\"+ content +\\\"\\\";\\n } \\n }\\n else if (j == x -1){\\n if (content == ''){\\n html += \\\"\\\" + content + \\\"\\\";\\n }\\n else if( content == 2){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 4){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 8){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 16){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 32){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 64){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 128){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 256){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 512){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 1024){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content >= 2048){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n } \\n }\\n }\\n return html;\\n}\",\n \"function makeGrid() {\\n\\tevent.preventDefault();\\n\\tconst height = document.getElementById(\\\"input_height\\\").value;\\n\\tconst width = document.getElementById(\\\"input_width\\\").value;\\n\\tlet table = document.getElementById(\\\"pixel_canvas\\\");\\n\\tconst delELeCell = document.getElementsByClassName(\\\"cell\\\");\\n\\t//console.log(delELeCell.length);\\n\\tlet k = delELeCell.length - 1;\\n\\twhile(k >= 0){\\n\\t\\tconst parent = delELeCell[k].parentNode;\\n\\t\\tparent.removeChild(delELeCell[k]);\\n\\t\\tk--;\\n\\t}\\n\\n\\tconst delRow = document.getElementsByClassName(\\\"row\\\");\\n\\tk = delRow.length - 1;\\n\\twhile(k >= 0){\\n\\t\\tconst parent = delRow[k].parentNode;\\n\\t\\tparent.removeChild(delRow[k]);\\n\\t\\tk--;\\n\\t}\\n\\n\\tfor(let i = 0; i < height; i++){\\n\\t\\tconst row = document.createElement(\\\"tr\\\");\\n\\t\\trow.setAttribute(\\\"id\\\", `row_${i}`);\\n\\t\\trow.setAttribute(\\\"class\\\", \\\"row\\\");\\n\\t\\ttable.appendChild(row);\\n\\t\\t//const findRow = document.getElementById(`row_${}`)\\n\\t\\tfor(let j = 0; j < width; j++){\\n\\t\\t\\tconst column = document.createElement(`td`);\\n\\t\\t\\tcolumn.setAttribute(\\\"id\\\", `cell_${i}_${j}`);\\n\\t\\t\\tcolumn.setAttribute(\\\"class\\\", \\\"cell\\\");\\n\\t\\t\\trow.appendChild(column);\\n\\t\\t}\\n\\t}\\n\\tconst buttonLen = document.getElementsByTagName(\\\"button\\\");\\n\\tif(buttonLen.length === 0){\\n\\t\\tconst button = document.createElement(\\\"button\\\");\\n\\t\\tconst text = document.createTextNode(\\\"Reset\\\");\\n\\t\\tbutton.appendChild(text);\\n\\t\\tdocument.getElementsByTagName(\\\"body\\\")[0].appendChild(button);\\n\\t}\\n}\",\n \"function createGrid(h, v){\\n let width = 960 / h;\\n for (var i = 1; i <= v * h; i++) {\\n var div = document.createElement('div');\\n div.className = 'cell';\\n div.style.border = 'solid 1px black';\\n container.appendChild(div);\\n container.appendChild(br);\\n }\\n cellsEvent();\\n container.style.display = 'grid';\\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\\n container.style.justifyContent = 'center';\\n}\",\n \"function makeGrid(gridHeight, gridWidth) {\\n while (PIXEL_CANVAS.firstChild){\\n \\tPIXEL_CANVAS.removeChild(PIXEL_CANVAS.firstChild);\\n }\\n\\n //Create the grid rows\\n for (let gridRow = 0; gridRow < gridHeight; gridRow++) {\\n const newRow = document.createElement('tr');\\n PIXEL_CANVAS.appendChild(newRow);\\n // insertAdjacentHTML('beforeend', '');\\n for (let i = 0; i < gridWidth; i++) {\\n const newCell = document.createElement('td');\\n newRow.appendChild(newCell);\\n }\\n }\\n}\",\n \"function makeGrid(height, width) {\\n \\n// Your code goes here!\\n// Create rows and columns\\n \\n for (let rows = 0; rows < height; rows++) {\\n let row = table.insertRow(rows);\\n for (var columns = 0; columns < width; columns++) {\\n let cell = row.insertCell(columns);\\n \\n// Allow user to color each, individual cell\\n \\n cell.addEventListener('click', (e) => { \\n let color = document.getElementById('colorPicker');\\n cell.style.backgroundColor = color.value;\\n });\\n }\\n }\\n}\",\n \"function makeGrid() {\\n gridCanvas.innerHTML = \\\"\\\";\\n var rowCount = gridHeight.value;\\n var cellCount = gridWidth.value;\\n for (let r = 0; r < rowCount; r++) {\\n var tr = document.createElement(\\\"tr\\\");\\n gridCanvas.appendChild(tr);\\n var newRow = gridCanvas.insertRow(r);\\n \\n for (let c = 0; c < cellCount; c++) {\\n var td = document.createElement(\\\"td\\\");\\n tr.appendChild(td);\\n td.addEventListener('click', fillGrid); //Event listeners are properly added to the grid squares (and not to the border or the table itself).\\n var cell = newRow.insertCell(c);\\n cell.addEventListener('click', fillGrid);\\n }\\n }\\n}\",\n \"function makeGrid(x,y) {\\n $('#pixel_canvas').empty();\\n for(let i=0; i');\\n $('#pixel_canvas').append(row);\\n for(let j=0; j');\\n }\\n }\\n}\",\n \"function makeGrid(){\\n\\n table.innerHTML =''; //czyszczenie tabeli\\n\\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\\n\\n for(let h = 0; h < gridHeight.value; h++){\\n let tr = document.createElement('tr');\\n fragment.appendChild(tr);\\n for(let w = 0; w < gridWitdh.value; w++){\\n let td = document.createElement('td');\\n tr.appendChild(td);\\n }\\n }\\n table.appendChild(fragment);\\n colorSet();\\n colorClick();\\n colorRemove();\\n}\",\n \"function makeCells() {\\n let rowsI = document.getElementById('rows-input');\\n let columnsI = document.getElementById('columns-input');\\n let cellAmount = rowsI.value * columnsI.value;\\n console.log(rowsI.value);\\n console.log(columnsI.value);\\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\\n for (i = 0; i < cellAmount; i++){\\n let cell = document.createElement('div');\\n cell.className = 'cell';\\n cell.id = `cell-${i}`;\\n board.appendChild(cell);\\n }\\n}\",\n \"function makeGrid(height, width) {\\n\\n//console.log(height.value, width.value);\\n \\n//const row = table.insertRow(0);\\n//const cell = row.insertCell(0);\\n\\n// Your code goes here!\\nfor(let i = 0; i <= height; i++){\\n let row = table.insertRow(i);\\n for(let j = 0; j <= width; j++){\\n let cell = row.insertCell(j);\\n cell.addEventListener('click',(e) => {\\n console.log(e);\\n cell.style.background = color.value;\\n });\\n }\\n}\\n\\n}\",\n \"function makeGrid(h,w) {\\n for(let i = 1; i <= h; i++) {\\n grid.append(\\\"\\\");\\n let j = 1;\\n while (j <= w){\\n $(\\\"tr\\\")\\n .last()\\n .append(\\\"\\\");\\n j++;\\n }\\n } \\n}\",\n \"function makeGrid(h,l) {\\n // Remove previous grid if any\\n $(grid).children().remove();\\n // Loops to draw new Grid\\n for (i=0 ; i\\\"); // Add a cell at the end of the current row\\n }\\n }\\n}\",\n \"function createGrid(width, height) {\\n for (let i = 0; i < height; i++) {\\n let row = document.createElement('div');\\n row.classList.add('row');\\n\\n for (let x = 0; x < width; x++) {\\n let pixel = document.createElement('div');\\n pixel.classList.add('pixel');\\n row.appendChild(pixel);\\n }\\n grid.appendChild(row);\\n }\\n}\",\n \"function plot(rows = 36, cols = 64) {\\n\\n /* 'c' will contain the whole generated html rect tags string to change innerhtml of enclosing div */\\n /* 'y' will denote the 'y' coordinate where the next grid must be placed */\\n let c = \\\"\\\", y = 0;\\n\\n /* Looping for each row */\\n for (let i = 0; i < rows; i++) {\\n\\n /* 'x' is a coordinate denoting where the next grid must be placed */\\n var x = 0;\\n\\n /* For each row we will loop for each column present in the Grid */\\n for (let j = 0; j < cols; j++) {\\n\\n /* 'colr' will store the rest grid color which is dark gray currently */\\n let colr = grid_color;\\n\\n /* If the Rectange present in the grid is on the border side then change the color in order to highlight borders */\\n if(i === 0 || j === 0 || i === rows - 1 || j === cols - 1){\\n colr = border_color;\\n }\\n\\n /* Creating a rect tag that is appending in 'c' for now and will be updated to innerhtml of enclosing div */\\n /* I know you will be wondering about the id given to each rect :-\\n * Each rect must be provided with id in order to do anything with the corresponding rect.\\n * Operations like coloring the grid as well saving saving any number in corresponding matrix needs an id of the rect.\\n * Hence id is important to allot to each rect to make further changes in matrix on which whole algo is based.\\n * In order to assing every rect id i decided to allot their corresponding row_number + : + col_number to be as id\\n * As with this scenario it is easy to remember and will be unique for every rect tag. \\n */\\n c += ``;\\n\\n /* Incrementing the 'x' coordinate as we have width of 30px and hence 'x' coordinate for next rect will be +30 from current pos. */\\n x += 30;\\n }\\n\\n /* Incrementing the 'y' coordinate as we have placed sufficient rect in 1 row now need to advance 'y' as height of each rect \\n is 30px hence for every rect in next column the y coordinate will be +30*/\\n y += 30;\\n }\\n\\n /* At last after creating rect tags using loops, now update innerHtml of enclosing div with id='container'[grid.html] */\\n document.getElementById(\\\"container\\\").innerHTML = c;\\n\\n /* I wanted to preplace the Source - coordinate so at rect with id='src_crd' will be coloured green */\\n document.getElementById(src_crd).style.fill = \\\"rgb(0, 255, 0)\\\";\\n matrix[split(src_crd, 0)][split(src_crd, 1)] = 1; /* Update the pos as '1' to denote source location */\\n\\n /* I wanted to preplace the Destination - coordinate so at rect with id='dst_crd' will be coloured Red */\\n document.getElementById(dst_crd).style.fill = \\\"rgb(255, 0, 0)\\\";\\n matrix[split(dst_crd, 0)][split(dst_crd, 1)] = 2; /* Update the pos as '2' to denote Destination location */\\n\\n }\",\n \"function makeGrid() {\\n const GRID = $(\\\"#pixel_canvas\\\");\\n\\n // Select size input\\n const COLUMNS = $(\\\"#input_width\\\").val();\\n const ROWS = $(\\\"#input_height\\\").val();\\n\\n // Clears the table\\n GRID.children().remove();\\n\\n // Limit the grid size to avoid browser crash\\n if (COLUMNS <= 50 && ROWS <= 50) {\\n // Adds new rows\\n for (let i = 0; i < ROWS; i++) {\\n GRID.append(\\\"\\\");\\n\\n // Adds new columns\\n for (let j = 0; j < COLUMNS; j++)\\n GRID.children()\\n .last()\\n .append(\\\"\\\");\\n }\\n }\\n\\n // Selects the grid tile\\n tile = GRID.find(\\\"td\\\");\\n\\n // Allows the interaction with the grid\\n tile.click(function() {\\n // Selects color input\\n let colorPicker;\\n color = $(\\\"#colorPicker\\\").val();\\n $(this).attr(\\\"bgcolor\\\", color);\\n });\\n // Erases single cell color\\n tile.on(\\\"dblclick\\\", function() {\\n let colorPicker;\\n color = $(\\\"#colorPicker\\\").val();\\n $(this).removeAttr(\\\"bgcolor\\\");\\n });\\n\\n // Executes the action on the table and allows the color selection\\n GRID.on(\\\"click\\\", \\\"td\\\", function() {\\n const COLOR = $(\\\"input[type = 'color']#colorPicker\\\").val();\\n $(this).attr(\\\"background-color\\\", COLOR);\\n });\\n}\",\n \"function makeGrid(squaresPerSide) {\\n\\n //Add div rows(basically tr), to act as rows\\n for (var i = 0; i < squaresPerSide; i++) {\\n $('#pad').append('
');\\n }\\n\\n //Add div squares(basically td), to ever row\\n for (var i = 0; i < squaresPerSide; i++) {\\n $('.row').append('
');\\n }\\n\\n //Set square size= giant grid div divided by sqperside\\n var squareDimension = $('#pad').width() / squaresPerSide;\\n $('.square').css({\\n 'height': squareDimension,\\n 'width': squareDimension\\n });\\n}\",\n \"drawGrid() {\\n\\n for (let i = 0; i <= HEIGHT; i += SQUARE_SIDE) {\\n line(0, i, WIDTH, i);\\n }\\n for (let i = 0; i <= WIDTH; i += SQUARE_SIDE) {\\n line(i, 0, i, HEIGHT);\\n }\\n\\n }\",\n \"function grid() {\\n\\tvar spaceX = 64;\\n\\tvar spaceY = spaceX;\\n\\n\\tstroke(200);\\n\\tfor (var i = 64; i < width; i += 64) {\\n\\t\\tline(i, 0, i, height);\\n\\t}\\n\\tfor (var i = 64; i < height; i += 64) {\\n\\t\\tline(0, i, width, i);\\n\\t}\\n}\",\n \"function makeGrid() {\\n\\n const pixelGrid = document.querySelector('#pixelCanvas');\\n\\n pixelGrid.innerHTML = ''; //Clears previous grid\\n\\n inputHeight = document.querySelector('#inputHeight').value;\\n inputWidth = document.querySelector('#inputWidth').value;\\n\\n if (inputHeight > 100) { //Limit grid height\\n inputHeight = 100;\\n };\\n\\n if (inputWidth > 100) { //Limit grid width\\n inputWidth = 100;\\n }\\n\\n //Get user selected color and set pixel color\\n function colorClick() {\\n color = document.querySelector('#colorPicker').value;\\n event.target.style.backgroundColor = color;\\n }\\n\\n // Build grid based on user form input\\n for (var height = 0; height < inputHeight; ++height) { //Loop creates rows\\n const newRow = document.createElement('tr');\\n pixelGrid.appendChild(newRow);\\n for (var width = 0; width < inputWidth; ++width) { //Loop create pixels\\n const newPixel = document.createElement('td');\\n newRow.appendChild(newPixel);\\n newPixel.addEventListener('click', colorClick);//Add click event to pixels\\n }\\n }\\n}\",\n \"function makeGrid() {\\n //variables to get canvas element,height,width\\n var table = $(\\\"#pixelCanvas\\\");\\n var gridHeight = $(\\\"#inputHeight\\\");\\n var gridWidth = $(\\\"#inputWeight\\\");\\n table.children().remove();\\n for (x = 0; x < gridHeight.val(); x++) {\\n table.append('');\\n }\\n rows = $('tr');\\n for (y = 0; y < gridWidth.val(); y++) {\\n rows.append('');\\n } \\n table.on( 'click','td', function() { \\n var color = $(\\\"#colorPicker\\\"); \\n $(this).attr('bgcolor', color.val()); \\n });\\n}\",\n \"function makeGrid(x, y) {\\n for (var rows = 0; rows < x; rows++) {\\n for (var columns = 0; columns < y; columns++) {\\n $(\\\"#container\\\").append(\\\"
\\\");\\n };\\n };\\n $(\\\".grid\\\").height(960/x);\\n $(\\\".grid\\\").width(960/y);\\n}\",\n \"function makeGrid() {\\n $(\\\"tr\\\").remove();\\n for (var h = 0; h < canvasHeight; h++) {\\n var row = \\\"\\\";\\n for (var w = 0; w < canvasWidth; w++) {\\n tdNo++;\\n row += '';\\n }\\n row += \\\"\\\";\\n\\n canvasCtl.append(row);\\n }\\n}\",\n \"function generage_grid() {\\n\\n for (var i = 0; i < rows; i++) {\\n $('.grid-container').append('
');\\n }\\n\\n\\n $('.grid-row').each(function () {\\n for (i = 0; i < columns; i++) {\\n $(this).append('
')\\n }\\n });\\n\\n var game_container_height = (34.5 * rows)\\n $('.game-container').height(game_container_height);\\n var game_container_width = (34.5 * columns)\\n $('.game-container').width(game_container_width);\\n }\",\n \"function makeGrid() {\\r\\n\\r\\n // Your code goes here!\\r\\n\\r\\n // Getting the grid height value from user\\r\\n const gridHeight = document.getElementById('inputHeight').value;\\r\\n // Getting the grid width value from user\\r\\n const gridWidth = document.getElementById('inputWidth').value;\\r\\n // Canvas table vairable\\r\\n const tableCanvas = document.getElementById('pixelCanvas');\\r\\n\\r\\n // Reset values to start\\r\\n tableCanvas.innerHTML = '';\\r\\n\\r\\n // Loop for inserting the rows\\r\\n for (let i = 0; i < gridHeight; i++) {\\r\\n let r = tableCanvas.insertRow(i);\\r\\n // Nested loop for inserting the cells\\r\\n for (let j = 0; j < gridWidth; j++) {\\r\\n let c = r.insertCell(j);\\r\\n // Action for the cells\\r\\n c.addEventListener('click', function(action) {\\r\\n // If the cell was pressed, the background color will change to the selected color\\r\\n action.target.style.backgroundColor = document.getElementById('colorPicker').value;\\r\\n });\\r\\n }\\r\\n }\\r\\n \\r\\n}\",\n \"function makeGrid(input1, input2) {\\n // make the table\\n var table = document.getElementById('pixelCanvas');\\n //to remove the table if the user decied to make another table\\n table.innerHTML = \\\"\\\";\\n // the loop here for row in table t\\n for (var i = 0; i < input1; i++) {\\n var row = document.createElement('tr');\\n\\n // the inner loopp for the cell and when user click in one of cell changed the color\\n for (var j = 0; j < input2; j++) {\\n var cell = document.createElement('td');\\n row.appendChild(cell);\\n cell.addEventListener('click', function(e) {\\n var color = document.getElementById('colorPicker').value;\\n e.target.style.backgroundColor = color;\\n })\\n }\\n table.appendChild(row);\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.8265037","0.81319696","0.8104697","0.802983","0.79749984","0.7900075","0.78400546","0.7790189","0.77530295","0.7727299","0.7696823","0.7652794","0.76238596","0.76086986","0.760159","0.7578795","0.7557386","0.75469404","0.7451794","0.74278045","0.7396933","0.7370144","0.73356515","0.7330653","0.73177314","0.7314027","0.7300973","0.7300615","0.7300615","0.7262645","0.7256636","0.72484237","0.72481656","0.7235104","0.7232532","0.7228658","0.721424","0.72039175","0.7194214","0.71849674","0.71812475","0.7158256","0.71231467","0.71075916","0.71036226","0.70987386","0.7096474","0.70944357","0.70825773","0.70807827","0.70606804","0.70468867","0.70387495","0.7026473","0.70244515","0.7020401","0.7016435","0.70103663","0.7004835","0.6996304","0.6973097","0.69321066","0.69289035","0.6909058","0.69079685","0.6906452","0.6894914","0.6881412","0.68628603","0.6858857","0.68193513","0.6814483","0.6809891","0.6808196","0.6796759","0.67897093","0.6770928","0.67627734","0.6751094","0.6748172","0.673616","0.67141503","0.67133397","0.6711852","0.669505","0.6684061","0.6677014","0.667345","0.6673008","0.6668397","0.6653581","0.6651125","0.66391927","0.66356575","0.6624877","0.6609144","0.6608871","0.6604191","0.6601479","0.6594729","0.65920794"],"string":"[\n \"0.8265037\",\n \"0.81319696\",\n \"0.8104697\",\n \"0.802983\",\n \"0.79749984\",\n \"0.7900075\",\n \"0.78400546\",\n \"0.7790189\",\n \"0.77530295\",\n \"0.7727299\",\n \"0.7696823\",\n \"0.7652794\",\n \"0.76238596\",\n \"0.76086986\",\n \"0.760159\",\n \"0.7578795\",\n \"0.7557386\",\n \"0.75469404\",\n \"0.7451794\",\n \"0.74278045\",\n \"0.7396933\",\n \"0.7370144\",\n \"0.73356515\",\n \"0.7330653\",\n \"0.73177314\",\n \"0.7314027\",\n \"0.7300973\",\n \"0.7300615\",\n \"0.7300615\",\n \"0.7262645\",\n \"0.7256636\",\n \"0.72484237\",\n \"0.72481656\",\n \"0.7235104\",\n \"0.7232532\",\n \"0.7228658\",\n \"0.721424\",\n \"0.72039175\",\n \"0.7194214\",\n \"0.71849674\",\n \"0.71812475\",\n \"0.7158256\",\n \"0.71231467\",\n \"0.71075916\",\n \"0.71036226\",\n \"0.70987386\",\n \"0.7096474\",\n \"0.70944357\",\n \"0.70825773\",\n \"0.70807827\",\n \"0.70606804\",\n \"0.70468867\",\n \"0.70387495\",\n \"0.7026473\",\n \"0.70244515\",\n \"0.7020401\",\n \"0.7016435\",\n \"0.70103663\",\n \"0.7004835\",\n \"0.6996304\",\n \"0.6973097\",\n \"0.69321066\",\n \"0.69289035\",\n \"0.6909058\",\n \"0.69079685\",\n \"0.6906452\",\n \"0.6894914\",\n \"0.6881412\",\n \"0.68628603\",\n \"0.6858857\",\n \"0.68193513\",\n \"0.6814483\",\n \"0.6809891\",\n \"0.6808196\",\n \"0.6796759\",\n \"0.67897093\",\n \"0.6770928\",\n \"0.67627734\",\n \"0.6751094\",\n \"0.6748172\",\n \"0.673616\",\n \"0.67141503\",\n \"0.67133397\",\n \"0.6711852\",\n \"0.669505\",\n \"0.6684061\",\n \"0.6677014\",\n \"0.667345\",\n \"0.6673008\",\n \"0.6668397\",\n \"0.6653581\",\n \"0.6651125\",\n \"0.66391927\",\n \"0.66356575\",\n \"0.6624877\",\n \"0.6609144\",\n \"0.6608871\",\n \"0.6604191\",\n \"0.6601479\",\n \"0.6594729\",\n \"0.65920794\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":31,"cells":{"query":{"kind":"string","value":"Get the grid state from HTML"},"document":{"kind":"string","value":"function getHTMLGrid(gameofLife) {\n var gridHTML = document.getElementById(\"grid\");\n var array = [];\n for (var i = 0, row = void 0; row = gridHTML.rows[i]; i++) {\n array[row.rowIndex] = [];\n for (var j = 0, col = void 0; col = row.cells[j]; j++) {\n if (col.className == \"selected\")\n array[row.rowIndex][col.cellIndex] = 1;\n else\n array[row.rowIndex][col.cellIndex] = 0;\n }\n }\n return array;\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 parseGrid(grid) {\n var str = '';\n for (var row = 0; row < grid.length; row++) {\n for (var col = 0; col < grid[row].length; col++) {\n str = str + (grid[row][col].state ? grid[row][col].state.toLowerCase() : '-')\n }\n }\n return str;\n}","getGrid(gridNr) {\n var gridVal = this.state.gridValues[gridNr];\n if (gridVal == null) {\n gridVal = '.';\n }\n return this.gridClick(gridNr)} />\n }","function getGrid(pos) {\n\tlet childs = c.childNodes;\n\treturn childs[pos];\n}","getGridHtml(editor) {\n const curPos = editor.getCursor();\n\n if (this.isInGridBlock(editor)) {\n const bog = this.getBog(editor);\n const eog = this.getEog(editor);\n // skip block begin sesion(\"::: editable-row\")\n bog.line++;\n // skip block end sesion(\":::\")\n eog.line--;\n eog.ch = editor.getDoc().getLine(eog.line).length;\n return editor.getDoc().getRange(bog, eog);\n }\n return editor.getDoc().getLine(curPos.line);\n }","function getGridPosition() {\n\tvar selectedUnit = document.getElementsByClassName(\"selected\");\n\tif (angular.isDefined(selectedUnit[0])) {\n\t\tvar rowIndex = selectedUnit[0]['className'].split(\" \")[2].substring(8);\n\t\tvar gridPos = rowIndex.split('-');\n\t\treturn gridPos;\n\t} else {\n\t\treturn false;\n\t}\n}","function state_to_dom(s) {\n try {\n let html=\"\";\n for(let j=0;j<3;++j) {\n for(let i=0;i<3;++i) {\n html+=\" \";\n if(s.grid[j][i]==0) html+=\" \";\n else html+=s.grid[j][i];\n }\n html+=\"\\n\";\n }\n let obj=document.createElement(\"pre\");\n obj.innerHTML=html;\n return obj;\n } catch(e) {\n helper_log_exception(e);\n throw e;\n return null;\n }\n}","function getBoardState() {\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\tfor (var j = 0; j < 3; j++) {\n\t\t\t\tboard[i][j] = $('[data-loc=\"{i : ' + i + ', j : ' + j + '}\"]').text();\n\t\t\t}\n\t\t}\n\t}","function gridState(){\n var grid = {};\n $theInputs = $('.game-cell-input');\n $theInputs.each(function(){ // iterate over each input\n if($(this).val()){\n var num = $(this).data('num');\n var special = $(this).data('special');\n if(typeof special == \"undefined\" || special > 5 || special == 0){\n special = 0;\n }\n grid[num] = {val: $(this).val(), special: special};\n }\n });\n return grid;\n }","function TreeGrid_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//get the position\n\tvar position = TreeGrid_GetTargetItemPosition(this, aData, __DESIGNER_CONTROLLER || __SCREENSHOTS_ON || eEvent != __NEMESIS_EVENT_CLICK && eEvent != __NEMESIS_EVENT_SELECT && eEvent != __NEMESIS_EVENT_NOTHANDLED);\n\t//header?\n\tif (position.Row == -1 && position.Column != null)\n\t{\n\t\t//get the headers\n\t\tvar headers = this.InterpreterObject.Content ? this.InterpreterObject.Content.Headers.Ordered : null;\n\t\t//get the header\n\t\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column].HTML : null;\n\t}\n\t//is the row visible?\n\telse if (position.Row != null && position.Row >= 0 && (this.InterpreterObject.Content.TreeData == null || this.InterpreterObject.Content.TreeData.VisibleMap[position.Row]))\n\t{\n\t\t//get the tree data\n\t\tvar treeData = this.InterpreterObject.Content.TreeData;\n\t\t//get the row\n\t\tvar row = this.InterpreterObject.Content.Cells.Rows[position.Row];\n\t\t//assume we will be clicking on the scrollable part of the grid\n\t\tresult = row.HTML ? row.HTML.Fixed.firstChild ? row.HTML.Fixed : row.HTML.Scrollable : null;\n\t\t//also has a column? ie: want a cell?\n\t\tif (position.Column != null)\n\t\t{\n\t\t\t//get the row cell\n\t\t\tresult = row.Objects[position.Column].HTML;\n\t\t}\n\t\t//check the event\n\t\telse switch (eEvent)\n\t\t{\n\t\t\tcase __NEMESIS_EVENT_OPENBRANCH:\n\t\t\tcase __NEMESIS_EVENT_CLOSEBRANCH:\n\t\t\t\t//this row is a treegrid line?\n\t\t\t\tif (treeData && row)\n\t\t\t\t{\n\t\t\t\t\t//set the target\n\t\t\t\t\tresult = row.Objects[treeData.Column].HTML.BranchButton;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//cell selection only (but of course requesting a row selection, of course)\n\t\t\t\tif (Get_String(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE], \"\") == \"CellOnly\")\n\t\t\t\t{\n\t\t\t\t\t//loop through the cells\n\t\t\t\t\tfor (var i = 0, c = row.Objects.length; i < c; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this one has cell selects row?\n\t\t\t\t\t\tif (row.Objects[i].SelectionActionsOnly)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//use this one isntead\n\t\t\t\t\t\t\tresult = row.Objects[i].HTML;\n\t\t\t\t\t\t\t//end loop\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\t//use the entire treegrid\n\t\tresult = this;\n\t}\n\t//return the result\n\treturn result;\n}","function getGrid() {\n\tconsole.log(\"Current rows are: \" + GRID.rows + \"\\nCurrent columns are: \" + GRID.columns);\n}","function setState() {\n var tags = document.getElementsByTagName(\"td\")\n let state = [];\n for (var i = 0; i < tags.length; i++) {\n state.push(tags[i].innerHTML)\n };\n return state;\n}","function getGridClass(pos) {\n\tlet childs = c.childNodes;\n\tlet classes = childs[pos].className.split(' ');\n\treturn classes;\n}","function TreeGrid_GetData()\n{\n\t//create an array for the result\n\tvar result = [];\n\t//have we got content? with cells?\n\tif (this.InterpreterObject.Content && this.InterpreterObject.Content.Cells)\n\t{\n\t\t//loop through the html\n\t\tfor (var rows = this.InterpreterObject.Content.Cells.Rows, i = 0, c = rows.length; i < c; i++)\n\t\t{\n\t\t\t//selected?\n\t\t\tif (rows[i].Selected)\n\t\t\t{\n\t\t\t\t//add this to the result\n\t\t\t\tresult.push(\"\" + (i + 1));\n\t\t\t}\n\t\t}\n\t}\n\t//return it\n\treturn result;\n}","function UltraGrid_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\n\t//get the target\n\tvar target = UltraGrid_GetTarget(this.InterpreterObject, aData[0]);\n\t//valid target?\n\tif (target)\n\t{\n\t\t//this a cell?\n\t\tif (target.UltraGridCell || target.UltraGridHeader)\n\t\t{\n\t\t\t//use the html\n\t\t\tresult = target.HTML;\n\t\t}\n\t\t//must be a row\n\t\telse if (target.Panels)\n\t\t{\n\t\t\t//get its first panel row\n\t\t\tresult = target.PanelRows[target.PanelIds[0]];\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}","function read_state() {\n let grid=Array(3).fill(0).map(x => Array(3));\n for(let k=0;k<9;++k) {\n let input=document.getElementById(\"input_pos\"+k);\n let j=Math.floor(k/3);\n let i=k%3;\n if(input.value==\"\") grid[j][i]=0;\n else grid[j][i]=parseInt(input.value,10);\n }\n return {\n grid : grid\n };\n}","function getSpanGrid() {\n\tvar grid = new Array(4);\n\tgrid[0] = new Array(4);\n\tgrid[1] = new Array(4);\n\tgrid[2] = new Array(4);\n\tgrid[3] = new Array(4);\n\tvar n = 0;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tgrid[r][c] = $(\"#grid .cell\").eq(n).find(\"span\");\n\t\t\tn++;\n\t\t}\n\t}\n\treturn grid;\n}","function getViewState(formElement) {\n return AjaxImpl_1.Implementation.getViewState(formElement);\n }","function handleDemoGrid() {\r\n\tswitch(demoGridState) {\r\n\t\tcase 0: //\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t}\r\n}","get gridMode() {\n return this.i.ni;\n }","getGrid() {\n return this.gridCells;\n }","getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }","function getElementBasedFormatState(editor, event) {\n var listTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'OL,UL'));\n var headerTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'H1,H2,H3,H4,H5,H6'));\n return {\n isBullet: listTag == 'UL',\n isNumbering: listTag == 'OL',\n headerLevel: (headerTag && parseInt(headerTag[1])) || 0,\n canUnlink: !!editor.queryElements('a[href]', 1 /* OnSelection */)[0],\n canAddImageAltText: !!editor.queryElements('img', 1 /* OnSelection */)[0],\n isBlockQuote: !!editor.queryElements('blockquote', 1 /* OnSelection */)[0],\n };\n}","function getGridElementsPosition(index) {\n const gridEl = document.getElementById(\"grid\");\n let offset = Number(window.getComputedStyle(gridEl.children[0]).gridColumnStart) - 1;\n if (isNaN(offset)) {\n offset = 0;\n }\n const colCount = window.getComputedStyle(gridEl).gridTemplateColumns.split(\" \").length;\n const rowPosition = Math.floor((index + offset) / colCount);\n const colPosition = (index + offset) % colCount;\n return {\n row: rowPosition,\n column: colPosition\n };\n}","getCurrentGridState(args) {\n const gridState = {\n columns: this.getCurrentColumns(),\n filters: this.getCurrentFilters(),\n sorters: this.getCurrentSorters(),\n };\n const currentPagination = this.getCurrentPagination();\n if (currentPagination) {\n gridState.pagination = currentPagination;\n }\n if (this.hasRowSelectionEnabled()) {\n const currentRowSelection = this.getCurrentRowSelections(args && args.requestRefreshRowFilteredRow);\n if (currentRowSelection) {\n gridState.rowSelection = currentRowSelection;\n }\n }\n return gridState;\n }","function getState(el) {\n // insert your own code here to extract a relevant state object from an or
tag\n // for example, if you rely on any other custom \"data-\" attributes to determine the link behaviour\n return {};\n }","function TreeGrid_GetInterpreterTarget(theHTML, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//get the position\n\tvar position = TreeGrid_GetTargetItemPosition(theHTML, aData);\n\t//header?\n\tif (position.Row == -1 && position.Column != null)\n\t{\n\t\t//get headers\n\t\tvar headers = theHTML.InterpreterObject.Content ? theHTML.InterpreterObject.Content.Header.Cells : null;\n\t\t//get the header\n\t\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column] : null;\n\t}\n\t//we have this row?\n\telse if (position.Row != null && position.Row >= 0 && theHTML.InterpreterObject.Content && position.Row < theHTML.InterpreterObject.Content.Cells.Rows.length)\n\t{\n\t\t//get the row\n\t\tvar row = theHTML.InterpreterObject.Content.Cells.Rows[position.Row];\n\t\t//have we got a cell?\n\t\tif (row != null && position.Column >= 0 && row.Objects && position.Column < row.Objects.length)\n\t\t{\n\t\t\t//get the cell\n\t\t\tresult = row.Objects[position.Column];\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}","function loadBoardState(thisState){\n document.querySelectorAll(\".dim\").forEach(function(item){\n if(getLitStateBit(thisState, parseInt(item.getAttribute(\"data-index\")))){\n item.classList.add(\"lit\");\n }else{\n item.classList.remove(\"lit\");\n }\n });\n }","function readState () {\n cache()\n var str = location.pathname.substr(1)\n var result = getRouteNode(str)\n\n if (!result) {\n const ev = new CustomEvent(\"routenotfound\", {\n detail: {\n path: str\n }\n })\n\n window.dispatchEvent(ev)\n return\n }\n var node = cloneNodeAsElement(result.node, 'div')\n\n node.innerHTML = result.node.textContent\n loadNodeSource(node, result.matches)\n return node\n}","function loadState(){\n var state = $.deparam.fragment();\n grid = state.grid;\n \n if(typeof state.variant !== \"undefined\"){\n options.variant = state.variant;\n }\n \n if(typeof state.level !== \"undefined\"){\n options.level = state.level;\n } else {\n options.level = 1;\n }\n \n $theInputs = $('.game-cell-input');\n $theInputs.each(function(){ // iterate over each input, putting saved value in.\n var num = $(this).data('num');\n if(typeof grid !== \"undefined\" && typeof grid[num] !== \"undefined\" && grid[num] !== \"\"){\n $(this).val( grid[num].val );\n $(this).data('special', grid[num].special );\n } else {\n $(this).val('');\n $(this).data('special', 0 );\n }\n decorateInput($(this));\n });\n \n $('#level').val(options.level);\n }","function getGridStateAndNumFilled() {\n let state = '';\n let numFilled = 0\n for (let i = 0; i < gridHeight; i++) {\n for (let j = 0; j < gridWidth; j++) {\n if (grid[i][j].notBlocked()) {\n if (langMaxCharCodes == 1) {\n state = state + grid[i][j].currentLetter\n } else {\n state = state + grid[i][j].currentLetter + '$'\n }\n if (grid[i][j].currentLetter != '0') {\n numFilled++\n }\n } else {\n state = state + '.'\n }\n }\n }\n numCellsFilled = numFilled\n return state;\n}","getCellState(i, j) {\n let that = this;\n return function () {\n return that.state.grid[i][j];\n }\n }","cellState(row, col) {\n const cells = this.cells;\n return cells[ this.to_1d(row, col) * this.cellBytes ];\n }","function getGrid () {\n\tlet grid = new Array(3);\n\tfor (var i = 0; i < 3; i++)\n\t\tgrid[i]=new Array(3);\n\n\tfor (var i = 0; i < 3; i++) {\n\t\tfor (var j = 0; j < 3; j++) {\n\t\t\tlet divSector = $(\"#grid-\" + i + j + \"-id\");\n\t\t\tgrid[i][j] = divSector.text();\n\t\t}\n\t}\n\n\treturn grid;\n}","function redrawHTMLGrid(grid, gridID) {\n var gridHTML = document.getElementById(gridID);\n for (var i = 0; i < height; i++) {\n for (var j = 0; j < width; j++) {\n var cell = gridHTML.rows[i].cells[j];\n if (grid[i][j])\n cell.className = \"selected\";\n else\n cell.className = \"\";\n }\n }\n}","function setHTMLCell(x, y, liveState){\n Array.from(dom.boardNode.children)[size*x + y].classList.toggle(\"live\", liveState);\n}","function drawHTMLGrid(height, width, gridID) {\n var gridHTML = document.getElementById(gridID);\n // Clear previous table and stop game of life algorithm\n gridHTML.innerHTML = \"\";\n clearInterval(globalInterval);\n // Create html table\n for (var i = 0; i < height; i++) {\n var row = gridHTML.insertRow(0);\n for (var j = 0; j < width; j++) {\n var cell = row.insertCell(0);\n cell.innerHTML = \"\";\n }\n }\n // Onclick a table element, change its class \n $(\".grid td\").click(function () {\n if (this.className == \"\")\n this.className = \"selected\";\n else\n this.className = \"\";\n });\n}","function getTableDataFromHtml() {\n\n }","getHTML() {\n return this._executeAfterInitialWait(() => this.currently.getHTML());\n }","function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }","getState() {\n // TODO return obj with the board's properties\n }","getState(ant) {\n const tile = this.grid[ant.getPosition().y][ant.getPosition().x];\n if (!tile) { return 0; }\n if (this.scope.config.ant_coloring == \"rgb_blend\") {\n return tile[ant.id];\n }\n return tile.state;\n }","function getgridobj() {\n\n return gridobj;\n\n }","function getGridElement(row, col){\n\tvar cellNum = parseInt(row-1)*size + parseInt(col);\n\tvar cell = dom.gameBoard.querySelector(\"#cell\"+cellNum);\n\treturn cell;\n}","function identifyCell(gridPossibilities) {\n var cellReference = 0;\n return cellReference;\n}","getGameGrid() {\n return this.buildBlockGrid();\n }","function aanmaken_grid_layout() {\n var nummer = 0;\n var kolom__struct = '';\n var grid__struct = '';\n\n for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) {\n kolom__struct = '';\n for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) {\n nummer = nummer + 1\n kolom__struct += `
`;\n }\n grid__struct += `
${kolom__struct}
`;\n }\n return grid__struct; // geeft de grid structuur als resultaat terug\n }","getGridView() {\n const { data } = this.state;\n if (data.length == 0) return null;\n\n return {\n return
\n \n
\n }},\n { alias: 'Detalles', value : data => {\n return visibility;\n }},\n ]}\n />;\n }","async readOverviewTiles() {\n const tiles = await this.page.evaluate(() =>\n Array.from(document.querySelectorAll('div[id$=ITtile]')).map(t => {\n const [title, badge] = t.querySelectorAll('span');\n return {\n isSelected: t.classList.contains('p_AFSelected'),\n title: title.textContent,\n badge: badge.textContent,\n selectId: t.querySelector('a[title^=\"Select:\"]').id,\n };\n }));\n\n tiles.forEach(t => t.click =\n this.page.click.bind(this.page, '#'+t.selectId.replace(/:/g,'\\\\:')));\n return tiles;\n }","function getElementByString(html) {\n let element = document.createElement('div')\n element.classList = 'col form-group row';\n element.innerHTML = html;\n return element.firstElementChild\n\n}","getGridRowIndex(){return this.__gridRowIndex}","function gridButton() {\n let elem = document.querySelectorAll(\".square\");\n elem.forEach(toggleGrid);\n if (grid == false) {\n let gridBtn =\n document.getElementById(\"grid-button\");\n gridBtn.innerText = \"Grid On\";\n }\n else if (grid == true) {\n let gridBtn =\n document.getElementById(\"grid-button\");\n gridBtn.innerText = \"Grid Off\";\n }\n}","function getTreeState() {\n var tree = viewTree.getData().getAllNodes();\n //isc.JSON.encode(\n return { width: viewTree.getWidth(),\n time: isc.timeStamp(),\n pathOfLeafShowing: viewInstanceShowing ? viewInstanceShowing.path : null,\n // selectedPaths: pathShowing, //viewTree.getSelectedPaths(),\n //only store data needed to rebuild the tree \n state: tree.map(function(n) {\n return {\n\t type: n.type,\n\t id: n.id,\n\t parentId: n.parentId,\n\t isFolder: n.isFolder,\n\t name: n.name,\n\t isOpen: n.isOpen,\t\n\t state: n.state,\n icon: n.icon\n };\n\t\t })\n };\n }","function evaluateLightDOM() {\n \n // Light DOM is given as HTML string? => use fragment with HTML string as innerHTML\n if ( typeof self.inner === 'string' ){\n self.inner = document.createRange().createContextualFragment( self.inner );\n }\n \n var children = ( self.inner || self.root ).children;\n self.questions = [];\n self.question_ids = [];\n var count = 0;\n \n // iterate over all children of the Light DOM to search for config parameters\n self.ccm.helper.makeIterable( children ).map( function ( elem ) {\n count += 1;\n\n // self.ccm.helper.generateConfig( elem ); // ToDo\n \n if ( elem.tagName.startsWith('CCM-EXERCISE-') ){\n var param_name = elem.tagName.split('-')[2].toLowerCase();\n switch ( param_name ){\n case 'question':\n self.questions.push( elem.innerHTML );\n self.question_ids.push( self.fkey + '_' + count );\n self.html.main.inner.push( { tag: 'label', for: self.fkey + '_' + count, inner: elem.innerHTML } );\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey + '_' + count } );\n break;\n default: self[ param_name ] = elem.innerHTML;\n }\n }\n } );\n \n if ( self.questions.length === 0 ){\n self.html.main.inner.push( { tag: 'label', for: self.fkey } );\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey, placeholder: self.placeholder || '' } );\n }\n \n self.html.main.inner.push( { tag: 'ccm-show_solutions', for: self.fkey } );\n \n }","function Edit_GetHTMLTarget(eEvent, aData)\n{\n\t//by default use ourselves\n\tvar result = this;\n\t//switch on event\n\tswitch (eEvent)\n\t{\n\t\tcase __NEMESIS_EVENT_MATCHCODE:\n\t\t\t//our matchcode exist? and is visible? use it\n\t\t\tresult = this.STATES_MATCHCODE ? this.MATCHCODE : null;\n\t\t\tbreak;\n\t}\n\t//return it\n\treturn result;\n}","function getGridGetAction() {\n var keys = $(\"div.grid-view\").find(\"div.keys\");\n var getAction = '';\n switch (keys.length) {\n case 0:\n alert('No gridview keys found');\n getAction = '';\n break;\n case 1:\n getAction = keys.attr('title');\n break;\n default:\n alert('Mutiple gridview keys found');\n getAction = '';\n break;\n }\n \n return getAction;\n}","function getHeaderGrid(dp,cellIndex){\n\treturn dp.obj.hdrLabels[cellIndex];\n}","get grid() {\n return this._grid;\n }","function setGridState(visible, enabled) {\n var gridContents = document.getElementsByClassName('grid-content');\n var grid = document.getElementById('grid');\n\n if (enabled) {\n grid.setAttribute('enabled', '');\n } else {\n grid.removeAttribute('enabled');\n }\n\n for (var i = 0; i < gridContents.length; i++) {\n if (!visible) {\n gridContents[i].classList.add('invisible');\n } else {\n gridContents[i].classList.remove('invisible');\n }\n }\n}","function Simulator_Position_GetDisplayRect(html)\n{\n\treturn Position_GetDisplayRect(html);\n}","function getGridString(cols, rows)\n{\n\tvar tableMarkup = $(\"#drawing-table\").html();\n\tvar index = 0;\n\tvar result = \"\";\n\twhile(true)\n\t{\n\t\tindex = tableMarkup.indexOf(\"\", index);\n\t\tif (index == -1)\n\t\t\tbreak;\n\t\tif (tableMarkup[index-1] == SYMB_AVAIL)\n\t\t\tresult += \"1\";\n\t\telse\n\t\t\tresult += \"0\";\n\t\tindex++;\n\t}\n\treturn result;\n}","function displayState(tab) {\n $(\".grid\").empty();\n for (let i = 0; i < tab.length; i++) {\n for (let j = 0; j < tab[i].length; j++) {\n const elem = tab[i][j];\n if (elem) {\n const item = $(`
${elem}
`);\n $(\".grid\").append(item);\n } else {\n // if (leftMove == 1) {\n // $(\".grid\").append(`
\"car\"
`);\n // leftMove = 0\n // } else if (rightMove == 1) {\n // $(\".grid\").append(`
\"car\"
`);\n // rightMove = 0\n // } else {\n $(\".grid\").append(`
\"DAVIDOU\"
`);\n\n // }\n }\n\n }\n }\n}","validateGridView() {\n return this\n .waitForElementVisible('@gridViewContainer')\n .assert.elementPresent('@gridViewContainer', 'Grid View Displayed');\n }","function pagehtml(){\treturn pageholder();}","function IsDomCustomGrid(evt, element, eventOpts, objName, description, flavor, items)\r\n\t{\r\n\t\tfunction _getName(el)\r\n\t\t{\r\n\t\t\tvar name = __getAttribute(el, '');\r\n\t\t\tif (name)\r\n\t\t\t{\r\n\t\t\t\treturn name;\r\n\t\t\t}\r\n\t\t\treturn \"Grid\";\r\n\t\t} \r\n \r\n\t\tfunction _getCell(el)\r\n\t\t{\r\n\t\t\treturn {row: 0, col: 0};\r\n\t\t}\r\n\t\r\n\t\tvar rvalue =\r\n\t\t{\r\n\t\t\troot: null, // to define in future the most near element or smth else\r\n\t\t\tresult: null, // here will be old res placed\r\n\t\t\trcode: R_NOT_OBJECT // return code\r\n\t\t};\r\n\t \r\n\t\tvar root = false;\r\n\r\n\t\t/**\r\n\t\t * Test element or it's neighbour nodes to detect type of an object we are dealing with.\r\n\t\t * Element API is described here: https://developer.mozilla.org/en-US/docs/Web/API/Element\r\n\t\t * API to use:\r\n\t\t *\t__hasParentWithAttr(element, attributeName, regexp)\r\n\t\t * __getAttribute(element, attributeName);\r\n\t\t *\r\n\t\t */\r\n\t\tif(root=__hasParentWithAttr(element, '', //ig))\r\n\t\t{\r\n\t\t\t// TODO\r\n\t\r\n\t\t\tvar res = {\r\n\t\t\t\tcancel: false,\r\n\t\t\t\tobject_flavor: 'Grid',\r\n\t\t\t\tobject_name: _getName(root),\r\n\t\t\t\tobject_type: 'DomCustomGrid',\r\n\t\t\t\tdescription: 'TODO Action description',\r\n\t\t\t\tlocator_data: \r\n\t\t\t\t{\r\n\t\t\t\t\txpath: SeS_GenerateXPath(root)\r\n\t \t\t}\r\n\t\t\t};\r\n\t\r\n\t\t\t// Learn\r\n\t\t\trvalue.result = res;\r\n\t\t\trvalue.root = root;\r\n\t\t\trvalue.rcode = R_OBJECT_FOUND;\r\n\t\t\t\r\n\t\t\tif(evt == \"resolveElementDescriptor\")\r\n\t\t\t{\r\n\t\t\t\tres.rect = __getElementRect(root);\r\n\t\t\t\tres.action = undefined;\r\n\t\t\t\treturn rvalue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (evt == \"Click\")\r\n\t\t\t{\r\n\t\t\t\tvar cell = _getCell(element);\r\n\t\t\t\tif (cell)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar actionClick = {\r\n\t\t\t\t\t\t\tname: \"ClickCell\",\r\n\t\t\t\t\t\t\tdescription: \"Click cell in a grid\",\r\n\t\t\t\t\t\t\tparams: [cell.row, cell.col]\r\n\t\t\t\t\t\t};\t\r\n\t\t\t\t\tres.action = actionClick;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\r\n\t\t\r\n\t\t\t// Actions \r\n\t\t\trvalue.rcode = R_ACTION_FOUND;\r\n\t\t}\r\n\t\t\r\n\t\treturn rvalue;\r\n\t}","GetGraphFromHTML() {\n var mydiv = document.getElementById(\"mygraphdata\");\n var graph_as_string = mydiv.innerHTML;\n let graph = eval(graph_as_string);\n return graph;\n }","htmlForStatus() {\nvar html;\n//----------\nreturn html = `\n\nStatus:\n\n `;\n}","function social_curator_grid_post_loaded(data, element){}","function getGridCellDev(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCellDev(row, col))\n {\n return -1;\n }\n var index = (row * gridWidthDev) + col;\n return grid[index];\n}","generateGridRows() {\n // Object to store the tiles\n let grid_rows = []\n let grid_ind = 1\n // For each row\n for (let row = 1; row <= 4; row++) {\n let col_grids = []\n //For each column\n for (let col = 1; col <= 4; col++) {\n // Referred to reactjs documentation for handle click\n let id = grid_ind++\n // To assign class based on state\n // Useful for styling\n let classVar = this.state.tileData[id]['status'] == 'hide' ? '' : 'tile-' + this.state.tileData[id]['status']\n col_grids.push( {\n this.handleClick(id)\n }}>{this.state.tileData[id]['status'] != 'hide'\n ? this.state.tileData[id]['letter'] : ''})\n }\n grid_rows.push({col_grids})\n }\n return grid_rows\n }","function loadGrid() {\n \n }","function getTemplate(winNo) {\n var str =\n '
' +\n '
' +\n ' ' + VIS.Msg.getMsg(\"ViewMore\") + ' ' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
' +\n ' ' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
' +\n ' ' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n ' ' + VIS.Msg.getMsg(\"Add\") + ' ' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
';\n return str;\n }","_parseHTML(htmlString) {\n //current xpath is body.div[i].table.tbody.tr[j].td[1-5]\n let cleanedHtmlString = htmlString.replace(/(\\\\t|\\\\n|&nbsp;)/gi,'');\n let root = htmlParser.parse(htmlString);\n let divs = root.querySelectorAll('div');\n if (divs) {\n for (let div of divs) {\n let table = div.querySelector('table');\n if (!table) {\n continue;\n }\n\n let tbody = table.querySelector('tbody');\n if (!tbody) {\n continue;\n }\n\n let rows = tbody.querySelectorAll('tr');\n if (!rows) {\n continue;\n }\n for (let row of rows) {\n let cols = row.querySelectorAll('td');\n //take 5 cols from here\n this._data.add(cols[0].rawText, cols[1].rawText, cols[2].rawText, cols[4].rawText);\n }\n }\n }\n }","getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }","get cellTagName() {\n return 'div';\n }","function lightCell(str){\n if ( convertRow(str) <= countRows() && convertColumn(str) <= countColumns() ) {\n return GRID[convertRow(str)][convertColumn(str)];\n } else {\n return false;\n }\n}","function _getWebComponentsState() {\r\n // is mostly valid (css)\r\n //import feature is not always enabled\r\n const _imp = 'import' in document.createElement('link');\r\n const _tmp = !(document.createElement('template')\r\n instanceof HTMLUnknownElement);\r\n return Object.freeze({\r\n import: _imp,\r\n template: _tmp,\r\n isError: (!_imp || !_tmp)\r\n });\r\n }","function gridMap() {\n return {\n top_left: { _cx_cy_index: 4, drag_index : [ 2, 3, 4 ] },\n bottom_left: { _cx_cy_index : 3, drag_index : [ 1, 4, 3 ] },\n top_right: { _cx_cy_index : 2, drag_index : [ 4, 1, 2 ] },\n bottom_right: { _cx_cy_index : 1, drag_index : [ 3, 2, 1 ] }\n };\n }","getGridColumnIndex(){return this.__gridColumnIndex}","function Grid() {\n /* public properties */\n //是否能够多选行\n this.multiple = true;\n //排序列,内部用\n this.sortCol = -1;\n //降序排序\n this.sortDescending = 0;\n //错误信息\n this.error = '';\n //已选择的行数组\n this.selectedRows = [];\n //奇偶行是否用不同颜色显示,此开关打开时,添加删除行ie会自动关闭,原因目前不明\n this.colorEvenRows = true;\n //列是否允许调整宽度\n this.resizeColumns = true;\n //表体body列是否随表头head列的宽度实时调整列宽\n this.bodyColResize = true;\n //用户定义的对象变量名的字符串形式\n this.selfName = '';\n //是否排序开关\n this.sortFlag = true;\n //显示右键菜单\n this.showMenu = false;\n //是否能增减行,只控制键盘事件和右键菜单\n this.addSubRow = false;\n //序号的起始数\n this.startNum = 1\n //用户输入数据错误标志,\n this.inputError = false;\n //grid是否可编辑,该标志由程序更加html代码设置,用于对编辑快捷键的控制\n this.editFlag = false;\n //在grid最后一个编辑框失去焦点时,页面焦点聚到grid外的其他元素上\n this.nextFocus = null;\n //设置gird的高度为 maxViewRow行记录,不设置,默认高度按container高度走\n this.maxViewRow = -1\n //对gird的单元格统一加的累计宽度值\n this.widthAddValue = 20;\n //排序类型,数组,存放类型有'String','Number','None','Date','CaseInsensitiveString'\n this.sortTypes =[];\n //数据列的显示位置,页面用户将要排序的列序号(从0开始)作为数组传入,没有传入的列序号,将(通过把列宽置为0)被隐藏\n //如:o.colPos=[0,4,3,2]\n // o.colPos=[4,2,3,1]\n // 注意:1.在o.bind(...)调用之前对此赋值,不需要排序和隐藏列的功能不要赋值此属性\n // 2.列号一定要在 0 和 列数减一 之间,grid对此不校验,可能会出错。\n this.colPos = [];\n //添加行时,是否复制上一行的数据。ture-复制,false-不复制,默认false\n this.isAddRowWithData=false;\n //新增行时按照哪一行(首行或末行或选择的行的第一行)进行复制 (默认按首行复制)\n // false -首行复制 ; true - 末行复制 ;null - 按选择行复制(如果选择多行,复制选择的第一行,没选择行 则复制首行)\n //此参数在o.bind前后都可以设置。\n this.isAddRowWithLast = false;\n //在设置完只读单元格后,当前的编辑框是否下移到下一个可编辑框上,默认为移动\n this.isMoveFocusAfterSetReadOnly = true;\n //哪些列是多行select ,如:o.mutiSelectPos=[2,3]\n this.mutiSelectPos = [];\n\n /* events */\n this.onresize = null;\n this.onsort = null;\n this.onselect = null;\n this.onAddRow = null;\n this.onRemoveRow = null;\n this.onGridBlur = null; //Grid失去焦点时触发函数, Added by likey, Date: 2006-04-20\n\n\n /* private properties */\n //Container容器\n this._eCont = null;\n //Head 容器\n this._eHead = null;\n //left 容器\n this._eLeft = null;\n //body 容器\n this._eBody = null;\n //head 表格\n this._eHeadTable = null;\n //left 表格\n this._eLeftTable = null;\n //body 表格\n this._eBodyTable = null;\n //head 列集合\n this._eHeadCols = null;\n //暂时为1列\n this._eLeftCols = null;\n //body 的列集合\n this._eBodyCols = null;\n //用于调整Left行高\n this._eBodyRows = null;\n\n //当前处于编辑状态的单元格\n this._eEditTd = null;\n //第一个可编辑td\n this._eFistEditTd = null;\n //内部用的全局变量,用于左右键移动单元格的递归函数调用中\n this.__tempTd = null;\n //上次施动者td\n this._preLinkerTd = null;\n\n //右键菜单\n this._eMenu = null;\n\n this._eDataTable = null;\n //保存列的一些设置数据信息的数组\n this._eDataCols = null;\n\n this._activeHeaders = null;\n this._rows = 0;\n this._cols = 0;\n\n this._defaultLeftWidth = 40;\n\n}","function stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }","function getPopupFormState()\n {\n var state = new Object();\n var elms;\n if(isParameterizedPopup && popupFormName!=null)\n elms = popupFormName.elements;\n else\n elms = popupDiv.getElementsByTagName(\"*\");\n var len = elms.length;\n for (var i = 0; i < len; i++)\n {\n var element = elms[i];\n //bug18449628 \n if (element && element.tagName != \"IMG\")\n {\n var name = element.name;\n if (name)\n {\n // Skip over hidden values\n var elmType = element.type;\n if (!elmType || (elmType != 'hidden'))\n state[name] = _getValue(element);\n }\n }\n }\n return state;\n }","getState(board){\r\n return this.fenToArray(this.game.fen())\r\n }","function saveState(){\n var grid = gridState();\n var state = {grid:grid};\n state.level = $('#level').val();\n state.variant = options.variant;\n $.bbq.pushState(state);\n }","function _getElements() {\n\tif(_store){\n if (_isSubpageOpened()) {\n return _store.getState().secondLevelPage.elements;\n }\n return _store.getState().elements;\n\t}\n }","function getStateFromUi() {\n \n var state = {\n tab: getSelectedTab(),\n selectedPeriodOffset: getSelectedPeriodOffset(),\n selectedGroup: getSelectedGroup(),\n selectedIndividual: getSelectedIndividual()\n };\n \n if(state.selectedIndividual !== null) {\n state.mode = MODE.INDIVIDUAL;\n } else if(state.selectedIndividual === null && state.selectedGroup !== null) {\n state.mode = MODE.GROUP;\n } else {\n state.mode = MODE.FLEET;\n }\n \n return state;\n }","function getDeviceState() {\n var state = window.getComputedStyle(\n document.querySelector('.state-indicator'), ':before'\n ).getPropertyValue('content')\n\n state = state.replace(/\"/g, \"\");\n state = state.replace(/'/g, \"\"); //fix for update in chrome which returns ''\n\n return state; //need to replace quotes to support mozilla - which returns a string with quotes inside.\n\n}","function generateGrid() {\n gameBoard.childNodes[1].innerText = `It's ${game.turn.token}'s turn`;\n var grid = gameBoard.childNodes[3];\n grid.innerHTML = '';\n for (var i = 0; i < 9; i++) {\n gridIndex = i;\n grid.innerHTML += `\n
\n
\n `\n }\n game.resetGame();\n persistWins();\n}","function createGrid() {\n let board = document.getElementById(\"board\");\n let tableHTML = \"\";\n for (let r = 0; r < height; r++) {\n let currentArrayRow = [];\n let currentHTMLRow = ``;\n for (let c = 0; c < width; c++) {\n let newNodeId = `${r}-${c}`;\n let newNodeClass = \"unvisited\";\n currentHTMLRow += ``;\n }\n currentHTMLRow += ``;\n tableHTML += currentHTMLRow;\n }\n board.innerHTML = tableHTML;\n}","function getStates(game) {\n\n}","function draw_grid_html(grid,n,id){\n var html = ''\n var grid_center = grid[(grid.length-1)/2];\n html += '
Grid build of '+ n + ' blocks with center ' + grid_center + ' blocks high
';\n html += '
['+ grid.toString() + '] = ' + grid.reduce(function(a,b){return a+b;}) + ' blocks
';\n html += '
'\n for(var x = 0; x < grid.length; x++){\n var column = '
';\n for (var b=1; b <= grid[x]; b++){\n column += '
';\n }\n column +='
';\n html += column;\n }\n html += '
';\n document.getElementById(id).innerHTML = html;\n\n return html;\n}","function renderGrid() {\n let { C, cols, rows, px, grid_color, render_border } = state\n C.gx.clearRect(\n -render_border,\n -render_border,\n C.gx.canvas.width,\n C.gx.canvas.height\n )\n C.gx.strokeStyle = grid_color\n C.gx.lineWidth = 1\n C.gx.strokeRect(0.5, 0.5, sub(mul(cols, px), 1), sub(mul(rows, px), 1))\n C.gx.lineWidth = 2\n for (let c = 1; c < state.cols; c++) {\n C.gx.beginPath()\n C.gx.moveTo(mul(c, px), 0)\n C.gx.lineTo(mul(c, px), mul(rows, px))\n C.gx.stroke()\n }\n for (let r = 1; r < state.rows; r++) {\n C.gx.beginPath()\n C.gx.moveTo(0, mul(r, px))\n C.gx.lineTo(mul(cols, px), mul(r, px))\n C.gx.stroke()\n }\n}","getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }","getRow(n) {\n return this.grid[n];\n }","function renderGrid(grid) {\r\n let modules = grid.modules;\r\n let svg = document.getElementById('root');\r\n let i;\r\n\r\n for (i = 0; i < modules.length; i++) {\r\n svg.appendChild(createModule(modules[i], svg.namespaceURI));\r\n }\r\n}","_parseContent(item) {\n const textFieldClass = this.getCSS(this._data.mode, \"textField\");\n return item.querySelector(`.${textFieldClass}`).innerHTML;\n }","async getSingleMarkup() {\n return ` \n
\n

${this.name}

\n \n
\n
\n
\n
\n ${window.Core.checkFirstBreadcrumb()} > \n ${this.name}\n
\n
\n

${window.Core.t(\"country\")}${this.country}

\n

${window.Core.t(\"nickname\")}${this.nickname}

\n
\n
\n \n
\n
\n

${window.Core.t(\"visithotelsheader\")}

\n
`;\n }","function getState() {\n return window.stokr.model.getState();\n }","function getCurrentBoard(){\n\t\t\tvar $rows = $el.find('.panel-row');\n\t\t\tvar currentBoard = [];\n\t\t\t\n\t\t\t$.each( $rows, function(){\n\t\t\t\tvar $row = $(this);\n\t\t\t\tvar $panels = $row.find('.top .stationary-panel span');\n\t\t\t\tvar panelVals = [];\n\t\t\t\t\n\t\t\t\t$.each( $panels, function(){\n\t\t\t\t\tvar $panel = $(this);\n\t\t\t\t\t\n\t\t\t\t\tpanelVals.push( $panel.text() );\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tcurrentBoard.push( panelVals );\n\t\t\t});\n\t\t\t\n\t\t\treturn currentBoard;\n\t\t}","function displayWinState() {\n // Set the win state styling on all of the cells\n $('.content').addClass('winstate');\n // Make the win state div visible\n $('#solved').removeClass('hidden');\n }","function $3gv(){\n var readyStateDone$=new $3gv.$$;ReadyState(4,readyStateDone$);\n return readyStateDone$;\n}"],"string":"[\n \"function parseGrid(grid) {\\n var str = '';\\n for (var row = 0; row < grid.length; row++) {\\n for (var col = 0; col < grid[row].length; col++) {\\n str = str + (grid[row][col].state ? grid[row][col].state.toLowerCase() : '-')\\n }\\n }\\n return str;\\n}\",\n \"getGrid(gridNr) {\\n var gridVal = this.state.gridValues[gridNr];\\n if (gridVal == null) {\\n gridVal = '.';\\n }\\n return this.gridClick(gridNr)} />\\n }\",\n \"function getGrid(pos) {\\n\\tlet childs = c.childNodes;\\n\\treturn childs[pos];\\n}\",\n \"getGridHtml(editor) {\\n const curPos = editor.getCursor();\\n\\n if (this.isInGridBlock(editor)) {\\n const bog = this.getBog(editor);\\n const eog = this.getEog(editor);\\n // skip block begin sesion(\\\"::: editable-row\\\")\\n bog.line++;\\n // skip block end sesion(\\\":::\\\")\\n eog.line--;\\n eog.ch = editor.getDoc().getLine(eog.line).length;\\n return editor.getDoc().getRange(bog, eog);\\n }\\n return editor.getDoc().getLine(curPos.line);\\n }\",\n \"function getGridPosition() {\\n\\tvar selectedUnit = document.getElementsByClassName(\\\"selected\\\");\\n\\tif (angular.isDefined(selectedUnit[0])) {\\n\\t\\tvar rowIndex = selectedUnit[0]['className'].split(\\\" \\\")[2].substring(8);\\n\\t\\tvar gridPos = rowIndex.split('-');\\n\\t\\treturn gridPos;\\n\\t} else {\\n\\t\\treturn false;\\n\\t}\\n}\",\n \"function state_to_dom(s) {\\n try {\\n let html=\\\"\\\";\\n for(let j=0;j<3;++j) {\\n for(let i=0;i<3;++i) {\\n html+=\\\" \\\";\\n if(s.grid[j][i]==0) html+=\\\" \\\";\\n else html+=s.grid[j][i];\\n }\\n html+=\\\"\\\\n\\\";\\n }\\n let obj=document.createElement(\\\"pre\\\");\\n obj.innerHTML=html;\\n return obj;\\n } catch(e) {\\n helper_log_exception(e);\\n throw e;\\n return null;\\n }\\n}\",\n \"function getBoardState() {\\n\\t\\tfor (var i = 0; i < 3; i++) {\\n\\t\\t\\tfor (var j = 0; j < 3; j++) {\\n\\t\\t\\t\\tboard[i][j] = $('[data-loc=\\\"{i : ' + i + ', j : ' + j + '}\\\"]').text();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function gridState(){\\n var grid = {};\\n $theInputs = $('.game-cell-input');\\n $theInputs.each(function(){ // iterate over each input\\n if($(this).val()){\\n var num = $(this).data('num');\\n var special = $(this).data('special');\\n if(typeof special == \\\"undefined\\\" || special > 5 || special == 0){\\n special = 0;\\n }\\n grid[num] = {val: $(this).val(), special: special};\\n }\\n });\\n return grid;\\n }\",\n \"function TreeGrid_GetHTMLTarget(eEvent, aData)\\n{\\n\\t//default result: null\\n\\tvar result = null;\\n\\t//get the position\\n\\tvar position = TreeGrid_GetTargetItemPosition(this, aData, __DESIGNER_CONTROLLER || __SCREENSHOTS_ON || eEvent != __NEMESIS_EVENT_CLICK && eEvent != __NEMESIS_EVENT_SELECT && eEvent != __NEMESIS_EVENT_NOTHANDLED);\\n\\t//header?\\n\\tif (position.Row == -1 && position.Column != null)\\n\\t{\\n\\t\\t//get the headers\\n\\t\\tvar headers = this.InterpreterObject.Content ? this.InterpreterObject.Content.Headers.Ordered : null;\\n\\t\\t//get the header\\n\\t\\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column].HTML : null;\\n\\t}\\n\\t//is the row visible?\\n\\telse if (position.Row != null && position.Row >= 0 && (this.InterpreterObject.Content.TreeData == null || this.InterpreterObject.Content.TreeData.VisibleMap[position.Row]))\\n\\t{\\n\\t\\t//get the tree data\\n\\t\\tvar treeData = this.InterpreterObject.Content.TreeData;\\n\\t\\t//get the row\\n\\t\\tvar row = this.InterpreterObject.Content.Cells.Rows[position.Row];\\n\\t\\t//assume we will be clicking on the scrollable part of the grid\\n\\t\\tresult = row.HTML ? row.HTML.Fixed.firstChild ? row.HTML.Fixed : row.HTML.Scrollable : null;\\n\\t\\t//also has a column? ie: want a cell?\\n\\t\\tif (position.Column != null)\\n\\t\\t{\\n\\t\\t\\t//get the row cell\\n\\t\\t\\tresult = row.Objects[position.Column].HTML;\\n\\t\\t}\\n\\t\\t//check the event\\n\\t\\telse switch (eEvent)\\n\\t\\t{\\n\\t\\t\\tcase __NEMESIS_EVENT_OPENBRANCH:\\n\\t\\t\\tcase __NEMESIS_EVENT_CLOSEBRANCH:\\n\\t\\t\\t\\t//this row is a treegrid line?\\n\\t\\t\\t\\tif (treeData && row)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t//set the target\\n\\t\\t\\t\\t\\tresult = row.Objects[treeData.Column].HTML.BranchButton;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tdefault:\\n\\t\\t\\t\\t//cell selection only (but of course requesting a row selection, of course)\\n\\t\\t\\t\\tif (Get_String(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE], \\\"\\\") == \\\"CellOnly\\\")\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t//loop through the cells\\n\\t\\t\\t\\t\\tfor (var i = 0, c = row.Objects.length; i < c; i++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t//this one has cell selects row?\\n\\t\\t\\t\\t\\t\\tif (row.Objects[i].SelectionActionsOnly)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t//use this one isntead\\n\\t\\t\\t\\t\\t\\t\\tresult = row.Objects[i].HTML;\\n\\t\\t\\t\\t\\t\\t\\t//end loop\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}\\n\\telse\\n\\t{\\n\\t\\t//use the entire treegrid\\n\\t\\tresult = this;\\n\\t}\\n\\t//return the result\\n\\treturn result;\\n}\",\n \"function getGrid() {\\n\\tconsole.log(\\\"Current rows are: \\\" + GRID.rows + \\\"\\\\nCurrent columns are: \\\" + GRID.columns);\\n}\",\n \"function setState() {\\n var tags = document.getElementsByTagName(\\\"td\\\")\\n let state = [];\\n for (var i = 0; i < tags.length; i++) {\\n state.push(tags[i].innerHTML)\\n };\\n return state;\\n}\",\n \"function getGridClass(pos) {\\n\\tlet childs = c.childNodes;\\n\\tlet classes = childs[pos].className.split(' ');\\n\\treturn classes;\\n}\",\n \"function TreeGrid_GetData()\\n{\\n\\t//create an array for the result\\n\\tvar result = [];\\n\\t//have we got content? with cells?\\n\\tif (this.InterpreterObject.Content && this.InterpreterObject.Content.Cells)\\n\\t{\\n\\t\\t//loop through the html\\n\\t\\tfor (var rows = this.InterpreterObject.Content.Cells.Rows, i = 0, c = rows.length; i < c; i++)\\n\\t\\t{\\n\\t\\t\\t//selected?\\n\\t\\t\\tif (rows[i].Selected)\\n\\t\\t\\t{\\n\\t\\t\\t\\t//add this to the result\\n\\t\\t\\t\\tresult.push(\\\"\\\" + (i + 1));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t//return it\\n\\treturn result;\\n}\",\n \"function UltraGrid_GetHTMLTarget(eEvent, aData)\\n{\\n\\t//default result: null\\n\\tvar result = null;\\n\\n\\t//get the target\\n\\tvar target = UltraGrid_GetTarget(this.InterpreterObject, aData[0]);\\n\\t//valid target?\\n\\tif (target)\\n\\t{\\n\\t\\t//this a cell?\\n\\t\\tif (target.UltraGridCell || target.UltraGridHeader)\\n\\t\\t{\\n\\t\\t\\t//use the html\\n\\t\\t\\tresult = target.HTML;\\n\\t\\t}\\n\\t\\t//must be a row\\n\\t\\telse if (target.Panels)\\n\\t\\t{\\n\\t\\t\\t//get its first panel row\\n\\t\\t\\tresult = target.PanelRows[target.PanelIds[0]];\\n\\t\\t}\\n\\t}\\n\\t//return the result\\n\\treturn result;\\n}\",\n \"function read_state() {\\n let grid=Array(3).fill(0).map(x => Array(3));\\n for(let k=0;k<9;++k) {\\n let input=document.getElementById(\\\"input_pos\\\"+k);\\n let j=Math.floor(k/3);\\n let i=k%3;\\n if(input.value==\\\"\\\") grid[j][i]=0;\\n else grid[j][i]=parseInt(input.value,10);\\n }\\n return {\\n grid : grid\\n };\\n}\",\n \"function getSpanGrid() {\\n\\tvar grid = new Array(4);\\n\\tgrid[0] = new Array(4);\\n\\tgrid[1] = new Array(4);\\n\\tgrid[2] = new Array(4);\\n\\tgrid[3] = new Array(4);\\n\\tvar n = 0;\\n\\tfor (var r = 0; r < 4 ; r++ ) {\\n\\t\\tfor (var c = 0; c < 4 ; c++ ) {\\n\\t\\t\\tgrid[r][c] = $(\\\"#grid .cell\\\").eq(n).find(\\\"span\\\");\\n\\t\\t\\tn++;\\n\\t\\t}\\n\\t}\\n\\treturn grid;\\n}\",\n \"function getViewState(formElement) {\\n return AjaxImpl_1.Implementation.getViewState(formElement);\\n }\",\n \"function handleDemoGrid() {\\r\\n\\tswitch(demoGridState) {\\r\\n\\t\\tcase 0: //\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\tdefault:\\r\\n\\t\\t\\tbreak;\\r\\n\\t}\\r\\n}\",\n \"get gridMode() {\\n return this.i.ni;\\n }\",\n \"getGrid() {\\n return this.gridCells;\\n }\",\n \"getHTML() {\\n return getHTMLFromFragment(this.state.doc.content, this.schema);\\n }\",\n \"function getElementBasedFormatState(editor, event) {\\n var listTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'OL,UL'));\\n var headerTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'H1,H2,H3,H4,H5,H6'));\\n return {\\n isBullet: listTag == 'UL',\\n isNumbering: listTag == 'OL',\\n headerLevel: (headerTag && parseInt(headerTag[1])) || 0,\\n canUnlink: !!editor.queryElements('a[href]', 1 /* OnSelection */)[0],\\n canAddImageAltText: !!editor.queryElements('img', 1 /* OnSelection */)[0],\\n isBlockQuote: !!editor.queryElements('blockquote', 1 /* OnSelection */)[0],\\n };\\n}\",\n \"function getGridElementsPosition(index) {\\n const gridEl = document.getElementById(\\\"grid\\\");\\n let offset = Number(window.getComputedStyle(gridEl.children[0]).gridColumnStart) - 1;\\n if (isNaN(offset)) {\\n offset = 0;\\n }\\n const colCount = window.getComputedStyle(gridEl).gridTemplateColumns.split(\\\" \\\").length;\\n const rowPosition = Math.floor((index + offset) / colCount);\\n const colPosition = (index + offset) % colCount;\\n return {\\n row: rowPosition,\\n column: colPosition\\n };\\n}\",\n \"getCurrentGridState(args) {\\n const gridState = {\\n columns: this.getCurrentColumns(),\\n filters: this.getCurrentFilters(),\\n sorters: this.getCurrentSorters(),\\n };\\n const currentPagination = this.getCurrentPagination();\\n if (currentPagination) {\\n gridState.pagination = currentPagination;\\n }\\n if (this.hasRowSelectionEnabled()) {\\n const currentRowSelection = this.getCurrentRowSelections(args && args.requestRefreshRowFilteredRow);\\n if (currentRowSelection) {\\n gridState.rowSelection = currentRowSelection;\\n }\\n }\\n return gridState;\\n }\",\n \"function getState(el) {\\n // insert your own code here to extract a relevant state object from an or tag\\n // for example, if you rely on any other custom \\\"data-\\\" attributes to determine the link behaviour\\n return {};\\n }\",\n \"function TreeGrid_GetInterpreterTarget(theHTML, aData)\\n{\\n\\t//default result: null\\n\\tvar result = null;\\n\\t//get the position\\n\\tvar position = TreeGrid_GetTargetItemPosition(theHTML, aData);\\n\\t//header?\\n\\tif (position.Row == -1 && position.Column != null)\\n\\t{\\n\\t\\t//get headers\\n\\t\\tvar headers = theHTML.InterpreterObject.Content ? theHTML.InterpreterObject.Content.Header.Cells : null;\\n\\t\\t//get the header\\n\\t\\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column] : null;\\n\\t}\\n\\t//we have this row?\\n\\telse if (position.Row != null && position.Row >= 0 && theHTML.InterpreterObject.Content && position.Row < theHTML.InterpreterObject.Content.Cells.Rows.length)\\n\\t{\\n\\t\\t//get the row\\n\\t\\tvar row = theHTML.InterpreterObject.Content.Cells.Rows[position.Row];\\n\\t\\t//have we got a cell?\\n\\t\\tif (row != null && position.Column >= 0 && row.Objects && position.Column < row.Objects.length)\\n\\t\\t{\\n\\t\\t\\t//get the cell\\n\\t\\t\\tresult = row.Objects[position.Column];\\n\\t\\t}\\n\\t}\\n\\t//return the result\\n\\treturn result;\\n}\",\n \"function loadBoardState(thisState){\\n document.querySelectorAll(\\\".dim\\\").forEach(function(item){\\n if(getLitStateBit(thisState, parseInt(item.getAttribute(\\\"data-index\\\")))){\\n item.classList.add(\\\"lit\\\");\\n }else{\\n item.classList.remove(\\\"lit\\\");\\n }\\n });\\n }\",\n \"function readState () {\\n cache()\\n var str = location.pathname.substr(1)\\n var result = getRouteNode(str)\\n\\n if (!result) {\\n const ev = new CustomEvent(\\\"routenotfound\\\", {\\n detail: {\\n path: str\\n }\\n })\\n\\n window.dispatchEvent(ev)\\n return\\n }\\n var node = cloneNodeAsElement(result.node, 'div')\\n\\n node.innerHTML = result.node.textContent\\n loadNodeSource(node, result.matches)\\n return node\\n}\",\n \"function loadState(){\\n var state = $.deparam.fragment();\\n grid = state.grid;\\n \\n if(typeof state.variant !== \\\"undefined\\\"){\\n options.variant = state.variant;\\n }\\n \\n if(typeof state.level !== \\\"undefined\\\"){\\n options.level = state.level;\\n } else {\\n options.level = 1;\\n }\\n \\n $theInputs = $('.game-cell-input');\\n $theInputs.each(function(){ // iterate over each input, putting saved value in.\\n var num = $(this).data('num');\\n if(typeof grid !== \\\"undefined\\\" && typeof grid[num] !== \\\"undefined\\\" && grid[num] !== \\\"\\\"){\\n $(this).val( grid[num].val );\\n $(this).data('special', grid[num].special );\\n } else {\\n $(this).val('');\\n $(this).data('special', 0 );\\n }\\n decorateInput($(this));\\n });\\n \\n $('#level').val(options.level);\\n }\",\n \"function getGridStateAndNumFilled() {\\n let state = '';\\n let numFilled = 0\\n for (let i = 0; i < gridHeight; i++) {\\n for (let j = 0; j < gridWidth; j++) {\\n if (grid[i][j].notBlocked()) {\\n if (langMaxCharCodes == 1) {\\n state = state + grid[i][j].currentLetter\\n } else {\\n state = state + grid[i][j].currentLetter + '$'\\n }\\n if (grid[i][j].currentLetter != '0') {\\n numFilled++\\n }\\n } else {\\n state = state + '.'\\n }\\n }\\n }\\n numCellsFilled = numFilled\\n return state;\\n}\",\n \"getCellState(i, j) {\\n let that = this;\\n return function () {\\n return that.state.grid[i][j];\\n }\\n }\",\n \"cellState(row, col) {\\n const cells = this.cells;\\n return cells[ this.to_1d(row, col) * this.cellBytes ];\\n }\",\n \"function getGrid () {\\n\\tlet grid = new Array(3);\\n\\tfor (var i = 0; i < 3; i++)\\n\\t\\tgrid[i]=new Array(3);\\n\\n\\tfor (var i = 0; i < 3; i++) {\\n\\t\\tfor (var j = 0; j < 3; j++) {\\n\\t\\t\\tlet divSector = $(\\\"#grid-\\\" + i + j + \\\"-id\\\");\\n\\t\\t\\tgrid[i][j] = divSector.text();\\n\\t\\t}\\n\\t}\\n\\n\\treturn grid;\\n}\",\n \"function redrawHTMLGrid(grid, gridID) {\\n var gridHTML = document.getElementById(gridID);\\n for (var i = 0; i < height; i++) {\\n for (var j = 0; j < width; j++) {\\n var cell = gridHTML.rows[i].cells[j];\\n if (grid[i][j])\\n cell.className = \\\"selected\\\";\\n else\\n cell.className = \\\"\\\";\\n }\\n }\\n}\",\n \"function setHTMLCell(x, y, liveState){\\n Array.from(dom.boardNode.children)[size*x + y].classList.toggle(\\\"live\\\", liveState);\\n}\",\n \"function drawHTMLGrid(height, width, gridID) {\\n var gridHTML = document.getElementById(gridID);\\n // Clear previous table and stop game of life algorithm\\n gridHTML.innerHTML = \\\"\\\";\\n clearInterval(globalInterval);\\n // Create html table\\n for (var i = 0; i < height; i++) {\\n var row = gridHTML.insertRow(0);\\n for (var j = 0; j < width; j++) {\\n var cell = row.insertCell(0);\\n cell.innerHTML = \\\"\\\";\\n }\\n }\\n // Onclick a table element, change its class \\n $(\\\".grid td\\\").click(function () {\\n if (this.className == \\\"\\\")\\n this.className = \\\"selected\\\";\\n else\\n this.className = \\\"\\\";\\n });\\n}\",\n \"function getTableDataFromHtml() {\\n\\n }\",\n \"getHTML() {\\n return this._executeAfterInitialWait(() => this.currently.getHTML());\\n }\",\n \"function getElementsFromHTML() {\\n toRight = document.querySelectorAll(\\\".to-right\\\");\\n toLeft = document.querySelectorAll(\\\".to-left\\\");\\n toTop = document.querySelectorAll(\\\".to-top\\\");\\n toBottom = document.querySelectorAll(\\\".to-bottom\\\");\\n }\",\n \"getState() {\\n // TODO return obj with the board's properties\\n }\",\n \"getState(ant) {\\n const tile = this.grid[ant.getPosition().y][ant.getPosition().x];\\n if (!tile) { return 0; }\\n if (this.scope.config.ant_coloring == \\\"rgb_blend\\\") {\\n return tile[ant.id];\\n }\\n return tile.state;\\n }\",\n \"function getgridobj() {\\n\\n return gridobj;\\n\\n }\",\n \"function getGridElement(row, col){\\n\\tvar cellNum = parseInt(row-1)*size + parseInt(col);\\n\\tvar cell = dom.gameBoard.querySelector(\\\"#cell\\\"+cellNum);\\n\\treturn cell;\\n}\",\n \"function identifyCell(gridPossibilities) {\\n var cellReference = 0;\\n return cellReference;\\n}\",\n \"getGameGrid() {\\n return this.buildBlockGrid();\\n }\",\n \"function aanmaken_grid_layout() {\\n var nummer = 0;\\n var kolom__struct = '';\\n var grid__struct = '';\\n\\n for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) {\\n kolom__struct = '';\\n for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) {\\n nummer = nummer + 1\\n kolom__struct += `
`;\\n }\\n grid__struct += `
${kolom__struct}
`;\\n }\\n return grid__struct; // geeft de grid structuur als resultaat terug\\n }\",\n \"getGridView() {\\n const { data } = this.state;\\n if (data.length == 0) return null;\\n\\n return {\\n return
\\n \\n
\\n }},\\n { alias: 'Detalles', value : data => {\\n return visibility;\\n }},\\n ]}\\n />;\\n }\",\n \"async readOverviewTiles() {\\n const tiles = await this.page.evaluate(() =>\\n Array.from(document.querySelectorAll('div[id$=ITtile]')).map(t => {\\n const [title, badge] = t.querySelectorAll('span');\\n return {\\n isSelected: t.classList.contains('p_AFSelected'),\\n title: title.textContent,\\n badge: badge.textContent,\\n selectId: t.querySelector('a[title^=\\\"Select:\\\"]').id,\\n };\\n }));\\n\\n tiles.forEach(t => t.click =\\n this.page.click.bind(this.page, '#'+t.selectId.replace(/:/g,'\\\\\\\\:')));\\n return tiles;\\n }\",\n \"function getElementByString(html) {\\n let element = document.createElement('div')\\n element.classList = 'col form-group row';\\n element.innerHTML = html;\\n return element.firstElementChild\\n\\n}\",\n \"getGridRowIndex(){return this.__gridRowIndex}\",\n \"function gridButton() {\\n let elem = document.querySelectorAll(\\\".square\\\");\\n elem.forEach(toggleGrid);\\n if (grid == false) {\\n let gridBtn =\\n document.getElementById(\\\"grid-button\\\");\\n gridBtn.innerText = \\\"Grid On\\\";\\n }\\n else if (grid == true) {\\n let gridBtn =\\n document.getElementById(\\\"grid-button\\\");\\n gridBtn.innerText = \\\"Grid Off\\\";\\n }\\n}\",\n \"function getTreeState() {\\n var tree = viewTree.getData().getAllNodes();\\n //isc.JSON.encode(\\n return { width: viewTree.getWidth(),\\n time: isc.timeStamp(),\\n pathOfLeafShowing: viewInstanceShowing ? viewInstanceShowing.path : null,\\n // selectedPaths: pathShowing, //viewTree.getSelectedPaths(),\\n //only store data needed to rebuild the tree \\n state: tree.map(function(n) {\\n return {\\n\\t type: n.type,\\n\\t id: n.id,\\n\\t parentId: n.parentId,\\n\\t isFolder: n.isFolder,\\n\\t name: n.name,\\n\\t isOpen: n.isOpen,\\t\\n\\t state: n.state,\\n icon: n.icon\\n };\\n\\t\\t })\\n };\\n }\",\n \"function evaluateLightDOM() {\\n \\n // Light DOM is given as HTML string? => use fragment with HTML string as innerHTML\\n if ( typeof self.inner === 'string' ){\\n self.inner = document.createRange().createContextualFragment( self.inner );\\n }\\n \\n var children = ( self.inner || self.root ).children;\\n self.questions = [];\\n self.question_ids = [];\\n var count = 0;\\n \\n // iterate over all children of the Light DOM to search for config parameters\\n self.ccm.helper.makeIterable( children ).map( function ( elem ) {\\n count += 1;\\n\\n // self.ccm.helper.generateConfig( elem ); // ToDo\\n \\n if ( elem.tagName.startsWith('CCM-EXERCISE-') ){\\n var param_name = elem.tagName.split('-')[2].toLowerCase();\\n switch ( param_name ){\\n case 'question':\\n self.questions.push( elem.innerHTML );\\n self.question_ids.push( self.fkey + '_' + count );\\n self.html.main.inner.push( { tag: 'label', for: self.fkey + '_' + count, inner: elem.innerHTML } );\\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey + '_' + count } );\\n break;\\n default: self[ param_name ] = elem.innerHTML;\\n }\\n }\\n } );\\n \\n if ( self.questions.length === 0 ){\\n self.html.main.inner.push( { tag: 'label', for: self.fkey } );\\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey, placeholder: self.placeholder || '' } );\\n }\\n \\n self.html.main.inner.push( { tag: 'ccm-show_solutions', for: self.fkey } );\\n \\n }\",\n \"function Edit_GetHTMLTarget(eEvent, aData)\\n{\\n\\t//by default use ourselves\\n\\tvar result = this;\\n\\t//switch on event\\n\\tswitch (eEvent)\\n\\t{\\n\\t\\tcase __NEMESIS_EVENT_MATCHCODE:\\n\\t\\t\\t//our matchcode exist? and is visible? use it\\n\\t\\t\\tresult = this.STATES_MATCHCODE ? this.MATCHCODE : null;\\n\\t\\t\\tbreak;\\n\\t}\\n\\t//return it\\n\\treturn result;\\n}\",\n \"function getGridGetAction() {\\n var keys = $(\\\"div.grid-view\\\").find(\\\"div.keys\\\");\\n var getAction = '';\\n switch (keys.length) {\\n case 0:\\n alert('No gridview keys found');\\n getAction = '';\\n break;\\n case 1:\\n getAction = keys.attr('title');\\n break;\\n default:\\n alert('Mutiple gridview keys found');\\n getAction = '';\\n break;\\n }\\n \\n return getAction;\\n}\",\n \"function getHeaderGrid(dp,cellIndex){\\n\\treturn dp.obj.hdrLabels[cellIndex];\\n}\",\n \"get grid() {\\n return this._grid;\\n }\",\n \"function setGridState(visible, enabled) {\\n var gridContents = document.getElementsByClassName('grid-content');\\n var grid = document.getElementById('grid');\\n\\n if (enabled) {\\n grid.setAttribute('enabled', '');\\n } else {\\n grid.removeAttribute('enabled');\\n }\\n\\n for (var i = 0; i < gridContents.length; i++) {\\n if (!visible) {\\n gridContents[i].classList.add('invisible');\\n } else {\\n gridContents[i].classList.remove('invisible');\\n }\\n }\\n}\",\n \"function Simulator_Position_GetDisplayRect(html)\\n{\\n\\treturn Position_GetDisplayRect(html);\\n}\",\n \"function getGridString(cols, rows)\\n{\\n\\tvar tableMarkup = $(\\\"#drawing-table\\\").html();\\n\\tvar index = 0;\\n\\tvar result = \\\"\\\";\\n\\twhile(true)\\n\\t{\\n\\t\\tindex = tableMarkup.indexOf(\\\"\\\", index);\\n\\t\\tif (index == -1)\\n\\t\\t\\tbreak;\\n\\t\\tif (tableMarkup[index-1] == SYMB_AVAIL)\\n\\t\\t\\tresult += \\\"1\\\";\\n\\t\\telse\\n\\t\\t\\tresult += \\\"0\\\";\\n\\t\\tindex++;\\n\\t}\\n\\treturn result;\\n}\",\n \"function displayState(tab) {\\n $(\\\".grid\\\").empty();\\n for (let i = 0; i < tab.length; i++) {\\n for (let j = 0; j < tab[i].length; j++) {\\n const elem = tab[i][j];\\n if (elem) {\\n const item = $(`
${elem}
`);\\n $(\\\".grid\\\").append(item);\\n } else {\\n // if (leftMove == 1) {\\n // $(\\\".grid\\\").append(`
\\\"car\\\"
`);\\n // leftMove = 0\\n // } else if (rightMove == 1) {\\n // $(\\\".grid\\\").append(`
\\\"car\\\"
`);\\n // rightMove = 0\\n // } else {\\n $(\\\".grid\\\").append(`
\\\"DAVIDOU\\\"
`);\\n\\n // }\\n }\\n\\n }\\n }\\n}\",\n \"validateGridView() {\\n return this\\n .waitForElementVisible('@gridViewContainer')\\n .assert.elementPresent('@gridViewContainer', 'Grid View Displayed');\\n }\",\n \"function pagehtml(){\\treturn pageholder();}\",\n \"function IsDomCustomGrid(evt, element, eventOpts, objName, description, flavor, items)\\r\\n\\t{\\r\\n\\t\\tfunction _getName(el)\\r\\n\\t\\t{\\r\\n\\t\\t\\tvar name = __getAttribute(el, '');\\r\\n\\t\\t\\tif (name)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\treturn name;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\treturn \\\"Grid\\\";\\r\\n\\t\\t} \\r\\n \\r\\n\\t\\tfunction _getCell(el)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn {row: 0, col: 0};\\r\\n\\t\\t}\\r\\n\\t\\r\\n\\t\\tvar rvalue =\\r\\n\\t\\t{\\r\\n\\t\\t\\troot: null, // to define in future the most near element or smth else\\r\\n\\t\\t\\tresult: null, // here will be old res placed\\r\\n\\t\\t\\trcode: R_NOT_OBJECT // return code\\r\\n\\t\\t};\\r\\n\\t \\r\\n\\t\\tvar root = false;\\r\\n\\r\\n\\t\\t/**\\r\\n\\t\\t * Test element or it's neighbour nodes to detect type of an object we are dealing with.\\r\\n\\t\\t * Element API is described here: https://developer.mozilla.org/en-US/docs/Web/API/Element\\r\\n\\t\\t * API to use:\\r\\n\\t\\t *\\t__hasParentWithAttr(element, attributeName, regexp)\\r\\n\\t\\t * __getAttribute(element, attributeName);\\r\\n\\t\\t *\\r\\n\\t\\t */\\r\\n\\t\\tif(root=__hasParentWithAttr(element, '', //ig))\\r\\n\\t\\t{\\r\\n\\t\\t\\t// TODO\\r\\n\\t\\r\\n\\t\\t\\tvar res = {\\r\\n\\t\\t\\t\\tcancel: false,\\r\\n\\t\\t\\t\\tobject_flavor: 'Grid',\\r\\n\\t\\t\\t\\tobject_name: _getName(root),\\r\\n\\t\\t\\t\\tobject_type: 'DomCustomGrid',\\r\\n\\t\\t\\t\\tdescription: 'TODO Action description',\\r\\n\\t\\t\\t\\tlocator_data: \\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\txpath: SeS_GenerateXPath(root)\\r\\n\\t \\t\\t}\\r\\n\\t\\t\\t};\\r\\n\\t\\r\\n\\t\\t\\t// Learn\\r\\n\\t\\t\\trvalue.result = res;\\r\\n\\t\\t\\trvalue.root = root;\\r\\n\\t\\t\\trvalue.rcode = R_OBJECT_FOUND;\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tif(evt == \\\"resolveElementDescriptor\\\")\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tres.rect = __getElementRect(root);\\r\\n\\t\\t\\t\\tres.action = undefined;\\r\\n\\t\\t\\t\\treturn rvalue;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tif (evt == \\\"Click\\\")\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tvar cell = _getCell(element);\\r\\n\\t\\t\\t\\tif (cell)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tvar actionClick = {\\r\\n\\t\\t\\t\\t\\t\\t\\tname: \\\"ClickCell\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\tdescription: \\\"Click cell in a grid\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\tparams: [cell.row, cell.col]\\r\\n\\t\\t\\t\\t\\t\\t};\\t\\r\\n\\t\\t\\t\\t\\tres.action = actionClick;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\t\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t// Actions \\r\\n\\t\\t\\trvalue.rcode = R_ACTION_FOUND;\\r\\n\\t\\t}\\r\\n\\t\\t\\r\\n\\t\\treturn rvalue;\\r\\n\\t}\",\n \"GetGraphFromHTML() {\\n var mydiv = document.getElementById(\\\"mygraphdata\\\");\\n var graph_as_string = mydiv.innerHTML;\\n let graph = eval(graph_as_string);\\n return graph;\\n }\",\n \"htmlForStatus() {\\nvar html;\\n//----------\\nreturn html = `\\n\\nStatus:\\n\\n `;\\n}\",\n \"function social_curator_grid_post_loaded(data, element){}\",\n \"function getGridCellDev(grid, row, col)\\n{\\n // IGNORE IF IT'S OUTSIDE THE GRID\\n if (!isValidCellDev(row, col))\\n {\\n return -1;\\n }\\n var index = (row * gridWidthDev) + col;\\n return grid[index];\\n}\",\n \"generateGridRows() {\\n // Object to store the tiles\\n let grid_rows = []\\n let grid_ind = 1\\n // For each row\\n for (let row = 1; row <= 4; row++) {\\n let col_grids = []\\n //For each column\\n for (let col = 1; col <= 4; col++) {\\n // Referred to reactjs documentation for handle click\\n let id = grid_ind++\\n // To assign class based on state\\n // Useful for styling\\n let classVar = this.state.tileData[id]['status'] == 'hide' ? '' : 'tile-' + this.state.tileData[id]['status']\\n col_grids.push( {\\n this.handleClick(id)\\n }}>{this.state.tileData[id]['status'] != 'hide'\\n ? this.state.tileData[id]['letter'] : ''})\\n }\\n grid_rows.push({col_grids})\\n }\\n return grid_rows\\n }\",\n \"function loadGrid() {\\n \\n }\",\n \"function getTemplate(winNo) {\\n var str =\\n '
' +\\n '
' +\\n ' ' + VIS.Msg.getMsg(\\\"ViewMore\\\") + ' ' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n ' ' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n ' ' +\\n ' ' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n ' ' +\\n ' ' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n ' ' + VIS.Msg.getMsg(\\\"Add\\\") + ' ' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
' +\\n '
';\\n return str;\\n }\",\n \"_parseHTML(htmlString) {\\n //current xpath is body.div[i].table.tbody.tr[j].td[1-5]\\n let cleanedHtmlString = htmlString.replace(/(\\\\\\\\t|\\\\\\\\n|&nbsp;)/gi,'');\\n let root = htmlParser.parse(htmlString);\\n let divs = root.querySelectorAll('div');\\n if (divs) {\\n for (let div of divs) {\\n let table = div.querySelector('table');\\n if (!table) {\\n continue;\\n }\\n\\n let tbody = table.querySelector('tbody');\\n if (!tbody) {\\n continue;\\n }\\n\\n let rows = tbody.querySelectorAll('tr');\\n if (!rows) {\\n continue;\\n }\\n for (let row of rows) {\\n let cols = row.querySelectorAll('td');\\n //take 5 cols from here\\n this._data.add(cols[0].rawText, cols[1].rawText, cols[2].rawText, cols[4].rawText);\\n }\\n }\\n }\\n }\",\n \"getHTML() {\\n const l = this.strings.length - 1;\\n let html = '';\\n let isTextBinding = true;\\n for (let i = 0; i < l; i++) {\\n const s = this.strings[i];\\n html += s;\\n // We're in a text position if the previous string closed its tags.\\n // If it doesn't have any tags, then we use the previous text position\\n // state.\\n const closing = findTagClose(s);\\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\\n html += isTextBinding ? nodeMarker : marker;\\n }\\n html += this.strings[l];\\n return html;\\n }\",\n \"get cellTagName() {\\n return 'div';\\n }\",\n \"function lightCell(str){\\n if ( convertRow(str) <= countRows() && convertColumn(str) <= countColumns() ) {\\n return GRID[convertRow(str)][convertColumn(str)];\\n } else {\\n return false;\\n }\\n}\",\n \"function _getWebComponentsState() {\\r\\n // is mostly valid (css)\\r\\n //import feature is not always enabled\\r\\n const _imp = 'import' in document.createElement('link');\\r\\n const _tmp = !(document.createElement('template')\\r\\n instanceof HTMLUnknownElement);\\r\\n return Object.freeze({\\r\\n import: _imp,\\r\\n template: _tmp,\\r\\n isError: (!_imp || !_tmp)\\r\\n });\\r\\n }\",\n \"function gridMap() {\\n return {\\n top_left: { _cx_cy_index: 4, drag_index : [ 2, 3, 4 ] },\\n bottom_left: { _cx_cy_index : 3, drag_index : [ 1, 4, 3 ] },\\n top_right: { _cx_cy_index : 2, drag_index : [ 4, 1, 2 ] },\\n bottom_right: { _cx_cy_index : 1, drag_index : [ 3, 2, 1 ] }\\n };\\n }\",\n \"getGridColumnIndex(){return this.__gridColumnIndex}\",\n \"function Grid() {\\n /* public properties */\\n //是否能够多选行\\n this.multiple = true;\\n //排序列,内部用\\n this.sortCol = -1;\\n //降序排序\\n this.sortDescending = 0;\\n //错误信息\\n this.error = '';\\n //已选择的行数组\\n this.selectedRows = [];\\n //奇偶行是否用不同颜色显示,此开关打开时,添加删除行ie会自动关闭,原因目前不明\\n this.colorEvenRows = true;\\n //列是否允许调整宽度\\n this.resizeColumns = true;\\n //表体body列是否随表头head列的宽度实时调整列宽\\n this.bodyColResize = true;\\n //用户定义的对象变量名的字符串形式\\n this.selfName = '';\\n //是否排序开关\\n this.sortFlag = true;\\n //显示右键菜单\\n this.showMenu = false;\\n //是否能增减行,只控制键盘事件和右键菜单\\n this.addSubRow = false;\\n //序号的起始数\\n this.startNum = 1\\n //用户输入数据错误标志,\\n this.inputError = false;\\n //grid是否可编辑,该标志由程序更加html代码设置,用于对编辑快捷键的控制\\n this.editFlag = false;\\n //在grid最后一个编辑框失去焦点时,页面焦点聚到grid外的其他元素上\\n this.nextFocus = null;\\n //设置gird的高度为 maxViewRow行记录,不设置,默认高度按container高度走\\n this.maxViewRow = -1\\n //对gird的单元格统一加的累计宽度值\\n this.widthAddValue = 20;\\n //排序类型,数组,存放类型有'String','Number','None','Date','CaseInsensitiveString'\\n this.sortTypes =[];\\n //数据列的显示位置,页面用户将要排序的列序号(从0开始)作为数组传入,没有传入的列序号,将(通过把列宽置为0)被隐藏\\n //如:o.colPos=[0,4,3,2]\\n // o.colPos=[4,2,3,1]\\n // 注意:1.在o.bind(...)调用之前对此赋值,不需要排序和隐藏列的功能不要赋值此属性\\n // 2.列号一定要在 0 和 列数减一 之间,grid对此不校验,可能会出错。\\n this.colPos = [];\\n //添加行时,是否复制上一行的数据。ture-复制,false-不复制,默认false\\n this.isAddRowWithData=false;\\n //新增行时按照哪一行(首行或末行或选择的行的第一行)进行复制 (默认按首行复制)\\n // false -首行复制 ; true - 末行复制 ;null - 按选择行复制(如果选择多行,复制选择的第一行,没选择行 则复制首行)\\n //此参数在o.bind前后都可以设置。\\n this.isAddRowWithLast = false;\\n //在设置完只读单元格后,当前的编辑框是否下移到下一个可编辑框上,默认为移动\\n this.isMoveFocusAfterSetReadOnly = true;\\n //哪些列是多行select ,如:o.mutiSelectPos=[2,3]\\n this.mutiSelectPos = [];\\n\\n /* events */\\n this.onresize = null;\\n this.onsort = null;\\n this.onselect = null;\\n this.onAddRow = null;\\n this.onRemoveRow = null;\\n this.onGridBlur = null; //Grid失去焦点时触发函数, Added by likey, Date: 2006-04-20\\n\\n\\n /* private properties */\\n //Container容器\\n this._eCont = null;\\n //Head 容器\\n this._eHead = null;\\n //left 容器\\n this._eLeft = null;\\n //body 容器\\n this._eBody = null;\\n //head 表格\\n this._eHeadTable = null;\\n //left 表格\\n this._eLeftTable = null;\\n //body 表格\\n this._eBodyTable = null;\\n //head 列集合\\n this._eHeadCols = null;\\n //暂时为1列\\n this._eLeftCols = null;\\n //body 的列集合\\n this._eBodyCols = null;\\n //用于调整Left行高\\n this._eBodyRows = null;\\n\\n //当前处于编辑状态的单元格\\n this._eEditTd = null;\\n //第一个可编辑td\\n this._eFistEditTd = null;\\n //内部用的全局变量,用于左右键移动单元格的递归函数调用中\\n this.__tempTd = null;\\n //上次施动者td\\n this._preLinkerTd = null;\\n\\n //右键菜单\\n this._eMenu = null;\\n\\n this._eDataTable = null;\\n //保存列的一些设置数据信息的数组\\n this._eDataCols = null;\\n\\n this._activeHeaders = null;\\n this._rows = 0;\\n this._cols = 0;\\n\\n this._defaultLeftWidth = 40;\\n\\n}\",\n \"function stateCheck() {\\n var stateLog = document.querySelector(\\\".state\\\");\\n var state = response.regionName;\\n console.log(state);\\n\\n stateLog.innerHTML += state;\\n }\",\n \"function getPopupFormState()\\n {\\n var state = new Object();\\n var elms;\\n if(isParameterizedPopup && popupFormName!=null)\\n elms = popupFormName.elements;\\n else\\n elms = popupDiv.getElementsByTagName(\\\"*\\\");\\n var len = elms.length;\\n for (var i = 0; i < len; i++)\\n {\\n var element = elms[i];\\n //bug18449628 \\n if (element && element.tagName != \\\"IMG\\\")\\n {\\n var name = element.name;\\n if (name)\\n {\\n // Skip over hidden values\\n var elmType = element.type;\\n if (!elmType || (elmType != 'hidden'))\\n state[name] = _getValue(element);\\n }\\n }\\n }\\n return state;\\n }\",\n \"getState(board){\\r\\n return this.fenToArray(this.game.fen())\\r\\n }\",\n \"function saveState(){\\n var grid = gridState();\\n var state = {grid:grid};\\n state.level = $('#level').val();\\n state.variant = options.variant;\\n $.bbq.pushState(state);\\n }\",\n \"function _getElements() {\\n\\tif(_store){\\n if (_isSubpageOpened()) {\\n return _store.getState().secondLevelPage.elements;\\n }\\n return _store.getState().elements;\\n\\t}\\n }\",\n \"function getStateFromUi() {\\n \\n var state = {\\n tab: getSelectedTab(),\\n selectedPeriodOffset: getSelectedPeriodOffset(),\\n selectedGroup: getSelectedGroup(),\\n selectedIndividual: getSelectedIndividual()\\n };\\n \\n if(state.selectedIndividual !== null) {\\n state.mode = MODE.INDIVIDUAL;\\n } else if(state.selectedIndividual === null && state.selectedGroup !== null) {\\n state.mode = MODE.GROUP;\\n } else {\\n state.mode = MODE.FLEET;\\n }\\n \\n return state;\\n }\",\n \"function getDeviceState() {\\n var state = window.getComputedStyle(\\n document.querySelector('.state-indicator'), ':before'\\n ).getPropertyValue('content')\\n\\n state = state.replace(/\\\"/g, \\\"\\\");\\n state = state.replace(/'/g, \\\"\\\"); //fix for update in chrome which returns ''\\n\\n return state; //need to replace quotes to support mozilla - which returns a string with quotes inside.\\n\\n}\",\n \"function generateGrid() {\\n gameBoard.childNodes[1].innerText = `It's ${game.turn.token}'s turn`;\\n var grid = gameBoard.childNodes[3];\\n grid.innerHTML = '';\\n for (var i = 0; i < 9; i++) {\\n gridIndex = i;\\n grid.innerHTML += `\\n
\\n
\\n `\\n }\\n game.resetGame();\\n persistWins();\\n}\",\n \"function createGrid() {\\n let board = document.getElementById(\\\"board\\\");\\n let tableHTML = \\\"\\\";\\n for (let r = 0; r < height; r++) {\\n let currentArrayRow = [];\\n let currentHTMLRow = ``;\\n for (let c = 0; c < width; c++) {\\n let newNodeId = `${r}-${c}`;\\n let newNodeClass = \\\"unvisited\\\";\\n currentHTMLRow += ``;\\n }\\n currentHTMLRow += ``;\\n tableHTML += currentHTMLRow;\\n }\\n board.innerHTML = tableHTML;\\n}\",\n \"function getStates(game) {\\n\\n}\",\n \"function draw_grid_html(grid,n,id){\\n var html = ''\\n var grid_center = grid[(grid.length-1)/2];\\n html += '
Grid build of '+ n + ' blocks with center ' + grid_center + ' blocks high
';\\n html += '
['+ grid.toString() + '] = ' + grid.reduce(function(a,b){return a+b;}) + ' blocks
';\\n html += '
'\\n for(var x = 0; x < grid.length; x++){\\n var column = '
';\\n for (var b=1; b <= grid[x]; b++){\\n column += '
';\\n }\\n column +='
';\\n html += column;\\n }\\n html += '
';\\n document.getElementById(id).innerHTML = html;\\n\\n return html;\\n}\",\n \"function renderGrid() {\\n let { C, cols, rows, px, grid_color, render_border } = state\\n C.gx.clearRect(\\n -render_border,\\n -render_border,\\n C.gx.canvas.width,\\n C.gx.canvas.height\\n )\\n C.gx.strokeStyle = grid_color\\n C.gx.lineWidth = 1\\n C.gx.strokeRect(0.5, 0.5, sub(mul(cols, px), 1), sub(mul(rows, px), 1))\\n C.gx.lineWidth = 2\\n for (let c = 1; c < state.cols; c++) {\\n C.gx.beginPath()\\n C.gx.moveTo(mul(c, px), 0)\\n C.gx.lineTo(mul(c, px), mul(rows, px))\\n C.gx.stroke()\\n }\\n for (let r = 1; r < state.rows; r++) {\\n C.gx.beginPath()\\n C.gx.moveTo(0, mul(r, px))\\n C.gx.lineTo(mul(cols, px), mul(r, px))\\n C.gx.stroke()\\n }\\n}\",\n \"getHTML() {\\n const l = this.strings.length - 1;\\n let html = '';\\n let isTextBinding = true;\\n for (let i = 0; i < l; i++) {\\n const s = this.strings[i];\\n html += s;\\n // We're in a text position if the previous string closed its tags.\\n // If it doesn't have any tags, then we use the previous text position\\n // state.\\n const closing = findTagClose(s);\\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\\n html += isTextBinding ? nodeMarker : marker;\\n }\\n html += this.strings[l];\\n return html;\\n }\",\n \"getRow(n) {\\n return this.grid[n];\\n }\",\n \"function renderGrid(grid) {\\r\\n let modules = grid.modules;\\r\\n let svg = document.getElementById('root');\\r\\n let i;\\r\\n\\r\\n for (i = 0; i < modules.length; i++) {\\r\\n svg.appendChild(createModule(modules[i], svg.namespaceURI));\\r\\n }\\r\\n}\",\n \"_parseContent(item) {\\n const textFieldClass = this.getCSS(this._data.mode, \\\"textField\\\");\\n return item.querySelector(`.${textFieldClass}`).innerHTML;\\n }\",\n \"async getSingleMarkup() {\\n return ` \\n
\\n

${this.name}

\\n \\n
\\n
\\n
\\n
\\n ${window.Core.checkFirstBreadcrumb()} > \\n ${this.name}\\n
\\n
\\n

${window.Core.t(\\\"country\\\")}${this.country}

\\n

${window.Core.t(\\\"nickname\\\")}${this.nickname}

\\n
\\n
\\n \\n
\\n
\\n

${window.Core.t(\\\"visithotelsheader\\\")}

\\n
`;\\n }\",\n \"function getState() {\\n return window.stokr.model.getState();\\n }\",\n \"function getCurrentBoard(){\\n\\t\\t\\tvar $rows = $el.find('.panel-row');\\n\\t\\t\\tvar currentBoard = [];\\n\\t\\t\\t\\n\\t\\t\\t$.each( $rows, function(){\\n\\t\\t\\t\\tvar $row = $(this);\\n\\t\\t\\t\\tvar $panels = $row.find('.top .stationary-panel span');\\n\\t\\t\\t\\tvar panelVals = [];\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t$.each( $panels, function(){\\n\\t\\t\\t\\t\\tvar $panel = $(this);\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tpanelVals.push( $panel.text() );\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tcurrentBoard.push( panelVals );\\n\\t\\t\\t});\\n\\t\\t\\t\\n\\t\\t\\treturn currentBoard;\\n\\t\\t}\",\n \"function displayWinState() {\\n // Set the win state styling on all of the cells\\n $('.content').addClass('winstate');\\n // Make the win state div visible\\n $('#solved').removeClass('hidden');\\n }\",\n \"function $3gv(){\\n var readyStateDone$=new $3gv.$$;ReadyState(4,readyStateDone$);\\n return readyStateDone$;\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6115273","0.5874661","0.5821485","0.5768903","0.5744697","0.57446486","0.5667717","0.5627815","0.5625856","0.55612373","0.5547919","0.54730815","0.5395059","0.53842986","0.5363936","0.5337135","0.53354484","0.5299901","0.52846044","0.52349216","0.52164143","0.5214967","0.5207256","0.51944715","0.5186086","0.5181298","0.5152873","0.51385415","0.5117867","0.5110878","0.50963235","0.506584","0.5059069","0.5054729","0.50518936","0.50391144","0.5035484","0.50307393","0.49407017","0.49399582","0.49229738","0.49126834","0.49084532","0.49034274","0.48847023","0.4879218","0.48758888","0.48531014","0.48430118","0.483426","0.48283967","0.4815245","0.48109084","0.48071927","0.48065916","0.4803267","0.48010173","0.4800265","0.47917172","0.47847798","0.4784675","0.4776392","0.47545776","0.4745077","0.47450468","0.4740537","0.47347835","0.47315022","0.47274947","0.47188166","0.4711711","0.47050765","0.47004396","0.46976703","0.46959013","0.46931154","0.46866855","0.46856898","0.46855694","0.46839434","0.4676958","0.46725163","0.46544728","0.46494946","0.46428958","0.4638598","0.46360683","0.46345854","0.46323818","0.46310177","0.46305767","0.4627041","0.46246287","0.462108","0.46113282","0.4607924","0.46050745","0.4601773","0.45988986","0.45954642"],"string":"[\n \"0.6115273\",\n \"0.5874661\",\n \"0.5821485\",\n \"0.5768903\",\n \"0.5744697\",\n \"0.57446486\",\n \"0.5667717\",\n \"0.5627815\",\n \"0.5625856\",\n \"0.55612373\",\n \"0.5547919\",\n \"0.54730815\",\n \"0.5395059\",\n \"0.53842986\",\n \"0.5363936\",\n \"0.5337135\",\n \"0.53354484\",\n \"0.5299901\",\n \"0.52846044\",\n \"0.52349216\",\n \"0.52164143\",\n \"0.5214967\",\n \"0.5207256\",\n \"0.51944715\",\n \"0.5186086\",\n \"0.5181298\",\n \"0.5152873\",\n \"0.51385415\",\n \"0.5117867\",\n \"0.5110878\",\n \"0.50963235\",\n \"0.506584\",\n \"0.5059069\",\n \"0.5054729\",\n \"0.50518936\",\n \"0.50391144\",\n \"0.5035484\",\n \"0.50307393\",\n \"0.49407017\",\n \"0.49399582\",\n \"0.49229738\",\n \"0.49126834\",\n \"0.49084532\",\n \"0.49034274\",\n \"0.48847023\",\n \"0.4879218\",\n \"0.48758888\",\n \"0.48531014\",\n \"0.48430118\",\n \"0.483426\",\n \"0.48283967\",\n \"0.4815245\",\n \"0.48109084\",\n \"0.48071927\",\n \"0.48065916\",\n \"0.4803267\",\n \"0.48010173\",\n \"0.4800265\",\n \"0.47917172\",\n \"0.47847798\",\n \"0.4784675\",\n \"0.4776392\",\n \"0.47545776\",\n \"0.4745077\",\n \"0.47450468\",\n \"0.4740537\",\n \"0.47347835\",\n \"0.47315022\",\n \"0.47274947\",\n \"0.47188166\",\n \"0.4711711\",\n \"0.47050765\",\n \"0.47004396\",\n \"0.46976703\",\n \"0.46959013\",\n \"0.46931154\",\n \"0.46866855\",\n \"0.46856898\",\n \"0.46855694\",\n \"0.46839434\",\n \"0.4676958\",\n \"0.46725163\",\n \"0.46544728\",\n \"0.46494946\",\n \"0.46428958\",\n \"0.4638598\",\n \"0.46360683\",\n \"0.46345854\",\n \"0.46323818\",\n \"0.46310177\",\n \"0.46305767\",\n \"0.4627041\",\n \"0.46246287\",\n \"0.462108\",\n \"0.46113282\",\n \"0.4607924\",\n \"0.46050745\",\n \"0.4601773\",\n \"0.45988986\",\n \"0.45954642\"\n]"},"document_score":{"kind":"string","value":"0.57623345"},"document_rank":{"kind":"string","value":"4"}}},{"rowIdx":32,"cells":{"query":{"kind":"string","value":"(only applicable to raw and normal forms)"},"document":{"kind":"string","value":"showError(message){\n\t\t\n\t\tthis.setState({ message: message });\n\t\tthis.setState({ loggedIn: false });\n\t\tthis.setState({ messageclass: 'alert alert-danger' });\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":["set Raw(value) {}","get Raw() {}","function Raw(){}","get raw() { return this._raw; }","get raw() { return this._raw; }","callSite(values, raw) {\n\n values.raw = raw || values;\n return values;\n }","protected internal function m252() {}","get normalized() {}","async normalize () {\n\t}","function normal() {}","get type() {\n return 'raw';\n }","set normal(value) {}","set normal(value) {}","_encodeObject(object) {\n return object.termType === 'Literal' ? this._encodeLiteral(object) : this._encodeIriOrBlank(object);\n }","function customHandling() { }","set normalized(value) {}","transient private protected internal function m182() {}","function Surrogate(){}","function Surrogate(){}","function Surrogate(){}","get Normal() {}","transient protected internal function m189() {}","static getRawObject(data) {\n if (data && typeof data.toObject === 'function') {\n return data.toObject();\n }\n return data;\n }","getRawInput(start, end) {\n\t\t\treturn this.input.slice(start.valueOf(), end.valueOf());\n\t\t}","get normal() {}","get normal() {}","function Bind_Oliteral() {\r\n}","function r(e){return\"string\"==typeof e}","function r(e){return\"string\"==typeof e}","function set_raw(env) {\n\tenv._cmeta.raw = true;\n}","function Surrogate() {}","private public function m246() {}","function notValid_anySimpleType(strObj) {\n\treturn false;\n }","function validDataFormat(raw_data) {\n return true;\n }","function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }","function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }","set Normal(value) {}","transient private internal function m185() {}","function handle_entity( raw ) {\n raw = _.isObject( raw ) ? raw : {}\n \n if( raw.entity$ ) {\n return seneca.make$( raw )\n }\n else {\n _.each( raw, function(v,k) {\n if( _.isObject(v) && v.entity$ ) {\n raw[k] = seneca.make$( v )\n }\n })\n return raw\n }\n }","static get sanitize() {\n return {\n title: false,\n text: {\n br: true,\n a: { href: true },\n b: true,\n i: true,\n },\n action: false,\n link: false,\n }\n }","function inflateRaw(input,options){options=options||{};options.raw=true;return inflate$1(input,options);}","function Bind_A_Oliteral() {\r\n}","function freezeRaw(raw) {\n if (Array.isArray(raw)) {\n return Array.prototype.slice.call(raw);\n }\n return raw;\n }","transient final protected internal function m174() {}","raw() {\n return this.data;\n }","formatToPrimitive(entity, args) {\n // optimize entities which are simple strings by skipping resultion\n if (typeof entity === 'string') {\n return [entity, []];\n }\n\n // optimize entities with null values and no default traits\n if (!entity.val && entity.traits && !(entity.traits.some(t => t.def))) {\n return [null, []];\n }\n\n const result = format(this, args, entity, optsPrimitive);\n return (result[0] instanceof FTLNone) ?\n [null, result[1]] : result;\n }","obtain(){}","function VIEWAS_boring_default(obj) {\n //tabulator.log.debug(\"entered VIEWAS_boring_default...\");\n var rep; //representation in html\n\n if (obj.termType == 'literal')\n {\n var styles = { 'integer': 'text-align: right;',\n 'decimal': 'text-align: \".\";',\n 'double' : 'text-align: \".\";',\n };\n rep = myDocument.createElement('span');\n rep.textContent = obj.value;\n // Newlines have effect and overlong lines wrapped automatically\n var style = '';\n if (obj.datatype && obj.datatype.uri) {\n var xsd = tabulator.ns.xsd('').uri;\n if (obj.datatype.uri.slice(0, xsd.length) == xsd)\n style = styles[obj.datatype.uri.slice(xsd.length)];\n }\n rep.setAttribute('style', style ? style : 'white-space: pre-wrap;');\n\n } else if (obj.termType == 'symbol' || obj.termType == 'bnode') {\n rep = myDocument.createElement('span');\n rep.setAttribute('about', obj.toNT());\n thisOutline.appendAccessIcons(kb, rep, obj);\n\n if (obj.termType == 'symbol') {\n if (obj.uri.slice(0,4) == 'tel:') {\n var num = obj.uri.slice(4);\n var anchor = myDocument.createElement('a');\n rep.appendChild(myDocument.createTextNode(num));\n anchor.setAttribute('href', obj.uri);\n anchor.appendChild(tabulator.Util.AJARImage(tabulator.Icon.src.icon_telephone,\n 'phone', 'phone '+num,myDocument))\n rep.appendChild(anchor);\n anchor.firstChild.setAttribute('class', 'phoneIcon');\n } else { // not tel:\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\n }\n } else { // bnode\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\n }\n } else if (obj.termType=='collection'){\n // obj.elements is an array of the elements in the collection\n rep = myDocument.createElement('table');\n rep.setAttribute('about', obj.toNT());\n /* Not sure which looks best -- with or without. I think without\n\n var tr = rep.appendChild(document.createElement('tr'));\n tr.appendChild(document.createTextNode(\n obj.elements.length ? '(' + obj.elements.length+')' : '(none)'));\n */\n for (var i=0; i decode(input).mapLeft(Error).unsafeCoerce(),\r\n schema: schema !== null && schema !== void 0 ? schema : (() => ({}))\r\n };\r\n }","function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}","function w(e) {\n var t = C(e);\n switch (t) {\n case \"array\":\n case \"object\":\n return \"an \" + t;\n\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + t;\n\n default:\n return t;\n }\n }","function processRaw(raw, type, lastModified, cb) {\n var json;\n try {\n switch (type.slice(0, 1)) {\n case 'x':\n // json = xml2json.toJson(raw, { object: true, coerce: true, trim: true, sanitize: false, reversible: true });\n break;\n case 'h':\n\n xray(raw, 'li.shopBrandItem', [{\n name: 'a',\n url: 'a@href',\n }])\n (function(err, data) {\n if (err) {\n console.log('Error: ' + err);\n } else {\n // console.log(data);\n json = data;\n }\n });\n\n break;\n case 'j':\n json = JSON.parse(raw);\n break;\n default:\n json = {\n text: '' + raw\n };\n }\n } catch (e) {\n return cb(tidyError(e));\n }\n\n cb(null, json, lastModified || 0);\n }","get interpretation () {\r\n\t\treturn this._interpretation;\r\n\t}","function oi(a){this.Of=a;this.rg=\"\"}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","function PlatForm() {}","function stringRepresentation(value) {\n switch (value[0]) {\n case \"Num\": \n\treturn getNumValue(value);\n case \"Clo\":\n\treturn;\n }\n}","function s(e){return e}","process(raw_item) {\n return raw_item;\n }","function isRaw(cell) {\n return cell.cell_type === 'raw';\n }","function w(e) {\n var t = C(e);\n switch (t) {\n case \"array\":\n case \"object\":\n return \"an \" + t;\n\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + t;\n\n default:\n return t;\n }\n }","function nonvalidatedObject() {\n var str = gAppState.checkValue(\"objectID\", \"objectID2\");\n\n if (regexp.test(str) && !isBlankNode(str)) {\n return '<' + str + '>'; // Case: input is a uri. Solution: quote it\n } else if (str.charAt(0) == \"#\") {\n return '<' + str + '>'; // Case: input is an unquoted relative uri. Solution: quote it\n } else if (str.charAt(0) == '<' && str.charAt(1) == '#' && str.charAt(str.length - 1) == '>') {\n return str; // Case: input is already a relative uri. Solution: return it as is\n } else if (str.includes(\":\") || str.includes(\"<#\")) {\n return str; // Case: input is a curie. Solution: return it as is\n } else if (str.charAt(0) == \"?\") {\n return str; // checks if input is a variable for deletion\n } else if (str.charAt(0) == '<' && str.charAt(str.length - 1) == '>') {\n var newStr = str.slice(1, -1); // Case: input is quoted uri. Solution: must be unquotted to be recognize as a uri by regexp\n return nonvalidatedObject(newStr);\n } else if (str.includes('\"') || str.includes(\"'\") || str.indexOf(' ') >= 0) {\n return formatLiteral(str); // Case: input is a quoted literal value\n } else if (isBlankNode(str)) {\n return str; // Case : blank node\n }\n else {\n return ':' + str; // Case: input is not a uri or a blank node. Solution: make it a relative uri\n }\n}","normalize( node ){\n var clone = node || this.DOM.input, //.cloneNode(true),\n v = [];\n\n // when a text was pasted in FF, the \"this.DOM.input\" element will have
but no newline symbols (\\n), and this will\n // result in tags not being properly created if one wishes to create a separate tag per newline.\n clone.childNodes.forEach(n => n.nodeType==3 && v.push(n.nodeValue))\n v = v.join(\"\\n\")\n\n try{\n // \"delimiters\" might be of a non-regex value, where this will fail (\"Tags With Properties\" example in demo page):\n v = v.replace(/(?:\\r\\n|\\r|\\n)/g, this.settings.delimiters.source.charAt(0))\n }\n catch(err){}\n\n v = v.replace(/\\s/g, ' ') // replace NBSPs with spaces characters\n\n return this.trim(v)\n }","toObject() { throw new Error('virtual function called') }","function If_bound_literal_literal() {\r\n}","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }"],"string":"[\n \"set Raw(value) {}\",\n \"get Raw() {}\",\n \"function Raw(){}\",\n \"get raw() { return this._raw; }\",\n \"get raw() { return this._raw; }\",\n \"callSite(values, raw) {\\n\\n values.raw = raw || values;\\n return values;\\n }\",\n \"protected internal function m252() {}\",\n \"get normalized() {}\",\n \"async normalize () {\\n\\t}\",\n \"function normal() {}\",\n \"get type() {\\n return 'raw';\\n }\",\n \"set normal(value) {}\",\n \"set normal(value) {}\",\n \"_encodeObject(object) {\\n return object.termType === 'Literal' ? this._encodeLiteral(object) : this._encodeIriOrBlank(object);\\n }\",\n \"function customHandling() { }\",\n \"set normalized(value) {}\",\n \"transient private protected internal function m182() {}\",\n \"function Surrogate(){}\",\n \"function Surrogate(){}\",\n \"function Surrogate(){}\",\n \"get Normal() {}\",\n \"transient protected internal function m189() {}\",\n \"static getRawObject(data) {\\n if (data && typeof data.toObject === 'function') {\\n return data.toObject();\\n }\\n return data;\\n }\",\n \"getRawInput(start, end) {\\n\\t\\t\\treturn this.input.slice(start.valueOf(), end.valueOf());\\n\\t\\t}\",\n \"get normal() {}\",\n \"get normal() {}\",\n \"function Bind_Oliteral() {\\r\\n}\",\n \"function r(e){return\\\"string\\\"==typeof e}\",\n \"function r(e){return\\\"string\\\"==typeof e}\",\n \"function set_raw(env) {\\n\\tenv._cmeta.raw = true;\\n}\",\n \"function Surrogate() {}\",\n \"private public function m246() {}\",\n \"function notValid_anySimpleType(strObj) {\\n\\treturn false;\\n }\",\n \"function validDataFormat(raw_data) {\\n return true;\\n }\",\n \"function decodeRaw(value, position) {\\n return entities(value, {\\n position: normalize(position),\\n warning: handleWarning\\n });\\n }\",\n \"function decodeRaw(value, position) {\\n return entities(value, {\\n position: normalize(position),\\n warning: handleWarning\\n });\\n }\",\n \"set Normal(value) {}\",\n \"transient private internal function m185() {}\",\n \"function handle_entity( raw ) {\\n raw = _.isObject( raw ) ? raw : {}\\n \\n if( raw.entity$ ) {\\n return seneca.make$( raw )\\n }\\n else {\\n _.each( raw, function(v,k) {\\n if( _.isObject(v) && v.entity$ ) {\\n raw[k] = seneca.make$( v )\\n }\\n })\\n return raw\\n }\\n }\",\n \"static get sanitize() {\\n return {\\n title: false,\\n text: {\\n br: true,\\n a: { href: true },\\n b: true,\\n i: true,\\n },\\n action: false,\\n link: false,\\n }\\n }\",\n \"function inflateRaw(input,options){options=options||{};options.raw=true;return inflate$1(input,options);}\",\n \"function Bind_A_Oliteral() {\\r\\n}\",\n \"function freezeRaw(raw) {\\n if (Array.isArray(raw)) {\\n return Array.prototype.slice.call(raw);\\n }\\n return raw;\\n }\",\n \"transient final protected internal function m174() {}\",\n \"raw() {\\n return this.data;\\n }\",\n \"formatToPrimitive(entity, args) {\\n // optimize entities which are simple strings by skipping resultion\\n if (typeof entity === 'string') {\\n return [entity, []];\\n }\\n\\n // optimize entities with null values and no default traits\\n if (!entity.val && entity.traits && !(entity.traits.some(t => t.def))) {\\n return [null, []];\\n }\\n\\n const result = format(this, args, entity, optsPrimitive);\\n return (result[0] instanceof FTLNone) ?\\n [null, result[1]] : result;\\n }\",\n \"obtain(){}\",\n \"function VIEWAS_boring_default(obj) {\\n //tabulator.log.debug(\\\"entered VIEWAS_boring_default...\\\");\\n var rep; //representation in html\\n\\n if (obj.termType == 'literal')\\n {\\n var styles = { 'integer': 'text-align: right;',\\n 'decimal': 'text-align: \\\".\\\";',\\n 'double' : 'text-align: \\\".\\\";',\\n };\\n rep = myDocument.createElement('span');\\n rep.textContent = obj.value;\\n // Newlines have effect and overlong lines wrapped automatically\\n var style = '';\\n if (obj.datatype && obj.datatype.uri) {\\n var xsd = tabulator.ns.xsd('').uri;\\n if (obj.datatype.uri.slice(0, xsd.length) == xsd)\\n style = styles[obj.datatype.uri.slice(xsd.length)];\\n }\\n rep.setAttribute('style', style ? style : 'white-space: pre-wrap;');\\n\\n } else if (obj.termType == 'symbol' || obj.termType == 'bnode') {\\n rep = myDocument.createElement('span');\\n rep.setAttribute('about', obj.toNT());\\n thisOutline.appendAccessIcons(kb, rep, obj);\\n\\n if (obj.termType == 'symbol') {\\n if (obj.uri.slice(0,4) == 'tel:') {\\n var num = obj.uri.slice(4);\\n var anchor = myDocument.createElement('a');\\n rep.appendChild(myDocument.createTextNode(num));\\n anchor.setAttribute('href', obj.uri);\\n anchor.appendChild(tabulator.Util.AJARImage(tabulator.Icon.src.icon_telephone,\\n 'phone', 'phone '+num,myDocument))\\n rep.appendChild(anchor);\\n anchor.firstChild.setAttribute('class', 'phoneIcon');\\n } else { // not tel:\\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\\n }\\n } else { // bnode\\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\\n }\\n } else if (obj.termType=='collection'){\\n // obj.elements is an array of the elements in the collection\\n rep = myDocument.createElement('table');\\n rep.setAttribute('about', obj.toNT());\\n /* Not sure which looks best -- with or without. I think without\\n\\n var tr = rep.appendChild(document.createElement('tr'));\\n tr.appendChild(document.createTextNode(\\n obj.elements.length ? '(' + obj.elements.length+')' : '(none)'));\\n */\\n for (var i=0; i decode(input).mapLeft(Error).unsafeCoerce(),\\r\\n schema: schema !== null && schema !== void 0 ? schema : (() => ({}))\\r\\n };\\r\\n }\",\n \"function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\\n\\tif (!additionalAttr) additionalAttr = [];\\n\\tif (!blackListedAttr) blackListedAttr = [];\\n\\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\\n}\",\n \"function w(e) {\\n var t = C(e);\\n switch (t) {\\n case \\\"array\\\":\\n case \\\"object\\\":\\n return \\\"an \\\" + t;\\n\\n case \\\"boolean\\\":\\n case \\\"date\\\":\\n case \\\"regexp\\\":\\n return \\\"a \\\" + t;\\n\\n default:\\n return t;\\n }\\n }\",\n \"function processRaw(raw, type, lastModified, cb) {\\n var json;\\n try {\\n switch (type.slice(0, 1)) {\\n case 'x':\\n // json = xml2json.toJson(raw, { object: true, coerce: true, trim: true, sanitize: false, reversible: true });\\n break;\\n case 'h':\\n\\n xray(raw, 'li.shopBrandItem', [{\\n name: 'a',\\n url: 'a@href',\\n }])\\n (function(err, data) {\\n if (err) {\\n console.log('Error: ' + err);\\n } else {\\n // console.log(data);\\n json = data;\\n }\\n });\\n\\n break;\\n case 'j':\\n json = JSON.parse(raw);\\n break;\\n default:\\n json = {\\n text: '' + raw\\n };\\n }\\n } catch (e) {\\n return cb(tidyError(e));\\n }\\n\\n cb(null, json, lastModified || 0);\\n }\",\n \"get interpretation () {\\r\\n\\t\\treturn this._interpretation;\\r\\n\\t}\",\n \"function oi(a){this.Of=a;this.rg=\\\"\\\"}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"function PlatForm() {}\",\n \"function stringRepresentation(value) {\\n switch (value[0]) {\\n case \\\"Num\\\": \\n\\treturn getNumValue(value);\\n case \\\"Clo\\\":\\n\\treturn;\\n }\\n}\",\n \"function s(e){return e}\",\n \"process(raw_item) {\\n return raw_item;\\n }\",\n \"function isRaw(cell) {\\n return cell.cell_type === 'raw';\\n }\",\n \"function w(e) {\\n var t = C(e);\\n switch (t) {\\n case \\\"array\\\":\\n case \\\"object\\\":\\n return \\\"an \\\" + t;\\n\\n case \\\"boolean\\\":\\n case \\\"date\\\":\\n case \\\"regexp\\\":\\n return \\\"a \\\" + t;\\n\\n default:\\n return t;\\n }\\n }\",\n \"function nonvalidatedObject() {\\n var str = gAppState.checkValue(\\\"objectID\\\", \\\"objectID2\\\");\\n\\n if (regexp.test(str) && !isBlankNode(str)) {\\n return '<' + str + '>'; // Case: input is a uri. Solution: quote it\\n } else if (str.charAt(0) == \\\"#\\\") {\\n return '<' + str + '>'; // Case: input is an unquoted relative uri. Solution: quote it\\n } else if (str.charAt(0) == '<' && str.charAt(1) == '#' && str.charAt(str.length - 1) == '>') {\\n return str; // Case: input is already a relative uri. Solution: return it as is\\n } else if (str.includes(\\\":\\\") || str.includes(\\\"<#\\\")) {\\n return str; // Case: input is a curie. Solution: return it as is\\n } else if (str.charAt(0) == \\\"?\\\") {\\n return str; // checks if input is a variable for deletion\\n } else if (str.charAt(0) == '<' && str.charAt(str.length - 1) == '>') {\\n var newStr = str.slice(1, -1); // Case: input is quoted uri. Solution: must be unquotted to be recognize as a uri by regexp\\n return nonvalidatedObject(newStr);\\n } else if (str.includes('\\\"') || str.includes(\\\"'\\\") || str.indexOf(' ') >= 0) {\\n return formatLiteral(str); // Case: input is a quoted literal value\\n } else if (isBlankNode(str)) {\\n return str; // Case : blank node\\n }\\n else {\\n return ':' + str; // Case: input is not a uri or a blank node. Solution: make it a relative uri\\n }\\n}\",\n \"normalize( node ){\\n var clone = node || this.DOM.input, //.cloneNode(true),\\n v = [];\\n\\n // when a text was pasted in FF, the \\\"this.DOM.input\\\" element will have
but no newline symbols (\\\\n), and this will\\n // result in tags not being properly created if one wishes to create a separate tag per newline.\\n clone.childNodes.forEach(n => n.nodeType==3 && v.push(n.nodeValue))\\n v = v.join(\\\"\\\\n\\\")\\n\\n try{\\n // \\\"delimiters\\\" might be of a non-regex value, where this will fail (\\\"Tags With Properties\\\" example in demo page):\\n v = v.replace(/(?:\\\\r\\\\n|\\\\r|\\\\n)/g, this.settings.delimiters.source.charAt(0))\\n }\\n catch(err){}\\n\\n v = v.replace(/\\\\s/g, ' ') // replace NBSPs with spaces characters\\n\\n return this.trim(v)\\n }\",\n \"toObject() { throw new Error('virtual function called') }\",\n \"function If_bound_literal_literal() {\\r\\n}\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.6127074","0.60859853","0.6042301","0.59349465","0.59349465","0.5480133","0.5360717","0.52917254","0.52516854","0.52384514","0.5226667","0.51880723","0.51880723","0.509369","0.5085544","0.5026419","0.50058883","0.5000224","0.5000224","0.5000224","0.4956932","0.4956258","0.49322712","0.49296835","0.4922578","0.4922578","0.48932296","0.4868307","0.4868307","0.4864497","0.48508164","0.4850324","0.48481762","0.4832611","0.482476","0.482476","0.48177245","0.47992194","0.4799078","0.4794765","0.4786253","0.47777787","0.47686103","0.47667104","0.47633514","0.47504666","0.47497502","0.4739698","0.47318769","0.47211438","0.4707584","0.47063422","0.46980357","0.46980307","0.46911046","0.4684859","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.46775782","0.46771067","0.4675192","0.46502492","0.46488026","0.4648426","0.46379325","0.46356246","0.46332482","0.46270555","0.46210107","0.46210107","0.46210107","0.46210107"],"string":"[\n \"0.6127074\",\n \"0.60859853\",\n \"0.6042301\",\n \"0.59349465\",\n \"0.59349465\",\n \"0.5480133\",\n \"0.5360717\",\n \"0.52917254\",\n \"0.52516854\",\n \"0.52384514\",\n \"0.5226667\",\n \"0.51880723\",\n \"0.51880723\",\n \"0.509369\",\n \"0.5085544\",\n \"0.5026419\",\n \"0.50058883\",\n \"0.5000224\",\n \"0.5000224\",\n \"0.5000224\",\n \"0.4956932\",\n \"0.4956258\",\n \"0.49322712\",\n \"0.49296835\",\n \"0.4922578\",\n \"0.4922578\",\n \"0.48932296\",\n \"0.4868307\",\n \"0.4868307\",\n \"0.4864497\",\n \"0.48508164\",\n \"0.4850324\",\n \"0.48481762\",\n \"0.4832611\",\n \"0.482476\",\n \"0.482476\",\n \"0.48177245\",\n \"0.47992194\",\n \"0.4799078\",\n \"0.4794765\",\n \"0.4786253\",\n \"0.47777787\",\n \"0.47686103\",\n \"0.47667104\",\n \"0.47633514\",\n \"0.47504666\",\n \"0.47497502\",\n \"0.4739698\",\n \"0.47318769\",\n \"0.47211438\",\n \"0.4707584\",\n \"0.47063422\",\n \"0.46980357\",\n \"0.46980307\",\n \"0.46911046\",\n \"0.4684859\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.46775782\",\n \"0.46771067\",\n \"0.4675192\",\n \"0.46502492\",\n \"0.46488026\",\n \"0.4648426\",\n \"0.46379325\",\n \"0.46356246\",\n \"0.46332482\",\n \"0.46270555\",\n \"0.46210107\",\n \"0.46210107\",\n \"0.46210107\",\n \"0.46210107\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":33,"cells":{"query":{"kind":"string","value":"Function to create circles with different positions and velocities"},"document":{"kind":"string","value":"function create_circle() {\n\t\t//Random Position\n\t\tthis.x = Math.random()*W;\n\t\tthis.y = Math.random()*H;\n\t\t\n\t\t//Random Velocities\n\t\tthis.vx = 0.1+Math.random()*1;\n\t\tthis.vy = -this.vx;\n\t\t\n\t\t//Random Radius\n\t\tthis.r = 10 + Math.random()*50;\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 createCircles() {\n \n \tconst dTheta = 0.5*2.43;\n \n \tlet c1 = new OrthoganalCircle(0,dTheta);\n \tlet c2 = new OrthoganalCircle(TWO_PI/3,dTheta);\n \tlet c3 = new OrthoganalCircle(2*TWO_PI/3,dTheta);\n\n \tcircles = [c1,c2,c3]; \n \n}","createCircle() {\n const particle = [];\n\n for (let i = 0; i < this.numParticles; i++) {\n const color = this.colors[~~(Particles.rand(0, this.colors.length))];\n\n particle[i] = {\n radius: Particles.rand(this.minRadius, this.maxRadius),\n xPos: Particles.rand(0, this.canvas.width),\n yPos: Particles.rand(0, this.canvas.height),\n xVelocity: Particles.rand(this.minSpeed, this.maxSpeed),\n yVelocity: Particles.rand(this.minSpeed, this.maxSpeed),\n color: 'rgba(' + color + ',' + Particles.rand(this.minOpacity, this.maxOpacity) + ')'\n }\n\n //once values are determined, draw particle on canvas\n this.draw(particle, i);\n }\n //...and once drawn, animate the particle\n this.animate(particle);\n }","function Circle(position, move, color) {\nthis.position = createVector(position.x, position.y);\nthis.speed = createVector(move.x, move.y);\nthis.move2 = random(0);\nthis.life = 200;\n}","function Circle(x, y) {\r\n this.position = createVector(x, y); // Position of the circles\r\n this.getColor = floor(random(360)); // Random color of the circles. floor() rounds the random number down to the closest int.\r\n this.speed = random(-1, -3); // Randomized speed that only goes up\r\n this.sway = random(-2, 2); // An experimental speed for the x position, wasn't used in the end\r\n this.d = random(25,100); // The size of the circles is random\r\n\r\n this.show = function() {\r\n if(startCol == 0) {\r\n fill(this.getColor, 100, 100); // Fills with a random color\r\n this.getColor+=colorSpeed; // The color will change over time\r\n\r\n\t\t\tif (this.getColor >= 360) {\r\n\t\t\t\tthis.getColor = 0;\r\n\t\t\t}\r\n }\r\n\r\n this.move = function() {\r\n this.position.y += this.speed; // The random speed for the Circle\r\n //this.position.x += this.sway; // If this is activated the circles will go in directions other than straight\r\n }\r\n\r\n ellipse(this.position.x, this.position.y, this.d, this.d); // The circles are drawn\r\n }\r\n}","function CreateCircle(x, y, radius, option, rate) {\n return Matter.Bodies.circle(x * rate, y * rate, radius * rate, option);\n}","function setupCircles(){\n\n var delay=0;\n var i = 0;\n for(var radius=canvasDiagonalFromCenter; radius>0; radius-=10){\n var circle = new Circle(radius, 0*Math.PI + i , 2*Math.PI + i ,0,0,delay,inputSpeed,inputAcceleration);\n circles.push(circle);\n delay+=delayIncrements;\n i+= 0.3*Math.PI;\n }\n drawAndUpdateCircles();\n}","function Circles(x, y, size)\r\n{\r\n this.x = x;\r\n this.y = y;\r\n this.size = size;\r\n this.shape = 'circle';\r\n}","function circle(x,y,xVel,yVel,r,m)\n{\n\tthis.x=x;\n\tthis.y=y;\n\tthis.xVel=xVel;\n\tthis.yVel=yVel;\n\tthis.mass=m;\n\tthis.r=r;\n\t\n\tthis.moveSpeed=2;\n\n}","function buildCircleScene() {\n var posOrig = new THREE.Vector2(0, 0, 0); \n var posTarget = new THREE.Vector2(0, 0, 0); \n var num = sceneData.nAgents;\n var radius = 4;\n\n positionsArray = new Array();\n\n for (var i = 0; i < num; i++) {\n // circle shape\n var theta = 2*M_PI/num * i;\n var xLoc = radius * Math.cos(theta);\n var zLoc = radius * Math.sin(theta);\n var xLocDest = radius * Math.cos(theta + M_PI);\n var zLocDest = radius * Math.sin(theta + M_PI);\n\n posOrig = new THREE.Vector3(xLoc, zLoc);\n posTarget = new THREE.Vector3(xLocDest, zLocDest);\n\n positionsArray.push(posOrig);\n positionsArray.push(posTarget);\n }\n}","function drawCircles() {\n for (var i = 0; i < numCircles; i++) {\n var randomX = Math.round(-100 + Math.random() * 704);\n var randomY = Math.round(-100 + Math.random() * 528);\n var speed = 1 + Math.random() * 3;\n var size = 1 + Math.random() * circleSize;\n\n var circle = new Circle(speed, size, randomX, randomY);\n circles.push(circle);\n }\n update();\n }","function addCircles(num){\r\n\tfor(var i=0; i 0 && arguments[0] !== undefined ? arguments[0] : 0.0;var centerY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.0;var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DefaultStyle.clone();var tessSegments = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;_classCallCheck(this, Circle);\n _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, style));\n\n _this6.polygon = new Polygon([], style);\n\n // Force polygon.id to be the same, so that its geometry is associated with this Circle.\n // This is a bit hacky, but can be removed as soon as we use native arcs for circle rendering.\n _this6.polygon.id = _this6.id;\n\n _this6.centerX = centerX;\n _this6.centerY = centerY;\n _this6.radius = radius;\n _this6.tessSegments = tessSegments;\n\n _this6.needsUpdate = true;return _this6;\n }","function circle(self, xpos, ypos, radius) {\n let positions = [];\n let deltas = bfsDeltas[radius];\n let deltaLength = deltas.length;\n for (let k = 0; k < deltaLength; k++) {\n \n let nx = xpos + deltas[k][0];\n let ny = ypos + deltas[k][1];\n //self.log(`circle xy: ${xpos}, ${ypos}; NEW: ${nx}, ${ny}`);\n if (inArr(nx,ny, self.map)){\n positions.push([nx,ny]);\n }\n }\n return positions;\n}","function createCircle(radius) {\n return {\n radius,\n draw: function () {}\n }\n}","function createCircle(cx, cy, radius) {\n let a1 = new Arc();\n a1.startX = cx + radius;\n a1.startY = cy;\n a1.endX = cx - radius;\n a1.endY = cy;\n a1.radiusX = radius;\n a1.radiusY = radius;\n\n let a2 = new Arc();\n a2.startX = cx - radius;\n a2.startY = cy;\n a2.endX = cx + radius;\n a2.endY = cy;\n a2.radiusX = radius;\n a2.radiusY = radius;\n\n return [a1, a2];\n}","function addNewCircle() {\n\n // circles can expose in 3 position,\n // bottom-left corner, bottom-right corner and bottom center.\n const entrances = [\"bottomRight\", \"bottomCenter\", \"bottomLeft\"];\n // I take one of entrances randomly as target entrance\n const targetEntrance = entrances[rndNum(entrances.length, 0, true)];\n\n // we have 5 different gradient to give each\n // circle a different appearance. each item\n // in below array has colors and offset of gradient.\n const possibleGradients = [\n [\n [0, \"rgba(238,31,148,0.14)\"],\n [1, \"rgba(238,31,148,0)\"]\n ],\n [\n [0, \"rgba(213,136,1,.2)\"],\n [1, \"rgba(213,136,1,0)\"]\n ],\n [\n [.5, \"rgba(213,136,1,.2)\"],\n [1, \"rgba(213,136,1,0)\"]\n ],\n [\n [.7, \"rgba(255,254,255,0.07)\"],\n [1, \"rgba(255,254,255,0)\"]\n ],\n [\n [.8, \"rgba(255,254,255,0.05)\"],\n [.9, \"rgba(255,254,255,0)\"]\n ]\n ];\n // I take one of gradients details as target gradient details\n const targetGrd = possibleGradients[rndNum(possibleGradients.length, 0, true)];\n\n // each circle should have a radius. and it will be\n // a random number between three and four quarters of canvas-min side\n const radius = rndNum(canvasMin / 3, canvasMin / 4);\n\n // this will push the created Circle to the circles array\n circles.push(new Circle(targetEntrance, radius, targetGrd))\n}","function createCircle(x,y)\n{\n\t//each segment of the circle is its own circle svg, placed in an array\n\tvar donuts = new Array(9)\n\t\n\t//loop through the array\n\tfor (var i=0;i<9;i++){\n\t\tdonuts[i]=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");\n\t\tdonuts[i].setAttributeNS(null,\"id\",\"d\".concat(i.toString()));\n\t\tdonuts[i].setAttributeNS(null,\"cx\",parseInt(x));\n donuts[i].setAttributeNS(null,\"cy\",parseInt(y));\n\t\tdonuts[i].setAttributeNS(null,\"fill\",\"transparent\");\n\t\tdonuts[i].setAttributeNS(null,\"stroke-width\",3);\n\t\t//each ring of circles has different radius values, and dash-array values\n\t\t//dash array defines what percentage of a full circle is being drawn\n\t\t//for example the inner circle has a radius of 15.91549, 2*pi*15.91549\n\t\t//gives a circumfrence of 100 pixels for the circle, so defining the dasharray as 31 69 means that 31% of 100 pixels is drawn, and 69% is transparent.\n\t\tif (i<3){\n\t\t\t\t\tdonuts[i].setAttributeNS(null,\"r\",15.91549);\n\t\t\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"31 69\");\n\t\t}\n\t\t//middle ring\n\t\telse if (i<6){\n\t\t\tdonuts[i].setAttributeNS(null,\"r\",19.853);\n\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"39.185019 85.555059\");\n\t\t}\n\t\t//outer ring\n\t\telse{\n\t\t\tdonuts[i].setAttributeNS(null,\"r\",23.76852);\n\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"47.335504 102.006512\");\n\t\t}\n\t\t//each point is added to the points SVGs, use insertBefore so that it is drawn below the points rather than above, which allows for click events to still occur\n\t\t document.getElementById(\"points\").insertBefore(donuts[i],document.getElementById(\"points\").childNodes.item(0));\n\t}\n\t//each point has its own colour, dash offset and class. Dash offset is how far from the starting point (top of the circle) to begin drawing the segment\n\t//each class relates to a different css animation because each animation has a different starting point. Animations are defined in component.css\ndonuts[0].setAttributeNS(null,\"stroke-dashoffset\",\"58.33333\" );\n\t\t\t\t\t\tdonuts[0].setAttributeNS(null,\"class\",\"spin1\");\ndonuts[1].setAttributeNS(null,\"stroke-dashoffset\",\"25\");\n\t\t\t\t\t\t\tdonuts[1].setAttributeNS(null,\"class\",\"spin2\");\ndonuts[2].setAttributeNS(null,\"stroke-dashoffset\",\"91.66667\" );\n\t\t\t\t\t\t\tdonuts[2].setAttributeNS(null,\"class\",\"spin3\");\ndonuts[3].setAttributeNS(null,\"stroke-dashoffset\",\"41.18502\" );\n\tdonuts[3].setAttributeNS(null,\"class\",\"spin4\");\ndonuts[4].setAttributeNS(null,\"stroke-dashoffset\",\"82.76505\" );\n\tdonuts[4].setAttributeNS(null,\"class\",\"spin5\");\ndonuts[5].setAttributeNS(null,\"stroke-dashoffset\",\"124.34508\");\n\tdonuts[5].setAttributeNS(null,\"class\",\"spin6\");\ndonuts[6].setAttributeNS(null,\"stroke-dashoffset\",\"56.3355\");\n\tdonuts[6].setAttributeNS(null,\"class\",\"spin7\");\ndonuts[7].setAttributeNS(null,\"stroke-dashoffset\",\"106.11618\");\n\tdonuts[7].setAttributeNS(null,\"class\",\"spin8\");\ndonuts[8].setAttributeNS(null,\"stroke-dashoffset\",\"155.89685\");\n\tdonuts[8].setAttributeNS(null,\"class\",\"spin9\");\ndonuts[0].setAttributeNS(null,\"stroke\",\"#115D6B\");\ndonuts[1].setAttributeNS(null,\"stroke\",\"#D90981\");\ndonuts[2].setAttributeNS(null,\"stroke\",\"#4A3485\");\ndonuts[3].setAttributeNS(null,\"stroke\",\"#F51424\");\ndonuts[4].setAttributeNS(null,\"stroke\",\"#0BA599\");\ndonuts[5].setAttributeNS(null,\"stroke\",\"#1077B5\");\ndonuts[6].setAttributeNS(null,\"stroke\",\"#FA893D\");\ndonuts[7].setAttributeNS(null,\"stroke\",\"#87C537\");\ndonuts[8].setAttributeNS(null,\"stroke\",\"#02B3EE\");\n}","function circle(x, y, px, py) {\n //this is the speed part making the size be determined by speed of mouse\n var distance = abs(x-px) + abs(y-py);\n stroke(r, g, b);\n strokeWeight(2);\n //first set of variables for bigger circle\n r = random(255);\n g = random(255);\n b = random(255);\n\n//second set of colours so the inner circle is different colour or else it is the same\n r2 = random(255);\n g2 = random(255);\n b2 = random(255);\n //this is the big circle\n fill(r, g, b);\n ellipse(x, y, distance, distance);\n //this is the smaller inner circle\n fill(r2, g2, b2);\n ellipse(x, y, distance/2, distance/2);\n}","function drawCircle(radius, x, y) { svg.append(\"circle\").attr(\"fill\", \"red\").attr(\"r\", radius).attr(\"cx\", x).attr(\"cy\", y); }","static createCircle(x, y, radius, numSides = -1) {\n return new Ellipse(x, y, radius, radius, numSides)\n }","function createCircle(radius){\n return{\n radius,\n draw (){\n console.log('draw');\n }\n };\n\n }","function OrthoganalCircle(theta,dTheta) {\n \n \tlet R = 1.0/cos(dTheta);\n this.r = abs(tan(dTheta));\n // this.x = R*cos(theta);\n // this.y = R*sin(theta);\n \t//endpoints\n \tthis.p1 = createVector(cos(theta-dTheta),sin(theta-dTheta));\n this.p2 = createVector(cos(theta+dTheta),sin(theta+dTheta));\n \n \tthis.center = createVector(R*cos(theta),R*sin(theta));\n \tthis.containsPoint = function(p){\n \t\n \treturn this.center.dist(p) < this.r;\n };\n \t\n \n \t/*\n \tCircle inversion. Swaps points inside the circle with points outside the circle. Like a refection in a line in hyperbolic space.\n */\n \tthis.invert = function(p){ \n \t\n \n \tlet op = this.center.dist(p);\n \n \tlet oq = this.r*this.r/op;\n \t\n \tlet dq = p5.Vector.sub(p,this.center).normalize().mult(oq);\n \t\n \treturn p5.Vector.add(this.center,dq);\n };\n \n \tthis.draw = function(graphics) {\n //Draw the arc\n let v1 = p5.Vector.sub(this.p1,this.center);\n let v2 = p5.Vector.sub(this.p2,this.center);\n \n let theta1 = v1.heading();\n let theta2 = v2.heading();\n \n let i = ii(this.center.x);\n let j = jj(this.center.y);\n \n graphics.arc(i,j, this.r*width,this.r*height ,theta2,theta1)\n }\n \n this.drawAnchors = function(graphics) {\n graphics.ellipse(ii(this.p1.x),jj(this.p1.y),4,4); \n graphics.ellipse(ii(this.p2.x),jj(this.p2.y),4,4); \n }\n}","_createRandomCircles2(options) {\n let { n, filled, stroke, colours, minRadius, maxRadius, acceleration, friction, dx, dy } = options;\n minRadius = minRadius ? minRadius : this.MIN_RADIUS;\n maxRadius = maxRadius ? maxRadius : this.MAX_RADIUS;\n dx = dx === undefined ? 2 : dx;\n dy = dy === undefined ? 10 : dy;\n\n for (let i = 0; i < n; i++) {\n const radius = randomIntFromRange(minRadius, maxRadius);\n const x = randomIntFromRange(radius, this.canvas.width - radius);\n const y = randomIntFromRange(0, this.canvas.height / 2);\n const colour = randomColour(colours);\n const dx_ = randomIntFromRange(-dx, dx);\n const dy_ = randomIntFromRange(-dy, dy);\n this.makeCircle({ x, y, dx: dx_, dy: dy_, colour, radius, filled, gravity: true, acceleration, friction, stroke })\n }\n\n }","constructor({colorCode, context, x, y, radius, percentFromCenter}) {\n this.circles = [];\n this.percentFromCenter = percentFromCenter;\n\n if (Math.abs(this.percentFromCenter) < 0.01) {\n this.circles.push(new ColorCircle({\n x: 0,\n y: 0,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: colorCode.getComponent('R'),\n green: colorCode.getComponent('G'),\n blue: colorCode.getComponent('B')\n }),\n context\n }));\n }\n else {\n // Add red circle in bottom left position\n this.circles.push(new ColorCircle({\n x: x - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: colorCode.getComponent('R'),\n green: 0,\n blue: 0,\n }),\n context\n }));\n // Add green circle in top position\n this.circles.push(new ColorCircle({\n x: x,\n y: y + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: 0,\n green: colorCode.getComponent('G'),\n blue: 0,\n }),\n context\n }));\n // Add blue circle in bottom right position\n this.circles.push(new ColorCircle({\n x: x + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: 0,\n green: 0,\n blue: colorCode.getComponent('B'),\n }),\n context\n }));\n }\n }","function Circle(speed, width, xPos, yPos) {\n this.speed = speed\n this.width = width\n this.xPos = xPos\n this.yPos = yPos\n this.dx = Math.floor(Math.random() * 2) + 1\n this.dy = Math.floor(Math.random() * 2) + 1\n this.opacity = 0.05 + Math.random() * 0.5;\n this.isEaten = false\n this.color = colors[Math.floor(Math.random() * numColors - 1)]\n\n }","function Circle(x, y, dx, dy, radius) {\n this.x = x;\n this.y = y;\n // Step 4\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n // Step 8 Add Color\n this.colors = [\"#16a085\", \"#e74c3c\", \"#34495e\"];\n\n // Step 3 Add Draw Function\n this.draw = function() {\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n // Step 8 Add Color\n c.strokeStyle = \"blue\";\n // c.strokeStyle = this.colors[Math.floor(Math.random() * 3)];\n c.stroke();\n // c.fillStyle = this.colors[Math.floor(Math.random() * 3)];\n };\n\n // Step 4 Update / Create Animation\n // Add dx, dy, radius\n this.update = function() {\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\n this.dx = -this.dx;\n }\n\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n\n this.x += this.dx;\n this.y += this.dy;\n\n // Step 5 add draw\n this.draw();\n };\n}","function Circle(x, y, dx, dy, radius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n \n // FUNCTION FOR DRAWING NEW CIRCLE\n this.draw = function() {\n context.beginPath();\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n context.fillStyle = circleBodyColor;\n context.strokeStyle = circleLineColor;\n context.stroke();\n context.fill();\n }\n\n // FUNCTION WITH LOGIC FOR MOVEMENT OF THE CIRCLES\n this.update = function() {\n // MOVING CIRCLES LEFT AND RIGHT\n if (this.x + this.radius + 1 > innerWidth || this.x - this.radius < 0 ) {\n this.dx = -this.dx;\n }\n\n // MOVING CIRCLE UP AND DOWN\n if (this.y + this.radius + 1 > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n \n // AFTER MOVEMENT IS UPDATED, DRAW EVERYTHING AGAIN\n this.draw();\n }\n}","function drawCircles() {\n canvasContext.fillStyle = 'white';\n canvasContext.fillRect(0, 0, xMax, yMax);\n\n for (let i = 0; i < particles.length; i++) {\n let r = particles[i].circleShape.radius;\n canvasContext.drawImage(\n particleImages[r],\n particles[i].position[0] - r + (xMax / 2),\n particles[i].position[1] - r + (yMax / 2)\n );\n }\n\n for (let i = 0; i < circles.length; i++) {\n canvasContext.save();\n\n canvasContext.lineWidth = LINE_WIDTH;\n canvasContext.strokeStyle = colors[i];\n\n canvasContext.beginPath();\n\n canvasContext.arc(\n circles[i].position[0] + (xMax / 2),\n circles[i].position[1] + (yMax / 2),\n circles[i].circleShape.radius,\n 0,\n Math.PI * 2\n );\n canvasContext.stroke();\n canvasContext.fill();\n\n canvasContext.restore();\n }\n }","function Circle(x, y, vx, vy, r, growth) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.r = r;\n this.color = canvasColors[0];\n this.alpha = 1;\n\n this.draw = function() {\n contextCanvas.beginPath();\n contextCanvas.strokeStyle = this.color.replace('x', + this.alpha);\n contextCanvas.arc(this.x, this.y, this.r, Math.PI * 2, false);\n contextCanvas.lineWidth = 2;\n contextCanvas.stroke();\n contextCanvas.fillStyle = 'transparent';\n contextCanvas.fill();\n }\n\n this.update = function() {\n this.x += this.vx;\n this.y += this.vy;\n this.alpha -= 0.015;\n this.r += growth;\n this.draw();\n }\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n },\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n },\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n }\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n }\n };\n}","constructor(x, y, radius) {\n super(createVector(x, y));\n this.x = x;\n this.y = y;\n this.radius = radius;\n this.setShape();\n this.fixtureType = \"circle\";\n\n }","function circlePoint(x, y, r, type, force, exceptions) {\n elipsePoint(x, y, r, r, type, force, exceptions);\n }","constructor(x, y, radius, color, xspeed, yspeed) {\n this.x = x;\n this.y = y;\n this.radius = radius;\n this.color = color;\n this.xspeed = xspeed;\n this.yspeed = yspeed;\n }","function Circle (x, y, dx, dy, radius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n\n // Create a nameless function\n this.draw = function() {\n context.beginPath();\n // arc(x, y, radius: Int, startAngle: float, endAngle: float, drawCounterClockwise: bool)\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n context.strokeStyle = ' #000000';\n //context.strokeStyle = '#'+Math.floor(Math.random()*16777215).toString(16);\n context. stroke();\n }\n\n this.update = function() {\n if( this.x + this.radius > innerWidth || this.x - this.radius < 0 ) {\n this.dx = -this.dx;\n }\n \n if( this.y + this.radius > innerHeight || this.y - this.radius < 0 ) {\n this.dy = -this.dy;\n }\n \n this.x += this.dx;\n this.y += this.dy;\n\n this.draw();\n }\n}","function calculateCircle(c1, c2, c3, properties, pathIndex, level)\n{\t\n\tcalCount++;\n\t\n\tvar k1 = properties.k1;\n\tvar k2 = properties.k2;\n\tvar k3 = properties.k3;\n\tvar k4 = properties.k4;\n\t\n\tvar z4 = mRC((1/k4), aCC(aCC(aCC(mRC(k1, c1._origin), mRC(k2, c2._origin)), mRC(k3, c3._origin)), mRC(2, sqrtC(aCC(aCC(mRC(k1*k2, mCC(c1._origin, c2._origin)), mRC(k2*k3, mCC(c2._origin, c3._origin))), mRC(k1*k3, mCC(c1._origin, c3._origin)))))));\n\tvar tangencyList = [c1, c2, c3];\n\tvar circ = new Circle(z4, 1/k4, c1.id + pathIndex, tangencyList, c1, level+1, \"#FFFFFF\", false);\n\t\n\treturn circ;\n}","function Circle(x,y,dx,dy,radius){\n //independent x&y values\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n\n//creating a method within an object to create a circle every time this function is called anonymous function\n this.draw = function() {\n //console.log('hello there');\n //arc //circle\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI*2, false);\n c.strokeStyle = 'pink';\n c.stroke();\n c.fill();\n}\n\nthis.update = function() {\n //moving circle by 1px --> x += 1;\n\n if(this.x + this.radius > innerWidth ||\n this.x - this.radius < 0){\n this. dx = -this.dx;\n }\n if(this.y + this.radius > innerHeight ||\n this.y - this.radius < 0){\n this.dy = -this.dy;\n }\n this.x += this.dx; \n this.y += this.dy;\n\n this.draw();\n }\n}","function Circle () {\n /**\n * Radius of circle\n * @type Ray3d\n */\n this.fRadius = 0.0;\n /**\n * Point of center\n * @type Float32Array\n */\n this.v2fCenter = null;\n\n switch (arguments.length) {\n case 0:\n this.v2fCenter = Vec2.create();\n break;\n case 1:\n this.v2fCenter = Vec2.create(arguments[0].v2fCenter);\n this.fRadius = arguments[0].fRadius;\n break;\n case 2:\n this.v2fCenter = Vec2.create(arguments[0]);\n this.fRadius = arguments[1];\n break;\n case 3:\n this.v2fCenter = Vec2.create();\n this.v2fCenter.X = arguments[0];\n this.v2fCenter.Y = arguments[1];\n this.fRadius = arguments[2];\n break;\n }\n ;\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log('draw');\n }\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log('draw');\n }\n };\n}","function Circle(x, y, dx, dy, radius, color) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.color = color;\n\n\n this.draw = function(){\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n c.fillStyle = this.color;\n c.fill();\n c.closePath();\n }\n\n\n//****movement and edges\n this.update = function(){\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0){\n this.dx = -this.dx;\n }\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0){\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n\n this.draw();\n }\n}","function drawDonut() {\n for (let i = 0; i <= 360; i += angleStep) {\n let x = width * sin(i);\n let y = height * cos(i);\n let z = 0;\n let center = { x, y, z };\n circlesVertices.push(createCircleVertices(center, i, 1));\n }\n drawVertices();\n}","function drawTarget() {\n let circleSize = 400;\n \n //draw circles of decreasing size\n for (let i = 0; i < NUM_CIRC; i++) {\n ellipse(X_POS, Y_POS, circleSize, circleSize);\n circleSize -= 40;\n }\n}","function CircleMethods() {\n const origin = [0, 0];\n const pointA = [10, 20];\n const pointB = [20, 0];\n const pointC = [-15, -15];\n\n const radius = 20;\n\n const circleMethod1 = new makerjs.paths.Circle(radius);\n const circleMethod2 = new makerjs.paths.Circle(origin, radius);\n const circleMethod3 = new makerjs.paths.Circle(pointA, pointB);\n const circleMethod4 = new makerjs.paths.Circle(pointA, pointB, pointC);\n\n this.paths = {\n circleMethod1,\n circleMethod2,\n circleMethod3,\n circleMethod4,\n };\n}","function walkingCircle() {\n addCircle(150, \"green\");\n addCircle(300, \"blue\");\n addCircle(600, \"purple\");\n addCircle(searchRadius, \"black\");\n}","drawCircle () {\n const context = this.canvas.getContext('2d')\n const [x, y] = this.center\n const radius = this.size / 2\n\n for (let angle = 0; angle <= 360; angle++) {\n const startAngle = (angle - 2) * Math.PI / 180\n const endAngle = angle * Math.PI / 180\n context.beginPath()\n context.moveTo(x, y)\n context.arc(x, y, radius, startAngle, endAngle)\n context.closePath()\n context.fillStyle = 'hsl(' + angle + ', 100%, 50%)'\n context.fill()\n }\n }","function createCircle(radius){\n return {\n // radius <-----> radius = radius\n radius,\n draw(){\n console.log('draw');\n }\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(draw);\n }\n };\n}","function circle(a, b, x, r) {\n for (var i = 0; i < x; i++) {\n ctx.moveTo(r*a*Math.cos(i*2*Math.PI/x), r*b*Math.sin(i*2*Math.PI/x));\n ctx.lineTo(r*a*Math.cos((i+1)*2*Math.PI/x), r*b*Math.sin((i+1)*2*Math.PI/x));\n ctx.stroke();\n }\n }","drawCircle(ctx, _x_loc, _y_loc, _radius, _speed_vector){\n ctx.beginPath();\n ctx.arc(_x_loc, _y_loc, _radius, 0, 2*Math.PI);\n if (_speed_vector < 4)\n ctx.fillStyle = \"#B6FF33\";\n else if (_speed_vector < 8)\n ctx.fillStyle = \"#FF9900\";\n else{\n ctx.fillStyle = ctx.createPattern(document.getElementById(\"ball\"), \"repeat\");\n }\n ctx.fill();\n\n }","circle() {\n const context = GameState.current;\n\n Helper.strewnSprite(\n Helper.getMember(GroupPool.circle().members),\n { y: context.game.stage.height },\n { y: 2 },\n (sprite) => {\n this._tweenOfCircle(context, sprite);\n }\n );\n }","function createCircleAnimation(cords) {\n\tvar xy = cords.x + 'px ' + cords.y + 'px';\n\t$.keyframe.define([{\n\t\tname: 'circle-in',\n\t\tfrom: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\n\t\tto: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\n\t}]);\n\t$.keyframe.define([{\n\t\tname: 'circle-out',\n\t\tfrom: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\n\t\tto: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\n\t}]);\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n }\n };\n}","function Circle(x, y, dx, dy, radius, r, g, b) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.minRadius = radius;\n this.r = r;\n this.g = g;\n this.b = b;\n this.color = colorArray[Math.floor(Math.random() * colorArray.length)]\n\n this.draw = function () {\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n // c.strokeStyle = `rgb(${r}, ${g}, ${b})`;\n // c.fillStyle = `rgb(${r}, ${g}, ${b})`;\n c.fillStyle = this.color\n // c.stroke();\n c.fill();\n }\n this.update = function () {\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\n this.dx = -this.dx;\n }\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n\n\n //INTERACTIVITY portion\n if (mouse.x - this.x < 50 \n && mouse.x - this.x > -50\n && mouse.y - this.y < 50 \n && mouse.y - this.y > -50) {\n if (this.radius < maxRadius) {\n this.radius += 1;\n }\n } else if (this.radius > this.minRadius) {\n this.radius -= 1;\n }\n\n this.draw();\n }\n}","function circle(x,y,radius) { \n ctx.beginPath();\n ctx.arc(x, y, radius,0, 2*Math.PI);\n ctx.fill();\n ctx.stroke();\n}","function circlePath (pathX, pathY, x, y, r, s)\n{\n // Compute the number of steps given the speed\n let nSteps = 2 * Math.PI * r / s;\n // Clear the current path\n pathX.length = 0;\n pathY.length = 0;\n // Add points to the path uniformly along a circle\n for (let i = 0; i < nSteps; i ++)\n {\n pathX[i] = x + r * Math.sin(i * s / r);\n pathY[i] = y + r * Math.cos(i * s / r);\n }\n}","function shapes() {\n for (x = -1; x <= (width / 100) + 1; x++) {\n for (y = -1; y <= (height / 100) + 1; y++) {\n // Checks if the object is moving right or left\n if (posX) {\n // Checks if the object is moving up or down\n if (posY) {\n // Object creation in the Right and Down direction\n if (createCircles) {\n ellipse((x * 100) + w, (y * 100) + z, 50, 50);\n } else {\n rect((x * 100) + w, (y * 100) + z, 45, 45);\n }\n // The else of the up/down check\n } else {\n // Object creation in the right and Up direction\n if (createCircles) {\n ellipse((x * 100) + w, (y * 100) - z, 50, 50);\n } else {\n rect((x * 100) + w, (y * 100) - z, 45, 45);\n }\n }\n // The else of the right/left check\n } else {\n if (posY) {\n // Object creation in the left and Down direction\n if (createCircles) {\n ellipse((x * 100) - w, (y * 100) + z, 50, 50);\n } else {\n rect((x * 100) - w, (y * 100) + z, 45, 45);\n }\n } else {\n // Object creation in the left and Up direction\n if (createCircles) {\n ellipse((x * 100) - w, (y * 100) - z, 50, 50);\n } else {\n rect((x * 100) - w, (y * 100) - z, 45, 45);\n }\n }\n }\n }\n }\n}","animateCircles() {\n requestAnimationFrame(this.animateCircles.bind(this));\n this.clearCanvas();\n this.circles.forEach(circle => circle.update({\n mouse_x: this.mouse.x,\n mouse_y: this.mouse.y,\n range: this.mouse.range,\n particles: this.circles\n }));\n }","function drawCircle(x,y,radius,color)\r\n{\r\n\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\r\n}","function createCircle(radius) {\n //Object Template\n const circle = {\n radius,\n draw() {\n console.log('Draw ' + radius);\n }\n }\n\n return circle;\n}","function generate_circles(){\n\t\t\tvar timerHasStarted = false; // reset the timer, don't start until after the circles are done being generated\n\t\t\tctx.clearRect(0, 0, window.innerWidth, window.innerHeight); // ensure no past canvas features are remaining\n\n\t\t\tright_circs = gen_right_centers()\n\t\t\tfor(var i=0; i < right_circs.length; i++){\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(right_circs[i].x, right_circs[i].y, r2, 0 ,2*Math.PI);\n\t\t\t\t\tctx.fillStyle = trial.circle_color;\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tctx.closePath();\n\t\t\t}\n\n\t\t\tleft_circs = gen_left_centers()\n\t\t\tfor(var i=0; i < left_circs.length; i++){\n\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(left_circs[i].x, left_circs[i].y, r1, 0 ,2*Math.PI);\n\t\t\t\t\tctx.fillStyle = trial.circle_color;\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tctx.closePath();\n\t\t\t}\n\n\t\t\tstartKeyboardListener();\n\t\t\tjsPsych.pluginAPI.setTimeout(function() {\n end_trial();\n \t\t}, trial.trial_duration);\n\t\t}","function circle2(x, y, r){\n for(let a=Math.random(); a<180; a+=1+Math.random()*0.1234){\n context.beginPath()\n context.moveTo(x, y)\n const xoff = Math.cos(a) * r + x\n const yoff = Math.sin(a) * r + y\n context.lineTo(xoff, yoff)\n context.stroke()\n }\n}","crearFormaDeTunelCircular(circleRadius = 10){\r\n\t\tvar shape = new THREE.Shape();\r\n\t\tshape.moveTo( circleRadius, 0 );\r\n\t\tshape.absarc( 0, 0, circleRadius, 0, 2 * Math.PI, false );\r\n\r\n\t\treturn shape;\r\n\t}","function circle(x, y, r) {\n\tctx.beginPath();\n\tctx.arc(x, y, r, 0, 6.28);\n\tctx.closePath();\n\tctx.fillStyle = \"peru\"\n\tctx.fill();\n}","function Circle(C, R = Math.random() * CANDY_START_RADIUS + CANDY_MIN_SIZE, M = CANDY_MASS, forcedString) {\n var newCircle = {\n C, // center\n I: 0, // inertia\n V: Vec2(M ? Math.random() * 1000 - 500 : 0, M ? Math.random() * -500 : 0), // velocity (speed)\n M, // inverseMass (0 if immobile)\n A: Vec2(0, M ? 250 : 0), // acceleration\n B: 0, //M ? Math.random() * 7 : 0, // angle? could start at random rotation\n D: 0, // angle velocity (stays on!)\n E: 0, // angle acceleration,\n R, // radius\n // random emojoi! works on most modern devices but not all\n //Z: String.fromCodePoint(0x1F600 + Math.random() * 69/*56*/ | 0)\n // random letter A-Z\n Z: forcedString || String.fromCharCode(65 + Math.floor(Math.random() * 26)),\n //color: \"rgba(\"+rndInt(0,255)+\",\"+rndInt(0,255)+\",\"+rndInt(0,255)+\",1)\" //0.25)\"\n color: \"rgba(\" + rndInt(64, 255) + \",\" + rndInt(64, 255) + \",\" + rndInt(64, 255) + \",1)\" //0.25)\"\n //I: M, // (here it's simplified as M) Inertia = mass * radius ^ 2. 12 is a magic constant that can be changed\n };\n objects.push(newCircle);\n return newCircle;\n }","function pointOnCircle(posX, posY, radius, angle) {\n const x = posX + radius * p5.cos(angle)\n const y = posY + radius * p5.sin(angle)\n return p5.createVector(x, y)\n}","move (circles) {\n circles.forEach((circle) => {\n if (circle !== this) {\n // detect collision with another circle\n if (calculateDistance(circle, this) <= circle.radius + this.radius) {\n this.changeDirectionX()\n this.changeDirectionY()\n }\n\n // draw the link between circles if in range\n if (calculateDistance(circle, this) <= circle.radius + this.radius + linkDistance) {\n drawLink(this, circle)\n }\n }\n })\n\n if (this.x + this.direction.dirX + this.radius >= width ||\n (this.x + this.direction.dirX) - this.radius <= 0) {\n this.changeDirectionX()\n }\n\n if (this.y + this.direction.dirY + this.radius >= height ||\n (this.y + this.direction.dirY) - this.radius <= 0) {\n this.changeDirectionY()\n }\n\n this.x += this.direction.dirX\n this.y += this.direction.dirY\n\n ctx.lineWidth = 3\n this.render(canvas, ctx)\n ctx.fill()\n }","function circle(args) {\n\t\tvar ctx = args[0];\n\t\tvar circeCenterX = args[1];\t// Centro del cerchio, coordinata X\n\t\tvar circeCenterY = args[2];\t// Centro del cerchio, coordinata Y\n\t\t\n\t\tvar colorCircle = args[3];\t// Colore del cerchio\n\t ctx.fillStyle = colorCircle;\n\t \n\t\tctx.beginPath();\n\t /*\n\t Parametri funzione .arc(x, y, r, sAngle, eAngle):\n\t - x: coordinata X del centro del cerchio\n\t - y: coordinata X del centro del cerchio;\n\t - r: raggio;\n\t - sAngle: angolo di inizio in radianti\n\t - eAngle: angolo di fine in radianti\n\t */\n\t ctx.arc(circeCenterX, circeCenterY, 2, 0, 2 * Math.PI);\n\t ctx.stroke();\n\t ctx.fill();\n\t}","function draw() {\n \n // Colouring the background\n background(220);\n\n // Changing the x and the y position\n xPosition = xPosition + xSpeed * xDirection;\n yPosition = yPosition + ySpeed * yDirection;\n\n // Changing the x direction so that it bounces off\n if (xPosition > width - radius || xPosition < radius) {\n xSpeed *= -1;\n }\n\n // Changing the y direction so that it bounces off\n if (yPosition > height - radius || yPosition < radius) {\n ySpeed *= -1;\n }\n\n // Creating the ellipse\n ellipse(xPosition, yPosition, radius, radius);\n\n}","function Circle(x,y,r, color) { //circle object\r\n this.x = x;\r\n this.y = y;\r\n this.r = r;\r\n this.color = color;\r\n}","function drawCircle(cArray){\n\t\tvar circles = arguments[0];\n\t\tfor(var i = 0; i < circles.length; i++){\n\t\t\t//画球\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(circles[i].x,circles[i].y,circles[i].r,0,Math.PI*2,false);\n\t\t\tctx.fill();\n\t\t\t//球间连线\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(circles[0].x,circles[0].y);\n\t\t\tctx.lineTo(circles[i].x,circles[i].y);\n\t\t\t\n\t\t\tctx.stroke();\n\t\t}\n\t}","function SimpleCircle(scene, radius, track_point=null) {\n\n // general\n this.id = Nickel.UTILITY.assign_id();\n this.type = 'SimpleCircle';\n this.scene = scene;\n this.canvas = scene.canvas;\n this.context = this.canvas.getContext(\"2d\");\n\n // style\n this.stroke_width = 1;\n this.stroke_dash_length = 0;\n this.stroke_gap_length = 0;\n this.stroke_fill = null;\n this.stroke_color = null;\n\n // size\n this.radius = radius;\n\n // pos (initially hide the circle)\n this.cx = -radius;\n this.cy = -radius;\n\n // pos of extra point to be tracked\n // (helps with origin related computation)\n // (usually set to center of shape)\n this.tracker = track_point;\n\n // other\n this.dead = false;\n this.visibility = true;\n\n this.update = function() {\n //-- Called every frame.\n //-- Updates changing parameters.\n //--\n\n // skip if marked for deletion\n if (this.dead == true) {\n return;\n }\n\n // user custom update\n this.update_more();\n\n // render graphics\n this.draw();\n }\n\n this.draw = function() {\n //-- Called every frame. Processes graphics\n //-- based on current parameters.\n //--\n\n // skip if marked for invisibility\n if (this.visibility == false || this.dead == true) {\n return;\n }\n\n // skip if no stroke color\n if (!this.stroke_color) {\n return;\n }\n\n // draw\n var ctx = this.context;\n ctx.save();\n\n // stroke properties\n ctx.lineWidth = this.stroke_width;\n ctx.setLineDash([this.stroke_dash_length, this.stroke_gap_length]);\n ctx.fillStyle = this.stroke_fill;\n ctx.strokeStyle = this.stroke_color;\n\n // draw circle\n ctx.beginPath();\n // (params: cx, cy, radius, start_angle, end_angle, anticlockwise?)\n ctx.arc(this.cx,this.cy,this.radius,0,2*Math.PI,false);\n ctx.stroke();\n if (this.stroke_fill)\n ctx.fill();\n\n ctx.restore();\n }\n\n this.destroy = function() {\n //-- Marks current instance for deletion\n //--\n\n this.dead = true;\n this.visibility = false;\n }\n\n this.hide = function() {\n //-- Marks current instance's visibility to hidden\n //--\n\n this.visibility = false;\n }\n\n this.show = function() {\n //-- Marks current instance's visibility to shown\n //--\n\n this.visibility = true;\n }\n\n this.is_visible = function() {\n //-- Returns if self is visible\n //--\n\n return this.visibility;\n }\n\n this.update_more = function() {\n //-- Called in update. Meant to be over-ridden.\n //--\n\n }\n\n this.get_tracker = function() {\n //-- Returns track point\n //--\n\n return this.tracker;\n }\n\n this.set_tracker = function(track_point) {\n //-- Sets a new track point\n //--\n\n this.tracker = track_point;\n }\n\n this.get_center = function() {\n //-- Returns center of circle\n //--\n\n return [this.cx, this.cy];\n }\n\n this.set_center = function(new_center) {\n //-- Centers self onto a position\n //--\n\n if (this.tracker) {\n this.tracker[0] += new_center[0] - this.cx;\n this.tracker[1] += new_center[1] - this.cy;\n }\n\n this.cx = new_center[0];\n this.cy = new_center[1];\n }\n\n this.shift_pos = function(shiftx, shifty) {\n //-- Shifts center position\n //--\n\n this.cx += shiftx;\n this.cy += shifty;\n\n if (this.tracker) {\n this.tracker[0] += shiftx;\n this.tracker[1] += shifty;\n }\n }\n\n this.set_pos = function(point) {\n //-- Translates self where center point\n //-- is at the given point (proxy to 'set_center')\n //--\n\n this.set_center(point);\n }\n\n this.scale_around = function(scale, point) {\n //-- Scales x,y center position and radius\n //-- of self from/to a point\n //--\n\n this.scale_around2(scale, scale, scale, point);\n }\n\n this.scale_around2 = function(scalex, scaley, scaler, point) {\n //-- Scales x,y center position and radius\n //-- of self from/to a point\n //--\n\n this.cx = scalex * (this.cx - point[0]) + point[0];\n this.cy = scaley * (this.cy - point[1]) + point[1];\n this.radius *= scaler;\n\n if (this.tracker) {\n this.tracker[0] = scalex * (this.tracker[0] - point[0]) + point[0];\n this.tracker[1] = scaley * (this.tracker[1] - point[1]) + point[1];\n }\n }\n\n this.rotate_around = function(degrees, point) {\n //-- Applies a rotation transformation to centerpoint\n //--\n\n var radians = degrees*Math.PI/180*-1;\n\n var tmpx = this.cx - point[0];\n var tmpy = this.cy - point[1];\n this.cx = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.cy = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n\n if (this.tracker) {\n\n var tmpx = this.tracker[0] - point[0];\n var tmpy = this.tracker[1] - point[1];\n this.tracker[0] = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.tracker[1] = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n }\n }\n \n this.copy_base = function() {\n //-- Copies self using basic properties\n //--\n \n var new_tracker = [this.tracker[0], this.tracker[1]];\n var new_circle = new SimpleCircle(this.scene,this.radius,new_tracker);\n new_circle.set_center([this.cx, this.cy]);\n new_circle.stroke_width = this.stroke_width;\n new_circle.stroke_dash_length = this.stroke_dash_length;\n new_circle.stroke_gap_length = this.stroke_gap_length;\n new_circle.stroke_fill = this.stroke_fill;\n new_circle.stroke_color = this.stroke_color;\n new_circle.update_more = this.update_more;\n return new_circle;\n }\n\n //\n // proxy functions:\n //\n\n this.offset_position = function(offx, offy) {\n //-- shift_pos proxy\n //--\n\n this.shift_pos(offx, offy);\n }\n\n this.offset_turn = function(angle, point) {\n //-- rotate_around proxy\n //--\n\n this.rotate_around(angle, point);\n }\n\n this.offset_scale = function(scale, point) {\n //-- scale_around proxy\n //--\n\n this.scale_around(scale, point);\n }\n}//end SimpleCircle","createParticle() {\n noStroke();\n fill('rgba(200,169,169,random(0,1)');\n circle(this.x, this.y, this.r);\n }","function generate_circle(shape, center) {\n var radius = shape.dimensions['r'];\n var rotation = shape.rotation;\n var pinned = shape.pinned;\n var vertices = [];\n\n // Approximate the circle with a polygon\n var sides = 30; // Number of sides for the polygon approximation\n var theta = 0;\n for (var i = 0; i < sides; i++) {\n theta += (2*Math.PI)/sides;\n vertices.push({x: (radius * Math.cos(theta)) + center.x,\n y: radius * Math.sin(theta) + center.y})\n }\n\n // Adjust nodes to be defined from center of shape\n for (i of shape.nodes) {\n i['x'] += center.x\n i['y'] += center.y\n }\n\n new_shape = {\n vertices: vertices,\n nodes: shape.nodes,\n pinned: shape.pinned,\n center: center\n }\n\n return new_shape;\n}","circlePath (x, y, r) {\n return \"M\" + x + \",\" + y + \" \" +\n \"m\" + -r + \", 0 \" +\n \"a\" + r + \",\" + r + \" 0 1,0 \" + r * 2 + \",0 \" +\n \"a\" + r + \",\" + r + \" 0 1,0 \" + -r * 2 + \",0Z\";\n }","function initManyCircles() \r\n{\r\n\tfor (let i = 0; i < noc; i++) \r\n\t{\r\n\t\trandomInitialize();\r\n\r\n\t\tcircleArr.push(new Circle(center_x_pos,center_y_pos,radius,arc_start,arc_end,colour,dx,dy));\r\n\t}\t\r\n}","function EvilCircle(x, y, velX, velY, exists, color, size) {\n Shape.call(this, x, y, 20, 20, exists);\n this.color = color;\n this.size = size;\n}","function createCircle (number) {\n return new Circle({\n id: number,\n x: Math.floor((Math.random() * (width - maxCircleRadius)) + maxCircleRadius),\n y: Math.floor((Math.random() * (height - maxCircleRadius)) + maxCircleRadius),\n radius: Math.floor((Math.random() * maxCircleRadius) + minCircleRadius),\n direction: { dirX: Math.random() * animationSpeed, dirY: Math.random() * animationSpeed }\n })\n}","function Circle ( x, y, r){\n Shape.call(this,x,y); //powiązanie x y koła z x y kształtu!!\n this.r = r; \n\n}","function createFilledCircle(x,y,radius,color){\n let circle = GOval(x - radius,y - radius,2 * radius,2 * radius);\n circle.setColor(color);\n circle.setFilled(true);\n return circle;\n }","function circle18(x, y, r){\n for(let a=0; a<1000; a++){\n context.beginPath()\n let rt = r * Math.pow(Math.random(), 1/4)\n let theta = Math.random() * Math.PI * 2\n const xoff = Math.cos(theta) * rt + x\n const yoff = Math.sin(theta) * rt + y\n context.arc(xoff, yoff, 10, 0, 2 * Math.PI)\n context.stroke()\n }\n}","constructor (position, speed, radius, color) {\n this.position = position;\n this.speed = speed;\n this.radius = radius;\n this.color = color;\n this.imgX = this.position.x - this.radius;\n }","function createCircle() {\n $.get(\"/shape/circle\", function (data, status) {\n var obj = JSON.parse(data);\n app.drawCircle(obj.loc,obj.radius,obj.color);\n }, \"json\");\n}","function Circle(x, y, dx, dy, radius, minimumRadius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.minimumRadius = radius;\n this.color = colors[Math.round(Math.random() * colors.length - 1)];\n\n this.draw = function () {\n c.beginPath(); //need to have this beginPath to prevent the begin point connect to the previous\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n c.fillStyle = this.color;\n // c.fillStyle = colors[Math.round(Math.random()*colors.length - 1)] //randomize the color, but this will blink\n c.fill();\n };\n\n this.update = function() {\n this.x = this.x + this.dx;\n this.y = this.y + this.dy;\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n\n if (this.x > innerWidth - this.radius || this.x < 0 + this.radius) {\n this.dx = -this.dx;\n };\n if (this.y > innerHeight - this.radius || this.y < 0 + this.radius) {\n this.dy = -this.dy;\n };\n\n //interactivity\n if (mouse.x - this.x < 50 && mouse.x - this.x > -50 && mouse.y - this.y < 50 && mouse.y - this.y > -50) {\n if(this.radius < maximumRadius){\n this.radius += 1;\n }\n } else if (this.radius > this.minimumRadius) {\n this.radius -= 1;\n } //make sure the circle have a distance from the mouse x horizontally and vertically\n //and make sure they are within the maximum and minimum radius range;\n\n this.draw();\n }\n\n}","function drawCircle(context){\r\n\tconsole.log(\"drawing circles\");\r\n\tfor(i = 0; i < circles.length; i++){\r\n\t\tcontext.beginPath();\r\n\t\tvar x = circles[i].xCenter;\r\n\t\tvar y = circles[i].yCenter;\r\n\t\tvar radius = circles[i].radius;\r\n\t\tconsole.log(\"drawing a circle at (\" + x + \", \" + y + \") with radius\" + radius);\r\n\t\tcontext.arc(x, y, radius, 0, 2*Math.PI);\r\n\t\tcontext.stroke();\r\n\t}\r\n}","function createCircle(radius) {\n let c = {\n radius,\n draw: function() {\n console.log(\"draw\");\n }\n };\n return c;\n}","createParticle() {\n noStroke();\n fill('rgba(200,169,169,1)');\n circle(this.x,this.y,this.r);\n }","function Circle(radius) {\n this.radius = radius;\n}","function SequentialCircles(radius) {\n const gap = 10;\n const arr = generateRadius(radius, 5);\n // console.log(arr, 'arr');\n\n this.paths = {};\n\n let y = gap;\n for (const r of arr) {\n // console.log(r, 'r');\n const circle = new makerjs.paths.Circle([0, y + r], r);\n y += 2 * r + gap;\n this.paths['circle_' + r] = circle;\n }\n}","function Circle(radius) {\n this.radius = radius; \n}","function newCircle() {\n x = random(windowWidth);\n y = random(windowHeight);\n r = random(255);\n g = random(255);\n b = random(255);\n}","constructor(x = 0, y = 0, vx = 0, vy = 0, theta = 0, av = 0, pts = f.geometry.shape.square(), circles = [], density = 1, springConstant = .5) {\n super(x, y, vx, vy, theta, av, pts, circles, density);\n }","function printCircles(){ /**This function prints out all the coloured circles to the screen*/\r\n\tfor(let i=0;i= 360) {\\r\\n\\t\\t\\t\\tthis.getColor = 0;\\r\\n\\t\\t\\t}\\r\\n }\\r\\n\\r\\n this.move = function() {\\r\\n this.position.y += this.speed; // The random speed for the Circle\\r\\n //this.position.x += this.sway; // If this is activated the circles will go in directions other than straight\\r\\n }\\r\\n\\r\\n ellipse(this.position.x, this.position.y, this.d, this.d); // The circles are drawn\\r\\n }\\r\\n}\",\n \"function CreateCircle(x, y, radius, option, rate) {\\n return Matter.Bodies.circle(x * rate, y * rate, radius * rate, option);\\n}\",\n \"function setupCircles(){\\n\\n var delay=0;\\n var i = 0;\\n for(var radius=canvasDiagonalFromCenter; radius>0; radius-=10){\\n var circle = new Circle(radius, 0*Math.PI + i , 2*Math.PI + i ,0,0,delay,inputSpeed,inputAcceleration);\\n circles.push(circle);\\n delay+=delayIncrements;\\n i+= 0.3*Math.PI;\\n }\\n drawAndUpdateCircles();\\n}\",\n \"function Circles(x, y, size)\\r\\n{\\r\\n this.x = x;\\r\\n this.y = y;\\r\\n this.size = size;\\r\\n this.shape = 'circle';\\r\\n}\",\n \"function circle(x,y,xVel,yVel,r,m)\\n{\\n\\tthis.x=x;\\n\\tthis.y=y;\\n\\tthis.xVel=xVel;\\n\\tthis.yVel=yVel;\\n\\tthis.mass=m;\\n\\tthis.r=r;\\n\\t\\n\\tthis.moveSpeed=2;\\n\\n}\",\n \"function buildCircleScene() {\\n var posOrig = new THREE.Vector2(0, 0, 0); \\n var posTarget = new THREE.Vector2(0, 0, 0); \\n var num = sceneData.nAgents;\\n var radius = 4;\\n\\n positionsArray = new Array();\\n\\n for (var i = 0; i < num; i++) {\\n // circle shape\\n var theta = 2*M_PI/num * i;\\n var xLoc = radius * Math.cos(theta);\\n var zLoc = radius * Math.sin(theta);\\n var xLocDest = radius * Math.cos(theta + M_PI);\\n var zLocDest = radius * Math.sin(theta + M_PI);\\n\\n posOrig = new THREE.Vector3(xLoc, zLoc);\\n posTarget = new THREE.Vector3(xLocDest, zLocDest);\\n\\n positionsArray.push(posOrig);\\n positionsArray.push(posTarget);\\n }\\n}\",\n \"function drawCircles() {\\n for (var i = 0; i < numCircles; i++) {\\n var randomX = Math.round(-100 + Math.random() * 704);\\n var randomY = Math.round(-100 + Math.random() * 528);\\n var speed = 1 + Math.random() * 3;\\n var size = 1 + Math.random() * circleSize;\\n\\n var circle = new Circle(speed, size, randomX, randomY);\\n circles.push(circle);\\n }\\n update();\\n }\",\n \"function addCircles(num){\\r\\n\\tfor(var i=0; i 0 && arguments[0] !== undefined ? arguments[0] : 0.0;var centerY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.0;var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DefaultStyle.clone();var tessSegments = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;_classCallCheck(this, Circle);\\n _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, style));\\n\\n _this6.polygon = new Polygon([], style);\\n\\n // Force polygon.id to be the same, so that its geometry is associated with this Circle.\\n // This is a bit hacky, but can be removed as soon as we use native arcs for circle rendering.\\n _this6.polygon.id = _this6.id;\\n\\n _this6.centerX = centerX;\\n _this6.centerY = centerY;\\n _this6.radius = radius;\\n _this6.tessSegments = tessSegments;\\n\\n _this6.needsUpdate = true;return _this6;\\n }\",\n \"function circle(self, xpos, ypos, radius) {\\n let positions = [];\\n let deltas = bfsDeltas[radius];\\n let deltaLength = deltas.length;\\n for (let k = 0; k < deltaLength; k++) {\\n \\n let nx = xpos + deltas[k][0];\\n let ny = ypos + deltas[k][1];\\n //self.log(`circle xy: ${xpos}, ${ypos}; NEW: ${nx}, ${ny}`);\\n if (inArr(nx,ny, self.map)){\\n positions.push([nx,ny]);\\n }\\n }\\n return positions;\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw: function () {}\\n }\\n}\",\n \"function createCircle(cx, cy, radius) {\\n let a1 = new Arc();\\n a1.startX = cx + radius;\\n a1.startY = cy;\\n a1.endX = cx - radius;\\n a1.endY = cy;\\n a1.radiusX = radius;\\n a1.radiusY = radius;\\n\\n let a2 = new Arc();\\n a2.startX = cx - radius;\\n a2.startY = cy;\\n a2.endX = cx + radius;\\n a2.endY = cy;\\n a2.radiusX = radius;\\n a2.radiusY = radius;\\n\\n return [a1, a2];\\n}\",\n \"function addNewCircle() {\\n\\n // circles can expose in 3 position,\\n // bottom-left corner, bottom-right corner and bottom center.\\n const entrances = [\\\"bottomRight\\\", \\\"bottomCenter\\\", \\\"bottomLeft\\\"];\\n // I take one of entrances randomly as target entrance\\n const targetEntrance = entrances[rndNum(entrances.length, 0, true)];\\n\\n // we have 5 different gradient to give each\\n // circle a different appearance. each item\\n // in below array has colors and offset of gradient.\\n const possibleGradients = [\\n [\\n [0, \\\"rgba(238,31,148,0.14)\\\"],\\n [1, \\\"rgba(238,31,148,0)\\\"]\\n ],\\n [\\n [0, \\\"rgba(213,136,1,.2)\\\"],\\n [1, \\\"rgba(213,136,1,0)\\\"]\\n ],\\n [\\n [.5, \\\"rgba(213,136,1,.2)\\\"],\\n [1, \\\"rgba(213,136,1,0)\\\"]\\n ],\\n [\\n [.7, \\\"rgba(255,254,255,0.07)\\\"],\\n [1, \\\"rgba(255,254,255,0)\\\"]\\n ],\\n [\\n [.8, \\\"rgba(255,254,255,0.05)\\\"],\\n [.9, \\\"rgba(255,254,255,0)\\\"]\\n ]\\n ];\\n // I take one of gradients details as target gradient details\\n const targetGrd = possibleGradients[rndNum(possibleGradients.length, 0, true)];\\n\\n // each circle should have a radius. and it will be\\n // a random number between three and four quarters of canvas-min side\\n const radius = rndNum(canvasMin / 3, canvasMin / 4);\\n\\n // this will push the created Circle to the circles array\\n circles.push(new Circle(targetEntrance, radius, targetGrd))\\n}\",\n \"function createCircle(x,y)\\n{\\n\\t//each segment of the circle is its own circle svg, placed in an array\\n\\tvar donuts = new Array(9)\\n\\t\\n\\t//loop through the array\\n\\tfor (var i=0;i<9;i++){\\n\\t\\tdonuts[i]=document.createElementNS(\\\"http://www.w3.org/2000/svg\\\",\\\"circle\\\");\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"id\\\",\\\"d\\\".concat(i.toString()));\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"cx\\\",parseInt(x));\\n donuts[i].setAttributeNS(null,\\\"cy\\\",parseInt(y));\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"fill\\\",\\\"transparent\\\");\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-width\\\",3);\\n\\t\\t//each ring of circles has different radius values, and dash-array values\\n\\t\\t//dash array defines what percentage of a full circle is being drawn\\n\\t\\t//for example the inner circle has a radius of 15.91549, 2*pi*15.91549\\n\\t\\t//gives a circumfrence of 100 pixels for the circle, so defining the dasharray as 31 69 means that 31% of 100 pixels is drawn, and 69% is transparent.\\n\\t\\tif (i<3){\\n\\t\\t\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"r\\\",15.91549);\\n\\t\\t\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-dasharray\\\",\\\"31 69\\\");\\n\\t\\t}\\n\\t\\t//middle ring\\n\\t\\telse if (i<6){\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"r\\\",19.853);\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-dasharray\\\",\\\"39.185019 85.555059\\\");\\n\\t\\t}\\n\\t\\t//outer ring\\n\\t\\telse{\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"r\\\",23.76852);\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-dasharray\\\",\\\"47.335504 102.006512\\\");\\n\\t\\t}\\n\\t\\t//each point is added to the points SVGs, use insertBefore so that it is drawn below the points rather than above, which allows for click events to still occur\\n\\t\\t document.getElementById(\\\"points\\\").insertBefore(donuts[i],document.getElementById(\\\"points\\\").childNodes.item(0));\\n\\t}\\n\\t//each point has its own colour, dash offset and class. Dash offset is how far from the starting point (top of the circle) to begin drawing the segment\\n\\t//each class relates to a different css animation because each animation has a different starting point. Animations are defined in component.css\\ndonuts[0].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"58.33333\\\" );\\n\\t\\t\\t\\t\\t\\tdonuts[0].setAttributeNS(null,\\\"class\\\",\\\"spin1\\\");\\ndonuts[1].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"25\\\");\\n\\t\\t\\t\\t\\t\\t\\tdonuts[1].setAttributeNS(null,\\\"class\\\",\\\"spin2\\\");\\ndonuts[2].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"91.66667\\\" );\\n\\t\\t\\t\\t\\t\\t\\tdonuts[2].setAttributeNS(null,\\\"class\\\",\\\"spin3\\\");\\ndonuts[3].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"41.18502\\\" );\\n\\tdonuts[3].setAttributeNS(null,\\\"class\\\",\\\"spin4\\\");\\ndonuts[4].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"82.76505\\\" );\\n\\tdonuts[4].setAttributeNS(null,\\\"class\\\",\\\"spin5\\\");\\ndonuts[5].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"124.34508\\\");\\n\\tdonuts[5].setAttributeNS(null,\\\"class\\\",\\\"spin6\\\");\\ndonuts[6].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"56.3355\\\");\\n\\tdonuts[6].setAttributeNS(null,\\\"class\\\",\\\"spin7\\\");\\ndonuts[7].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"106.11618\\\");\\n\\tdonuts[7].setAttributeNS(null,\\\"class\\\",\\\"spin8\\\");\\ndonuts[8].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"155.89685\\\");\\n\\tdonuts[8].setAttributeNS(null,\\\"class\\\",\\\"spin9\\\");\\ndonuts[0].setAttributeNS(null,\\\"stroke\\\",\\\"#115D6B\\\");\\ndonuts[1].setAttributeNS(null,\\\"stroke\\\",\\\"#D90981\\\");\\ndonuts[2].setAttributeNS(null,\\\"stroke\\\",\\\"#4A3485\\\");\\ndonuts[3].setAttributeNS(null,\\\"stroke\\\",\\\"#F51424\\\");\\ndonuts[4].setAttributeNS(null,\\\"stroke\\\",\\\"#0BA599\\\");\\ndonuts[5].setAttributeNS(null,\\\"stroke\\\",\\\"#1077B5\\\");\\ndonuts[6].setAttributeNS(null,\\\"stroke\\\",\\\"#FA893D\\\");\\ndonuts[7].setAttributeNS(null,\\\"stroke\\\",\\\"#87C537\\\");\\ndonuts[8].setAttributeNS(null,\\\"stroke\\\",\\\"#02B3EE\\\");\\n}\",\n \"function circle(x, y, px, py) {\\n //this is the speed part making the size be determined by speed of mouse\\n var distance = abs(x-px) + abs(y-py);\\n stroke(r, g, b);\\n strokeWeight(2);\\n //first set of variables for bigger circle\\n r = random(255);\\n g = random(255);\\n b = random(255);\\n\\n//second set of colours so the inner circle is different colour or else it is the same\\n r2 = random(255);\\n g2 = random(255);\\n b2 = random(255);\\n //this is the big circle\\n fill(r, g, b);\\n ellipse(x, y, distance, distance);\\n //this is the smaller inner circle\\n fill(r2, g2, b2);\\n ellipse(x, y, distance/2, distance/2);\\n}\",\n \"function drawCircle(radius, x, y) { svg.append(\\\"circle\\\").attr(\\\"fill\\\", \\\"red\\\").attr(\\\"r\\\", radius).attr(\\\"cx\\\", x).attr(\\\"cy\\\", y); }\",\n \"static createCircle(x, y, radius, numSides = -1) {\\n return new Ellipse(x, y, radius, radius, numSides)\\n }\",\n \"function createCircle(radius){\\n return{\\n radius,\\n draw (){\\n console.log('draw');\\n }\\n };\\n\\n }\",\n \"function OrthoganalCircle(theta,dTheta) {\\n \\n \\tlet R = 1.0/cos(dTheta);\\n this.r = abs(tan(dTheta));\\n // this.x = R*cos(theta);\\n // this.y = R*sin(theta);\\n \\t//endpoints\\n \\tthis.p1 = createVector(cos(theta-dTheta),sin(theta-dTheta));\\n this.p2 = createVector(cos(theta+dTheta),sin(theta+dTheta));\\n \\n \\tthis.center = createVector(R*cos(theta),R*sin(theta));\\n \\tthis.containsPoint = function(p){\\n \\t\\n \\treturn this.center.dist(p) < this.r;\\n };\\n \\t\\n \\n \\t/*\\n \\tCircle inversion. Swaps points inside the circle with points outside the circle. Like a refection in a line in hyperbolic space.\\n */\\n \\tthis.invert = function(p){ \\n \\t\\n \\n \\tlet op = this.center.dist(p);\\n \\n \\tlet oq = this.r*this.r/op;\\n \\t\\n \\tlet dq = p5.Vector.sub(p,this.center).normalize().mult(oq);\\n \\t\\n \\treturn p5.Vector.add(this.center,dq);\\n };\\n \\n \\tthis.draw = function(graphics) {\\n //Draw the arc\\n let v1 = p5.Vector.sub(this.p1,this.center);\\n let v2 = p5.Vector.sub(this.p2,this.center);\\n \\n let theta1 = v1.heading();\\n let theta2 = v2.heading();\\n \\n let i = ii(this.center.x);\\n let j = jj(this.center.y);\\n \\n graphics.arc(i,j, this.r*width,this.r*height ,theta2,theta1)\\n }\\n \\n this.drawAnchors = function(graphics) {\\n graphics.ellipse(ii(this.p1.x),jj(this.p1.y),4,4); \\n graphics.ellipse(ii(this.p2.x),jj(this.p2.y),4,4); \\n }\\n}\",\n \"_createRandomCircles2(options) {\\n let { n, filled, stroke, colours, minRadius, maxRadius, acceleration, friction, dx, dy } = options;\\n minRadius = minRadius ? minRadius : this.MIN_RADIUS;\\n maxRadius = maxRadius ? maxRadius : this.MAX_RADIUS;\\n dx = dx === undefined ? 2 : dx;\\n dy = dy === undefined ? 10 : dy;\\n\\n for (let i = 0; i < n; i++) {\\n const radius = randomIntFromRange(minRadius, maxRadius);\\n const x = randomIntFromRange(radius, this.canvas.width - radius);\\n const y = randomIntFromRange(0, this.canvas.height / 2);\\n const colour = randomColour(colours);\\n const dx_ = randomIntFromRange(-dx, dx);\\n const dy_ = randomIntFromRange(-dy, dy);\\n this.makeCircle({ x, y, dx: dx_, dy: dy_, colour, radius, filled, gravity: true, acceleration, friction, stroke })\\n }\\n\\n }\",\n \"constructor({colorCode, context, x, y, radius, percentFromCenter}) {\\n this.circles = [];\\n this.percentFromCenter = percentFromCenter;\\n\\n if (Math.abs(this.percentFromCenter) < 0.01) {\\n this.circles.push(new ColorCircle({\\n x: 0,\\n y: 0,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: colorCode.getComponent('R'),\\n green: colorCode.getComponent('G'),\\n blue: colorCode.getComponent('B')\\n }),\\n context\\n }));\\n }\\n else {\\n // Add red circle in bottom left position\\n this.circles.push(new ColorCircle({\\n x: x - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: colorCode.getComponent('R'),\\n green: 0,\\n blue: 0,\\n }),\\n context\\n }));\\n // Add green circle in top position\\n this.circles.push(new ColorCircle({\\n x: x,\\n y: y + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: 0,\\n green: colorCode.getComponent('G'),\\n blue: 0,\\n }),\\n context\\n }));\\n // Add blue circle in bottom right position\\n this.circles.push(new ColorCircle({\\n x: x + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: 0,\\n green: 0,\\n blue: colorCode.getComponent('B'),\\n }),\\n context\\n }));\\n }\\n }\",\n \"function Circle(speed, width, xPos, yPos) {\\n this.speed = speed\\n this.width = width\\n this.xPos = xPos\\n this.yPos = yPos\\n this.dx = Math.floor(Math.random() * 2) + 1\\n this.dy = Math.floor(Math.random() * 2) + 1\\n this.opacity = 0.05 + Math.random() * 0.5;\\n this.isEaten = false\\n this.color = colors[Math.floor(Math.random() * numColors - 1)]\\n\\n }\",\n \"function Circle(x, y, dx, dy, radius) {\\n this.x = x;\\n this.y = y;\\n // Step 4\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n // Step 8 Add Color\\n this.colors = [\\\"#16a085\\\", \\\"#e74c3c\\\", \\\"#34495e\\\"];\\n\\n // Step 3 Add Draw Function\\n this.draw = function() {\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n // Step 8 Add Color\\n c.strokeStyle = \\\"blue\\\";\\n // c.strokeStyle = this.colors[Math.floor(Math.random() * 3)];\\n c.stroke();\\n // c.fillStyle = this.colors[Math.floor(Math.random() * 3)];\\n };\\n\\n // Step 4 Update / Create Animation\\n // Add dx, dy, radius\\n this.update = function() {\\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\\n this.dx = -this.dx;\\n }\\n\\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\\n this.dy = -this.dy;\\n }\\n\\n this.x += this.dx;\\n this.y += this.dy;\\n\\n // Step 5 add draw\\n this.draw();\\n };\\n}\",\n \"function Circle(x, y, dx, dy, radius) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n \\n // FUNCTION FOR DRAWING NEW CIRCLE\\n this.draw = function() {\\n context.beginPath();\\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n context.fillStyle = circleBodyColor;\\n context.strokeStyle = circleLineColor;\\n context.stroke();\\n context.fill();\\n }\\n\\n // FUNCTION WITH LOGIC FOR MOVEMENT OF THE CIRCLES\\n this.update = function() {\\n // MOVING CIRCLES LEFT AND RIGHT\\n if (this.x + this.radius + 1 > innerWidth || this.x - this.radius < 0 ) {\\n this.dx = -this.dx;\\n }\\n\\n // MOVING CIRCLE UP AND DOWN\\n if (this.y + this.radius + 1 > innerHeight || this.y - this.radius < 0) {\\n this.dy = -this.dy;\\n }\\n this.x += this.dx;\\n this.y += this.dy;\\n \\n // AFTER MOVEMENT IS UPDATED, DRAW EVERYTHING AGAIN\\n this.draw();\\n }\\n}\",\n \"function drawCircles() {\\n canvasContext.fillStyle = 'white';\\n canvasContext.fillRect(0, 0, xMax, yMax);\\n\\n for (let i = 0; i < particles.length; i++) {\\n let r = particles[i].circleShape.radius;\\n canvasContext.drawImage(\\n particleImages[r],\\n particles[i].position[0] - r + (xMax / 2),\\n particles[i].position[1] - r + (yMax / 2)\\n );\\n }\\n\\n for (let i = 0; i < circles.length; i++) {\\n canvasContext.save();\\n\\n canvasContext.lineWidth = LINE_WIDTH;\\n canvasContext.strokeStyle = colors[i];\\n\\n canvasContext.beginPath();\\n\\n canvasContext.arc(\\n circles[i].position[0] + (xMax / 2),\\n circles[i].position[1] + (yMax / 2),\\n circles[i].circleShape.radius,\\n 0,\\n Math.PI * 2\\n );\\n canvasContext.stroke();\\n canvasContext.fill();\\n\\n canvasContext.restore();\\n }\\n }\",\n \"function Circle(x, y, vx, vy, r, growth) {\\n this.x = x;\\n this.y = y;\\n this.vx = vx;\\n this.vy = vy;\\n this.r = r;\\n this.color = canvasColors[0];\\n this.alpha = 1;\\n\\n this.draw = function() {\\n contextCanvas.beginPath();\\n contextCanvas.strokeStyle = this.color.replace('x', + this.alpha);\\n contextCanvas.arc(this.x, this.y, this.r, Math.PI * 2, false);\\n contextCanvas.lineWidth = 2;\\n contextCanvas.stroke();\\n contextCanvas.fillStyle = 'transparent';\\n contextCanvas.fill();\\n }\\n\\n this.update = function() {\\n this.x += this.vx;\\n this.y += this.vy;\\n this.alpha -= 0.015;\\n this.r += growth;\\n this.draw();\\n }\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n },\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n },\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n}\",\n \"constructor(x, y, radius) {\\n super(createVector(x, y));\\n this.x = x;\\n this.y = y;\\n this.radius = radius;\\n this.setShape();\\n this.fixtureType = \\\"circle\\\";\\n\\n }\",\n \"function circlePoint(x, y, r, type, force, exceptions) {\\n elipsePoint(x, y, r, r, type, force, exceptions);\\n }\",\n \"constructor(x, y, radius, color, xspeed, yspeed) {\\n this.x = x;\\n this.y = y;\\n this.radius = radius;\\n this.color = color;\\n this.xspeed = xspeed;\\n this.yspeed = yspeed;\\n }\",\n \"function Circle (x, y, dx, dy, radius) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n\\n // Create a nameless function\\n this.draw = function() {\\n context.beginPath();\\n // arc(x, y, radius: Int, startAngle: float, endAngle: float, drawCounterClockwise: bool)\\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n context.strokeStyle = ' #000000';\\n //context.strokeStyle = '#'+Math.floor(Math.random()*16777215).toString(16);\\n context. stroke();\\n }\\n\\n this.update = function() {\\n if( this.x + this.radius > innerWidth || this.x - this.radius < 0 ) {\\n this.dx = -this.dx;\\n }\\n \\n if( this.y + this.radius > innerHeight || this.y - this.radius < 0 ) {\\n this.dy = -this.dy;\\n }\\n \\n this.x += this.dx;\\n this.y += this.dy;\\n\\n this.draw();\\n }\\n}\",\n \"function calculateCircle(c1, c2, c3, properties, pathIndex, level)\\n{\\t\\n\\tcalCount++;\\n\\t\\n\\tvar k1 = properties.k1;\\n\\tvar k2 = properties.k2;\\n\\tvar k3 = properties.k3;\\n\\tvar k4 = properties.k4;\\n\\t\\n\\tvar z4 = mRC((1/k4), aCC(aCC(aCC(mRC(k1, c1._origin), mRC(k2, c2._origin)), mRC(k3, c3._origin)), mRC(2, sqrtC(aCC(aCC(mRC(k1*k2, mCC(c1._origin, c2._origin)), mRC(k2*k3, mCC(c2._origin, c3._origin))), mRC(k1*k3, mCC(c1._origin, c3._origin)))))));\\n\\tvar tangencyList = [c1, c2, c3];\\n\\tvar circ = new Circle(z4, 1/k4, c1.id + pathIndex, tangencyList, c1, level+1, \\\"#FFFFFF\\\", false);\\n\\t\\n\\treturn circ;\\n}\",\n \"function Circle(x,y,dx,dy,radius){\\n //independent x&y values\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n\\n//creating a method within an object to create a circle every time this function is called anonymous function\\n this.draw = function() {\\n //console.log('hello there');\\n //arc //circle\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI*2, false);\\n c.strokeStyle = 'pink';\\n c.stroke();\\n c.fill();\\n}\\n\\nthis.update = function() {\\n //moving circle by 1px --> x += 1;\\n\\n if(this.x + this.radius > innerWidth ||\\n this.x - this.radius < 0){\\n this. dx = -this.dx;\\n }\\n if(this.y + this.radius > innerHeight ||\\n this.y - this.radius < 0){\\n this.dy = -this.dy;\\n }\\n this.x += this.dx; \\n this.y += this.dy;\\n\\n this.draw();\\n }\\n}\",\n \"function Circle () {\\n /**\\n * Radius of circle\\n * @type Ray3d\\n */\\n this.fRadius = 0.0;\\n /**\\n * Point of center\\n * @type Float32Array\\n */\\n this.v2fCenter = null;\\n\\n switch (arguments.length) {\\n case 0:\\n this.v2fCenter = Vec2.create();\\n break;\\n case 1:\\n this.v2fCenter = Vec2.create(arguments[0].v2fCenter);\\n this.fRadius = arguments[0].fRadius;\\n break;\\n case 2:\\n this.v2fCenter = Vec2.create(arguments[0]);\\n this.fRadius = arguments[1];\\n break;\\n case 3:\\n this.v2fCenter = Vec2.create();\\n this.v2fCenter.X = arguments[0];\\n this.v2fCenter.Y = arguments[1];\\n this.fRadius = arguments[2];\\n break;\\n }\\n ;\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log('draw');\\n }\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log('draw');\\n }\\n };\\n}\",\n \"function Circle(x, y, dx, dy, radius, color) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n this.color = color;\\n\\n\\n this.draw = function(){\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n c.fillStyle = this.color;\\n c.fill();\\n c.closePath();\\n }\\n\\n\\n//****movement and edges\\n this.update = function(){\\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0){\\n this.dx = -this.dx;\\n }\\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0){\\n this.dy = -this.dy;\\n }\\n this.x += this.dx;\\n this.y += this.dy;\\n\\n this.draw();\\n }\\n}\",\n \"function drawDonut() {\\n for (let i = 0; i <= 360; i += angleStep) {\\n let x = width * sin(i);\\n let y = height * cos(i);\\n let z = 0;\\n let center = { x, y, z };\\n circlesVertices.push(createCircleVertices(center, i, 1));\\n }\\n drawVertices();\\n}\",\n \"function drawTarget() {\\n let circleSize = 400;\\n \\n //draw circles of decreasing size\\n for (let i = 0; i < NUM_CIRC; i++) {\\n ellipse(X_POS, Y_POS, circleSize, circleSize);\\n circleSize -= 40;\\n }\\n}\",\n \"function CircleMethods() {\\n const origin = [0, 0];\\n const pointA = [10, 20];\\n const pointB = [20, 0];\\n const pointC = [-15, -15];\\n\\n const radius = 20;\\n\\n const circleMethod1 = new makerjs.paths.Circle(radius);\\n const circleMethod2 = new makerjs.paths.Circle(origin, radius);\\n const circleMethod3 = new makerjs.paths.Circle(pointA, pointB);\\n const circleMethod4 = new makerjs.paths.Circle(pointA, pointB, pointC);\\n\\n this.paths = {\\n circleMethod1,\\n circleMethod2,\\n circleMethod3,\\n circleMethod4,\\n };\\n}\",\n \"function walkingCircle() {\\n addCircle(150, \\\"green\\\");\\n addCircle(300, \\\"blue\\\");\\n addCircle(600, \\\"purple\\\");\\n addCircle(searchRadius, \\\"black\\\");\\n}\",\n \"drawCircle () {\\n const context = this.canvas.getContext('2d')\\n const [x, y] = this.center\\n const radius = this.size / 2\\n\\n for (let angle = 0; angle <= 360; angle++) {\\n const startAngle = (angle - 2) * Math.PI / 180\\n const endAngle = angle * Math.PI / 180\\n context.beginPath()\\n context.moveTo(x, y)\\n context.arc(x, y, radius, startAngle, endAngle)\\n context.closePath()\\n context.fillStyle = 'hsl(' + angle + ', 100%, 50%)'\\n context.fill()\\n }\\n }\",\n \"function createCircle(radius){\\n return {\\n // radius <-----> radius = radius\\n radius,\\n draw(){\\n console.log('draw');\\n }\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(draw);\\n }\\n };\\n}\",\n \"function circle(a, b, x, r) {\\n for (var i = 0; i < x; i++) {\\n ctx.moveTo(r*a*Math.cos(i*2*Math.PI/x), r*b*Math.sin(i*2*Math.PI/x));\\n ctx.lineTo(r*a*Math.cos((i+1)*2*Math.PI/x), r*b*Math.sin((i+1)*2*Math.PI/x));\\n ctx.stroke();\\n }\\n }\",\n \"drawCircle(ctx, _x_loc, _y_loc, _radius, _speed_vector){\\n ctx.beginPath();\\n ctx.arc(_x_loc, _y_loc, _radius, 0, 2*Math.PI);\\n if (_speed_vector < 4)\\n ctx.fillStyle = \\\"#B6FF33\\\";\\n else if (_speed_vector < 8)\\n ctx.fillStyle = \\\"#FF9900\\\";\\n else{\\n ctx.fillStyle = ctx.createPattern(document.getElementById(\\\"ball\\\"), \\\"repeat\\\");\\n }\\n ctx.fill();\\n\\n }\",\n \"circle() {\\n const context = GameState.current;\\n\\n Helper.strewnSprite(\\n Helper.getMember(GroupPool.circle().members),\\n { y: context.game.stage.height },\\n { y: 2 },\\n (sprite) => {\\n this._tweenOfCircle(context, sprite);\\n }\\n );\\n }\",\n \"function createCircleAnimation(cords) {\\n\\tvar xy = cords.x + 'px ' + cords.y + 'px';\\n\\t$.keyframe.define([{\\n\\t\\tname: 'circle-in',\\n\\t\\tfrom: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\\n\\t\\tto: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\\n\\t}]);\\n\\t$.keyframe.define([{\\n\\t\\tname: 'circle-out',\\n\\t\\tfrom: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\\n\\t\\tto: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\\n\\t}]);\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n}\",\n \"function Circle(x, y, dx, dy, radius, r, g, b) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n this.minRadius = radius;\\n this.r = r;\\n this.g = g;\\n this.b = b;\\n this.color = colorArray[Math.floor(Math.random() * colorArray.length)]\\n\\n this.draw = function () {\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n // c.strokeStyle = `rgb(${r}, ${g}, ${b})`;\\n // c.fillStyle = `rgb(${r}, ${g}, ${b})`;\\n c.fillStyle = this.color\\n // c.stroke();\\n c.fill();\\n }\\n this.update = function () {\\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\\n this.dx = -this.dx;\\n }\\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\\n this.dy = -this.dy;\\n }\\n this.x += this.dx;\\n this.y += this.dy;\\n\\n\\n //INTERACTIVITY portion\\n if (mouse.x - this.x < 50 \\n && mouse.x - this.x > -50\\n && mouse.y - this.y < 50 \\n && mouse.y - this.y > -50) {\\n if (this.radius < maxRadius) {\\n this.radius += 1;\\n }\\n } else if (this.radius > this.minRadius) {\\n this.radius -= 1;\\n }\\n\\n this.draw();\\n }\\n}\",\n \"function circle(x,y,radius) { \\n ctx.beginPath();\\n ctx.arc(x, y, radius,0, 2*Math.PI);\\n ctx.fill();\\n ctx.stroke();\\n}\",\n \"function circlePath (pathX, pathY, x, y, r, s)\\n{\\n // Compute the number of steps given the speed\\n let nSteps = 2 * Math.PI * r / s;\\n // Clear the current path\\n pathX.length = 0;\\n pathY.length = 0;\\n // Add points to the path uniformly along a circle\\n for (let i = 0; i < nSteps; i ++)\\n {\\n pathX[i] = x + r * Math.sin(i * s / r);\\n pathY[i] = y + r * Math.cos(i * s / r);\\n }\\n}\",\n \"function shapes() {\\n for (x = -1; x <= (width / 100) + 1; x++) {\\n for (y = -1; y <= (height / 100) + 1; y++) {\\n // Checks if the object is moving right or left\\n if (posX) {\\n // Checks if the object is moving up or down\\n if (posY) {\\n // Object creation in the Right and Down direction\\n if (createCircles) {\\n ellipse((x * 100) + w, (y * 100) + z, 50, 50);\\n } else {\\n rect((x * 100) + w, (y * 100) + z, 45, 45);\\n }\\n // The else of the up/down check\\n } else {\\n // Object creation in the right and Up direction\\n if (createCircles) {\\n ellipse((x * 100) + w, (y * 100) - z, 50, 50);\\n } else {\\n rect((x * 100) + w, (y * 100) - z, 45, 45);\\n }\\n }\\n // The else of the right/left check\\n } else {\\n if (posY) {\\n // Object creation in the left and Down direction\\n if (createCircles) {\\n ellipse((x * 100) - w, (y * 100) + z, 50, 50);\\n } else {\\n rect((x * 100) - w, (y * 100) + z, 45, 45);\\n }\\n } else {\\n // Object creation in the left and Up direction\\n if (createCircles) {\\n ellipse((x * 100) - w, (y * 100) - z, 50, 50);\\n } else {\\n rect((x * 100) - w, (y * 100) - z, 45, 45);\\n }\\n }\\n }\\n }\\n }\\n}\",\n \"animateCircles() {\\n requestAnimationFrame(this.animateCircles.bind(this));\\n this.clearCanvas();\\n this.circles.forEach(circle => circle.update({\\n mouse_x: this.mouse.x,\\n mouse_y: this.mouse.y,\\n range: this.mouse.range,\\n particles: this.circles\\n }));\\n }\",\n \"function drawCircle(x,y,radius,color)\\r\\n{\\r\\n\\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\\r\\n}\",\n \"function createCircle(radius) {\\n //Object Template\\n const circle = {\\n radius,\\n draw() {\\n console.log('Draw ' + radius);\\n }\\n }\\n\\n return circle;\\n}\",\n \"function generate_circles(){\\n\\t\\t\\tvar timerHasStarted = false; // reset the timer, don't start until after the circles are done being generated\\n\\t\\t\\tctx.clearRect(0, 0, window.innerWidth, window.innerHeight); // ensure no past canvas features are remaining\\n\\n\\t\\t\\tright_circs = gen_right_centers()\\n\\t\\t\\tfor(var i=0; i < right_circs.length; i++){\\n\\t\\t\\t\\t\\tctx.beginPath();\\n\\t\\t\\t\\t\\tctx.arc(right_circs[i].x, right_circs[i].y, r2, 0 ,2*Math.PI);\\n\\t\\t\\t\\t\\tctx.fillStyle = trial.circle_color;\\n\\t\\t\\t\\t\\tctx.fill();\\n\\t\\t\\t\\t\\tctx.closePath();\\n\\t\\t\\t}\\n\\n\\t\\t\\tleft_circs = gen_left_centers()\\n\\t\\t\\tfor(var i=0; i < left_circs.length; i++){\\n\\n\\t\\t\\t\\t\\tctx.beginPath();\\n\\t\\t\\t\\t\\tctx.arc(left_circs[i].x, left_circs[i].y, r1, 0 ,2*Math.PI);\\n\\t\\t\\t\\t\\tctx.fillStyle = trial.circle_color;\\n\\t\\t\\t\\t\\tctx.fill();\\n\\t\\t\\t\\t\\tctx.closePath();\\n\\t\\t\\t}\\n\\n\\t\\t\\tstartKeyboardListener();\\n\\t\\t\\tjsPsych.pluginAPI.setTimeout(function() {\\n end_trial();\\n \\t\\t}, trial.trial_duration);\\n\\t\\t}\",\n \"function circle2(x, y, r){\\n for(let a=Math.random(); a<180; a+=1+Math.random()*0.1234){\\n context.beginPath()\\n context.moveTo(x, y)\\n const xoff = Math.cos(a) * r + x\\n const yoff = Math.sin(a) * r + y\\n context.lineTo(xoff, yoff)\\n context.stroke()\\n }\\n}\",\n \"crearFormaDeTunelCircular(circleRadius = 10){\\r\\n\\t\\tvar shape = new THREE.Shape();\\r\\n\\t\\tshape.moveTo( circleRadius, 0 );\\r\\n\\t\\tshape.absarc( 0, 0, circleRadius, 0, 2 * Math.PI, false );\\r\\n\\r\\n\\t\\treturn shape;\\r\\n\\t}\",\n \"function circle(x, y, r) {\\n\\tctx.beginPath();\\n\\tctx.arc(x, y, r, 0, 6.28);\\n\\tctx.closePath();\\n\\tctx.fillStyle = \\\"peru\\\"\\n\\tctx.fill();\\n}\",\n \"function Circle(C, R = Math.random() * CANDY_START_RADIUS + CANDY_MIN_SIZE, M = CANDY_MASS, forcedString) {\\n var newCircle = {\\n C, // center\\n I: 0, // inertia\\n V: Vec2(M ? Math.random() * 1000 - 500 : 0, M ? Math.random() * -500 : 0), // velocity (speed)\\n M, // inverseMass (0 if immobile)\\n A: Vec2(0, M ? 250 : 0), // acceleration\\n B: 0, //M ? Math.random() * 7 : 0, // angle? could start at random rotation\\n D: 0, // angle velocity (stays on!)\\n E: 0, // angle acceleration,\\n R, // radius\\n // random emojoi! works on most modern devices but not all\\n //Z: String.fromCodePoint(0x1F600 + Math.random() * 69/*56*/ | 0)\\n // random letter A-Z\\n Z: forcedString || String.fromCharCode(65 + Math.floor(Math.random() * 26)),\\n //color: \\\"rgba(\\\"+rndInt(0,255)+\\\",\\\"+rndInt(0,255)+\\\",\\\"+rndInt(0,255)+\\\",1)\\\" //0.25)\\\"\\n color: \\\"rgba(\\\" + rndInt(64, 255) + \\\",\\\" + rndInt(64, 255) + \\\",\\\" + rndInt(64, 255) + \\\",1)\\\" //0.25)\\\"\\n //I: M, // (here it's simplified as M) Inertia = mass * radius ^ 2. 12 is a magic constant that can be changed\\n };\\n objects.push(newCircle);\\n return newCircle;\\n }\",\n \"function pointOnCircle(posX, posY, radius, angle) {\\n const x = posX + radius * p5.cos(angle)\\n const y = posY + radius * p5.sin(angle)\\n return p5.createVector(x, y)\\n}\",\n \"move (circles) {\\n circles.forEach((circle) => {\\n if (circle !== this) {\\n // detect collision with another circle\\n if (calculateDistance(circle, this) <= circle.radius + this.radius) {\\n this.changeDirectionX()\\n this.changeDirectionY()\\n }\\n\\n // draw the link between circles if in range\\n if (calculateDistance(circle, this) <= circle.radius + this.radius + linkDistance) {\\n drawLink(this, circle)\\n }\\n }\\n })\\n\\n if (this.x + this.direction.dirX + this.radius >= width ||\\n (this.x + this.direction.dirX) - this.radius <= 0) {\\n this.changeDirectionX()\\n }\\n\\n if (this.y + this.direction.dirY + this.radius >= height ||\\n (this.y + this.direction.dirY) - this.radius <= 0) {\\n this.changeDirectionY()\\n }\\n\\n this.x += this.direction.dirX\\n this.y += this.direction.dirY\\n\\n ctx.lineWidth = 3\\n this.render(canvas, ctx)\\n ctx.fill()\\n }\",\n \"function circle(args) {\\n\\t\\tvar ctx = args[0];\\n\\t\\tvar circeCenterX = args[1];\\t// Centro del cerchio, coordinata X\\n\\t\\tvar circeCenterY = args[2];\\t// Centro del cerchio, coordinata Y\\n\\t\\t\\n\\t\\tvar colorCircle = args[3];\\t// Colore del cerchio\\n\\t ctx.fillStyle = colorCircle;\\n\\t \\n\\t\\tctx.beginPath();\\n\\t /*\\n\\t Parametri funzione .arc(x, y, r, sAngle, eAngle):\\n\\t - x: coordinata X del centro del cerchio\\n\\t - y: coordinata X del centro del cerchio;\\n\\t - r: raggio;\\n\\t - sAngle: angolo di inizio in radianti\\n\\t - eAngle: angolo di fine in radianti\\n\\t */\\n\\t ctx.arc(circeCenterX, circeCenterY, 2, 0, 2 * Math.PI);\\n\\t ctx.stroke();\\n\\t ctx.fill();\\n\\t}\",\n \"function draw() {\\n \\n // Colouring the background\\n background(220);\\n\\n // Changing the x and the y position\\n xPosition = xPosition + xSpeed * xDirection;\\n yPosition = yPosition + ySpeed * yDirection;\\n\\n // Changing the x direction so that it bounces off\\n if (xPosition > width - radius || xPosition < radius) {\\n xSpeed *= -1;\\n }\\n\\n // Changing the y direction so that it bounces off\\n if (yPosition > height - radius || yPosition < radius) {\\n ySpeed *= -1;\\n }\\n\\n // Creating the ellipse\\n ellipse(xPosition, yPosition, radius, radius);\\n\\n}\",\n \"function Circle(x,y,r, color) { //circle object\\r\\n this.x = x;\\r\\n this.y = y;\\r\\n this.r = r;\\r\\n this.color = color;\\r\\n}\",\n \"function drawCircle(cArray){\\n\\t\\tvar circles = arguments[0];\\n\\t\\tfor(var i = 0; i < circles.length; i++){\\n\\t\\t\\t//画球\\n\\t\\t\\tctx.beginPath();\\n\\t\\t\\tctx.arc(circles[i].x,circles[i].y,circles[i].r,0,Math.PI*2,false);\\n\\t\\t\\tctx.fill();\\n\\t\\t\\t//球间连线\\n\\t\\t\\tctx.beginPath();\\n\\t\\t\\tctx.moveTo(circles[0].x,circles[0].y);\\n\\t\\t\\tctx.lineTo(circles[i].x,circles[i].y);\\n\\t\\t\\t\\n\\t\\t\\tctx.stroke();\\n\\t\\t}\\n\\t}\",\n \"function SimpleCircle(scene, radius, track_point=null) {\\n\\n // general\\n this.id = Nickel.UTILITY.assign_id();\\n this.type = 'SimpleCircle';\\n this.scene = scene;\\n this.canvas = scene.canvas;\\n this.context = this.canvas.getContext(\\\"2d\\\");\\n\\n // style\\n this.stroke_width = 1;\\n this.stroke_dash_length = 0;\\n this.stroke_gap_length = 0;\\n this.stroke_fill = null;\\n this.stroke_color = null;\\n\\n // size\\n this.radius = radius;\\n\\n // pos (initially hide the circle)\\n this.cx = -radius;\\n this.cy = -radius;\\n\\n // pos of extra point to be tracked\\n // (helps with origin related computation)\\n // (usually set to center of shape)\\n this.tracker = track_point;\\n\\n // other\\n this.dead = false;\\n this.visibility = true;\\n\\n this.update = function() {\\n //-- Called every frame.\\n //-- Updates changing parameters.\\n //--\\n\\n // skip if marked for deletion\\n if (this.dead == true) {\\n return;\\n }\\n\\n // user custom update\\n this.update_more();\\n\\n // render graphics\\n this.draw();\\n }\\n\\n this.draw = function() {\\n //-- Called every frame. Processes graphics\\n //-- based on current parameters.\\n //--\\n\\n // skip if marked for invisibility\\n if (this.visibility == false || this.dead == true) {\\n return;\\n }\\n\\n // skip if no stroke color\\n if (!this.stroke_color) {\\n return;\\n }\\n\\n // draw\\n var ctx = this.context;\\n ctx.save();\\n\\n // stroke properties\\n ctx.lineWidth = this.stroke_width;\\n ctx.setLineDash([this.stroke_dash_length, this.stroke_gap_length]);\\n ctx.fillStyle = this.stroke_fill;\\n ctx.strokeStyle = this.stroke_color;\\n\\n // draw circle\\n ctx.beginPath();\\n // (params: cx, cy, radius, start_angle, end_angle, anticlockwise?)\\n ctx.arc(this.cx,this.cy,this.radius,0,2*Math.PI,false);\\n ctx.stroke();\\n if (this.stroke_fill)\\n ctx.fill();\\n\\n ctx.restore();\\n }\\n\\n this.destroy = function() {\\n //-- Marks current instance for deletion\\n //--\\n\\n this.dead = true;\\n this.visibility = false;\\n }\\n\\n this.hide = function() {\\n //-- Marks current instance's visibility to hidden\\n //--\\n\\n this.visibility = false;\\n }\\n\\n this.show = function() {\\n //-- Marks current instance's visibility to shown\\n //--\\n\\n this.visibility = true;\\n }\\n\\n this.is_visible = function() {\\n //-- Returns if self is visible\\n //--\\n\\n return this.visibility;\\n }\\n\\n this.update_more = function() {\\n //-- Called in update. Meant to be over-ridden.\\n //--\\n\\n }\\n\\n this.get_tracker = function() {\\n //-- Returns track point\\n //--\\n\\n return this.tracker;\\n }\\n\\n this.set_tracker = function(track_point) {\\n //-- Sets a new track point\\n //--\\n\\n this.tracker = track_point;\\n }\\n\\n this.get_center = function() {\\n //-- Returns center of circle\\n //--\\n\\n return [this.cx, this.cy];\\n }\\n\\n this.set_center = function(new_center) {\\n //-- Centers self onto a position\\n //--\\n\\n if (this.tracker) {\\n this.tracker[0] += new_center[0] - this.cx;\\n this.tracker[1] += new_center[1] - this.cy;\\n }\\n\\n this.cx = new_center[0];\\n this.cy = new_center[1];\\n }\\n\\n this.shift_pos = function(shiftx, shifty) {\\n //-- Shifts center position\\n //--\\n\\n this.cx += shiftx;\\n this.cy += shifty;\\n\\n if (this.tracker) {\\n this.tracker[0] += shiftx;\\n this.tracker[1] += shifty;\\n }\\n }\\n\\n this.set_pos = function(point) {\\n //-- Translates self where center point\\n //-- is at the given point (proxy to 'set_center')\\n //--\\n\\n this.set_center(point);\\n }\\n\\n this.scale_around = function(scale, point) {\\n //-- Scales x,y center position and radius\\n //-- of self from/to a point\\n //--\\n\\n this.scale_around2(scale, scale, scale, point);\\n }\\n\\n this.scale_around2 = function(scalex, scaley, scaler, point) {\\n //-- Scales x,y center position and radius\\n //-- of self from/to a point\\n //--\\n\\n this.cx = scalex * (this.cx - point[0]) + point[0];\\n this.cy = scaley * (this.cy - point[1]) + point[1];\\n this.radius *= scaler;\\n\\n if (this.tracker) {\\n this.tracker[0] = scalex * (this.tracker[0] - point[0]) + point[0];\\n this.tracker[1] = scaley * (this.tracker[1] - point[1]) + point[1];\\n }\\n }\\n\\n this.rotate_around = function(degrees, point) {\\n //-- Applies a rotation transformation to centerpoint\\n //--\\n\\n var radians = degrees*Math.PI/180*-1;\\n\\n var tmpx = this.cx - point[0];\\n var tmpy = this.cy - point[1];\\n this.cx = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\\n this.cy = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\\n\\n if (this.tracker) {\\n\\n var tmpx = this.tracker[0] - point[0];\\n var tmpy = this.tracker[1] - point[1];\\n this.tracker[0] = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\\n this.tracker[1] = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\\n }\\n }\\n \\n this.copy_base = function() {\\n //-- Copies self using basic properties\\n //--\\n \\n var new_tracker = [this.tracker[0], this.tracker[1]];\\n var new_circle = new SimpleCircle(this.scene,this.radius,new_tracker);\\n new_circle.set_center([this.cx, this.cy]);\\n new_circle.stroke_width = this.stroke_width;\\n new_circle.stroke_dash_length = this.stroke_dash_length;\\n new_circle.stroke_gap_length = this.stroke_gap_length;\\n new_circle.stroke_fill = this.stroke_fill;\\n new_circle.stroke_color = this.stroke_color;\\n new_circle.update_more = this.update_more;\\n return new_circle;\\n }\\n\\n //\\n // proxy functions:\\n //\\n\\n this.offset_position = function(offx, offy) {\\n //-- shift_pos proxy\\n //--\\n\\n this.shift_pos(offx, offy);\\n }\\n\\n this.offset_turn = function(angle, point) {\\n //-- rotate_around proxy\\n //--\\n\\n this.rotate_around(angle, point);\\n }\\n\\n this.offset_scale = function(scale, point) {\\n //-- scale_around proxy\\n //--\\n\\n this.scale_around(scale, point);\\n }\\n}//end SimpleCircle\",\n \"createParticle() {\\n noStroke();\\n fill('rgba(200,169,169,random(0,1)');\\n circle(this.x, this.y, this.r);\\n }\",\n \"function generate_circle(shape, center) {\\n var radius = shape.dimensions['r'];\\n var rotation = shape.rotation;\\n var pinned = shape.pinned;\\n var vertices = [];\\n\\n // Approximate the circle with a polygon\\n var sides = 30; // Number of sides for the polygon approximation\\n var theta = 0;\\n for (var i = 0; i < sides; i++) {\\n theta += (2*Math.PI)/sides;\\n vertices.push({x: (radius * Math.cos(theta)) + center.x,\\n y: radius * Math.sin(theta) + center.y})\\n }\\n\\n // Adjust nodes to be defined from center of shape\\n for (i of shape.nodes) {\\n i['x'] += center.x\\n i['y'] += center.y\\n }\\n\\n new_shape = {\\n vertices: vertices,\\n nodes: shape.nodes,\\n pinned: shape.pinned,\\n center: center\\n }\\n\\n return new_shape;\\n}\",\n \"circlePath (x, y, r) {\\n return \\\"M\\\" + x + \\\",\\\" + y + \\\" \\\" +\\n \\\"m\\\" + -r + \\\", 0 \\\" +\\n \\\"a\\\" + r + \\\",\\\" + r + \\\" 0 1,0 \\\" + r * 2 + \\\",0 \\\" +\\n \\\"a\\\" + r + \\\",\\\" + r + \\\" 0 1,0 \\\" + -r * 2 + \\\",0Z\\\";\\n }\",\n \"function initManyCircles() \\r\\n{\\r\\n\\tfor (let i = 0; i < noc; i++) \\r\\n\\t{\\r\\n\\t\\trandomInitialize();\\r\\n\\r\\n\\t\\tcircleArr.push(new Circle(center_x_pos,center_y_pos,radius,arc_start,arc_end,colour,dx,dy));\\r\\n\\t}\\t\\r\\n}\",\n \"function EvilCircle(x, y, velX, velY, exists, color, size) {\\n Shape.call(this, x, y, 20, 20, exists);\\n this.color = color;\\n this.size = size;\\n}\",\n \"function createCircle (number) {\\n return new Circle({\\n id: number,\\n x: Math.floor((Math.random() * (width - maxCircleRadius)) + maxCircleRadius),\\n y: Math.floor((Math.random() * (height - maxCircleRadius)) + maxCircleRadius),\\n radius: Math.floor((Math.random() * maxCircleRadius) + minCircleRadius),\\n direction: { dirX: Math.random() * animationSpeed, dirY: Math.random() * animationSpeed }\\n })\\n}\",\n \"function Circle ( x, y, r){\\n Shape.call(this,x,y); //powiązanie x y koła z x y kształtu!!\\n this.r = r; \\n\\n}\",\n \"function createFilledCircle(x,y,radius,color){\\n let circle = GOval(x - radius,y - radius,2 * radius,2 * radius);\\n circle.setColor(color);\\n circle.setFilled(true);\\n return circle;\\n }\",\n \"function circle18(x, y, r){\\n for(let a=0; a<1000; a++){\\n context.beginPath()\\n let rt = r * Math.pow(Math.random(), 1/4)\\n let theta = Math.random() * Math.PI * 2\\n const xoff = Math.cos(theta) * rt + x\\n const yoff = Math.sin(theta) * rt + y\\n context.arc(xoff, yoff, 10, 0, 2 * Math.PI)\\n context.stroke()\\n }\\n}\",\n \"constructor (position, speed, radius, color) {\\n this.position = position;\\n this.speed = speed;\\n this.radius = radius;\\n this.color = color;\\n this.imgX = this.position.x - this.radius;\\n }\",\n \"function createCircle() {\\n $.get(\\\"/shape/circle\\\", function (data, status) {\\n var obj = JSON.parse(data);\\n app.drawCircle(obj.loc,obj.radius,obj.color);\\n }, \\\"json\\\");\\n}\",\n \"function Circle(x, y, dx, dy, radius, minimumRadius) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n this.minimumRadius = radius;\\n this.color = colors[Math.round(Math.random() * colors.length - 1)];\\n\\n this.draw = function () {\\n c.beginPath(); //need to have this beginPath to prevent the begin point connect to the previous\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n c.fillStyle = this.color;\\n // c.fillStyle = colors[Math.round(Math.random()*colors.length - 1)] //randomize the color, but this will blink\\n c.fill();\\n };\\n\\n this.update = function() {\\n this.x = this.x + this.dx;\\n this.y = this.y + this.dy;\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n\\n if (this.x > innerWidth - this.radius || this.x < 0 + this.radius) {\\n this.dx = -this.dx;\\n };\\n if (this.y > innerHeight - this.radius || this.y < 0 + this.radius) {\\n this.dy = -this.dy;\\n };\\n\\n //interactivity\\n if (mouse.x - this.x < 50 && mouse.x - this.x > -50 && mouse.y - this.y < 50 && mouse.y - this.y > -50) {\\n if(this.radius < maximumRadius){\\n this.radius += 1;\\n }\\n } else if (this.radius > this.minimumRadius) {\\n this.radius -= 1;\\n } //make sure the circle have a distance from the mouse x horizontally and vertically\\n //and make sure they are within the maximum and minimum radius range;\\n\\n this.draw();\\n }\\n\\n}\",\n \"function drawCircle(context){\\r\\n\\tconsole.log(\\\"drawing circles\\\");\\r\\n\\tfor(i = 0; i < circles.length; i++){\\r\\n\\t\\tcontext.beginPath();\\r\\n\\t\\tvar x = circles[i].xCenter;\\r\\n\\t\\tvar y = circles[i].yCenter;\\r\\n\\t\\tvar radius = circles[i].radius;\\r\\n\\t\\tconsole.log(\\\"drawing a circle at (\\\" + x + \\\", \\\" + y + \\\") with radius\\\" + radius);\\r\\n\\t\\tcontext.arc(x, y, radius, 0, 2*Math.PI);\\r\\n\\t\\tcontext.stroke();\\r\\n\\t}\\r\\n}\",\n \"function createCircle(radius) {\\n let c = {\\n radius,\\n draw: function() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n return c;\\n}\",\n \"createParticle() {\\n noStroke();\\n fill('rgba(200,169,169,1)');\\n circle(this.x,this.y,this.r);\\n }\",\n \"function Circle(radius) {\\n this.radius = radius;\\n}\",\n \"function SequentialCircles(radius) {\\n const gap = 10;\\n const arr = generateRadius(radius, 5);\\n // console.log(arr, 'arr');\\n\\n this.paths = {};\\n\\n let y = gap;\\n for (const r of arr) {\\n // console.log(r, 'r');\\n const circle = new makerjs.paths.Circle([0, y + r], r);\\n y += 2 * r + gap;\\n this.paths['circle_' + r] = circle;\\n }\\n}\",\n \"function Circle(radius) {\\n this.radius = radius; \\n}\",\n \"function newCircle() {\\n x = random(windowWidth);\\n y = random(windowHeight);\\n r = random(255);\\n g = random(255);\\n b = random(255);\\n}\",\n \"constructor(x = 0, y = 0, vx = 0, vy = 0, theta = 0, av = 0, pts = f.geometry.shape.square(), circles = [], density = 1, springConstant = .5) {\\n super(x, y, vx, vy, theta, av, pts, circles, density);\\n }\",\n \"function printCircles(){ /**This function prints out all the coloured circles to the screen*/\\r\\n\\tfor(let i=0;i W+50) c.x = -50;\n\t\t\tif(c.y > H+50) c.y = -50;\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 drawBackground() {\n\t// Draw the background\n\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\n}","function drawBackground() {\n ctx.fillStyle = COLOR_BACKGROUND;\n ctx.fillRect(0, 0, width, height);\n}","function Background() {\n\tctx.beginPath();\n\tctx.rect(0, 0, 1140, 600);\n\tctx.fillStyle = \"black\";\n\tctx.fill();\n}","drawbackground(){\n CTX.fillStyle = \"#41f459\";\n CTX.fillRect(this.x,this.y, this.width, this.height);\n\n\n }","function drawBackground() {\n\tcontext.save();\n\tcontext.fillStyle = \"#f0f0ff\";\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\tcontext.translate(0, canvas.height - 50);\n\tcontext.fillStyle = \"#007f00\";\n\tcontext.fillRect(0, 0, canvas.width, 50);\n\tcontext.restore();\n}","drawBackground() {\n this.cxt.fillStyle = '#FFE5CE'\n this.cxt.fillRect(0, 0, this.width, this.height)\n }","function drawBackground() {\n context.fillStyle = \"gray\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n}","function drawBackground() {\r\n context.drawImage(backgroundCanvas, 0, 0);\r\n }","backgroundDisplay() {\n push();\n rectMode(CORNER);\n noStroke();\n fill(this.color);\n rect(this.x, this.y, this.width, this.height);\n pop()\n }","function drawBG()\n{\n ctx.beginPath();\n ctx.rect(0, 0, DEFAULT_CANVAS_SIZE, DEFAULT_CANVAS_SIZE);\n ctx.fillStyle = '#333'; // Gray\n ctx.fill();\n}","function drawBackground() {\n //drawShadow(); //drawDog shadow beneath dog first\n context.fillStyle = BG_COLOR;\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\n context.fillStyle = '#83B799';\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\n}","function drawBackground() {\n // draw 3x3 copies of the background, offset by the position\n const xOffset = ((x % background.width) + background.width) % background.width;\n const yOffset = ((y % background.height) + background.height) % background.height;\n for (let xPos = -xOffset; xPos < canvas.width; xPos += background.width) {\n for (let yPos = -yOffset; yPos < canvas.height; yPos += background.height) {\n ctx.drawImage(background, xPos, yPos);\n }\n }\n}","function draw() {\n background(\"#222831\");\n}","_drawBackground() {\n const { x, y, width, height } = this.config;\n this._background = this.scene.add.rectangle( x, y, width, height,\n this.config.backgroundColor );\n this._background.setOrigin( 0, 0 );\n }","background(lib){\n lib.moveTo(lib.width/2,lib.height/2);\n lib.penColor(\"black\");\n lib.dot(500);\n }","function drawBackGround() {\n\t//for (let i = 0; i < 14; i++) {\n\t//\tfor (let j = 0; j < 10; j++) {\n\t//\t\tcontext.drawImage(bg, 64*i, 64*j);\n\t//\t}\n\t//}\n\tcontext.drawImage(bg, 0, 0,800,600);\n\n}","drawBackground() {\n const width = this.canvas.width;\n const height = this.canvas.height;\n const radius = this.getBorderRadius();\n this.context.fillStyle = this.getBackgroundColor();\n this.context.beginPath();\n this.context.moveTo(radius, 0);\n this.context.arcTo(width, 0, width, radius, radius);\n this.context.arcTo(width, height, width - radius, height, radius);\n this.context.arcTo(0, height, 0, height - radius, radius);\n this.context.arcTo(0, 0, radius, 0, radius);\n this.context.fill();\n }","function draw() {\n background(220);\n}","function draw() {\n background(204, 153, 0);\n}","function draw(){\r\n background(\"white\");\r\n \r\n \r\n \r\n}","function drawBackground() {\n var STEP_Y = 12,\n TOP_MARGIN = STEP_Y*4,\n LEFT_MARGIN = 35,\n i = context.canvas.height;\n \n context.save();\n\n context.strokeStyle = 'lightgray';\n context.lineWidth = 0.5;\n\n while(i > TOP_MARGIN) { // Draw horizontal lines from bottom up\n context.beginPath();\n context.moveTo(0, i);\n context.lineTo(context.canvas.width, i);\n context.stroke();\n i -= STEP_Y;\n }\n\n // Draw vertical line\n context.strokeStyle = 'rgba(100,0,0,0.3)';\n context.lineWidth = 1;\n\n context.beginPath();\n context.moveTo(LEFT_MARGIN, 0);\n context.lineTo(LEFT_MARGIN, context.canvas.height);\n context.stroke();\n\n context.restore();\n}","function drawBackground() {\n\tcanvasContext.fillStyle = 'black';\n\tcanvasContext.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\n}","function draw() {\n\tbackground(0, 0, 255); // blue background\n}","function drawBackground() {\n // Wasser\n L10_Canvas.crc2.fillStyle = \"#3686e1\";\n L10_Canvas.crc2.fillRect(0, 0, 600, 800);\n // Stein\n L10_Canvas.crc2.fillStyle = \"#768b99\";\n L10_Canvas.crc2.beginPath();\n L10_Canvas.crc2.moveTo(0, 480);\n L10_Canvas.crc2.quadraticCurveTo(320, 450, 350, 650);\n L10_Canvas.crc2.lineTo(0, 600);\n L10_Canvas.crc2.stroke();\n L10_Canvas.crc2.fill();\n // Sand\n L10_Canvas.crc2.fillStyle = \"#ae8f58\";\n L10_Canvas.crc2.beginPath();\n L10_Canvas.crc2.moveTo(0, 600);\n L10_Canvas.crc2.quadraticCurveTo(150, 550, 300, 600);\n L10_Canvas.crc2.quadraticCurveTo(450, 650, 600, 600);\n L10_Canvas.crc2.lineTo(600, 800);\n L10_Canvas.crc2.lineTo(0, 800);\n L10_Canvas.crc2.fill();\n }","function drawBackground() {\n var STEP_Y = 12,\n i = context.canvas.height;\n \n context.strokeStyle = 'rgba(0,0,200,0.225)';\n context.lineWidth = 0.5;\n\n context.save();\n context.restore();\n\n while(i > STEP_Y*4) {\n context.beginPath();\n context.moveTo(0, i);\n context.lineTo(context.canvas.width, i);\n context.stroke();\n i -= STEP_Y;\n }\n\n context.save();\n\n context.strokeStyle = 'rgba(100,0,0,0.3)';\n context.lineWidth = 1;\n\n context.beginPath();\n\n context.moveTo(35,0);\n context.lineTo(35,context.canvas.height);\n context.stroke();\n\n context.restore();\n}","function draw() {\n // Place your drawing code here \n background('black');\n \n image(bg, bgX, 0, bgWidth, bgHeight);\n image(bg, bgX + bgWidth, 0, bgWidth, bgHeight);\n \n// noFill();\n// stroke('white');\n// strokeWeight(3);\n// rect(bgX, 0, bgWidth, bgHeight);\n// rect(bgX + bgWidth, 0, bgWidth, bgHeight);\n \n bgX -= 5;\n if (bgX < -bgWidth) {\n bgX = 0; \n }\n \n}","function drawBG() {\n\tsetBG('#00B2EE');\n\tdrawGrid(16);\n\tlet i;\n\tfor (i = 0; i < levelWidth; i++) {\n\t\tdrawTile(tiles[0], i * 16, canvas.height - 16, 0);\n\t}\n\tdecorateBG();\n}","function background(){\n //background\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, width, height);\n //grid of dots\n ctx.fillStyle = '#AAAAAA';\n for(var h = 50; h < height; h += 50){\n for(var w = 50; w < width; w += 50){\n drawDot(w, h);\n }\n }\n}","drawBackground(ctx) {\n if (this.background) {\n if (!ctx) {\n this.background.draw(this.ctx)\n } else {\n this.background.draw(ctx)\n }\n }\n }","function createBackground(ctx){\n ctx.clearRect(0, 30, 400, 600);\n ctx.fillStyle = bgColour;\n ctx.fillRect(0, 30, 400, 600);\n}","function drawBackground() {\n\n // first clear the the whole canvas\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // this will generate the main gradient (main-light) of wallpaper\n let mainGrd = ctx.createRadialGradient(\n canvas.width / 2, rndNum(-85, -100), 1,\n canvas.width / 2, canvasMax / 4, canvasMin * 1.8);\n mainGrd.addColorStop(.4, \"#1a0003\");\n mainGrd.addColorStop(0, \"#d58801\");\n\n // after creating the gradient and set it colors,\n // we should set it as the fillStyle of the context and\n // paint whole canvas\n ctx.fillStyle = mainGrd;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n}","function drawBackground(chart) {\n\t\tvar background = chart.rect(\n\t\t\twidth,\n\t\t\theight\n\t\t);\n\t\tbackground.move(\n\t\t\tleft,\n\t\t\ttop\n\t\t);\n\t\tbackground.attr({\n\t\t\t\"opacity\": \"0\"\n\t\t});\n\n\t\treturn background;\n\t}","function drawBackground(){\n ctx = myGameArea.context;\n //clear canvas\n ctx.clearRect(0, 0, 6656, 468);\n backgroundImg.draw();\n \n }","drawBg() {\n let ctx = this.bgCanvas.getContext(\"2d\");\n // important: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect\n // using beginPath() after clear() prevents odd behavior\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.lineStyle = \"black\";\n ctx.lineWidth = 1;\n\n // white rectangle for background\n ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);\n }","function drawBackground() {\n var background = new Image();\n background.src = \"plain-bg2.png\";\n background.onload = function() {\n ctx.drawImage(background,0,0,canvas.width, canvas.height)};\n}","function draw_background() {\n\t// fills background\n\tbackground(colors.bg);\n\t// draws golden quadrilateral\n\tnoStroke();\n\tfill(colors.bg_quad);\n\tquad(Math.floor(width / 3), 0, width, Math.floor(height / 3), \n\t\tMath.floor(width / 3 * 2), height, 0, Math.floor(height * .55));\n\n\t// fills in top left w/ custom shape to shape the side of the quadrilateral into a curve\n\tfill(colors.bg_dark);\n\tbeginShape();\n\tvertex(0, 0);\n\tvertex(Math.floor(width / 3), 0);\n\t// temporary variable for computing coordinates of vertices for easy input\n\tlet v = [{x: Math.floor(width * .2), y: Math.floor(height * .2)}, \n\t\t{x: Math.floor(width * .25), y: width * .4}, {x: 0, y: Math.floor(height * .55)}];\n\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\n\tendShape();\n\n\t// fills in top right w/ custom shape to shape other side of quadrilateral\n\tbeginShape();\n\tvertex(Math.floor(width / 3), 0);\n\tvertex(width, 0);\n\tvertex(width, height / 3);\n\tv = [{x: Math.floor(width * .8), y: Math.floor(height * .28)}, \n\t\t{x: Math.floor(width * .55), y: Math.floor(height * .2)}, {x: Math.floor(width / 3), y: 0}];\n\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\n\tendShape();\n}","function drawBackground() {\n // sky\n skyTop.tesselate(HORIZONTAL, 0);\n skyBackground.tesselate(HORIZONTAL, skyTop.height);\n\n // grass blades\n groundHeight = HEIGHT - grass.height * 2;\n for (var pos in grassBladePositions) {\n grassBlade = grassBladePositions[pos];\n grassBlade.draw(pos * grassBlade.width,\n groundHeight - grassBlade.height);\n }\n\n // ground\n grass.tesselate(HORIZONTAL, groundHeight);\n stone.tesselate(HORIZONTAL, groundHeight + grass.height);\n // drawTesselation(stone, HORIZONTAL, lowestHeight);\n}","function showBackground() {\n\n clearGameBoard();\n var background = new Image();\n background.src = 'images/background05.png';\n ctx.drawImage(background, 0, 0, game.width, game.height);\n\n var fontSize = game.width * 0.025;\n ctx.font = fontSize+'pt Calibri';\n\n if (game.width >= 768) {\n ctx.lineWidth = 3.3;\n } else {\n ctx.lineWidth = 1.5;\n }\n \n // stroke color\n ctx.strokeStyle = 'yellow';\n \n ctx.shadowColor = \"rgba(0,0,0,0.3)\";\n\n if (game.width >= 768) {\n ctx.strokeText('Space Invaders', game.width/2 - (fontSize*5), fontSize + 10);\n } else {\n ctx.strokeText('Space Invaders', 160, 15);\n }\n \n\n }","setupBackground() {\n this.bgRect = new paper.Path.Rectangle(new paper.Point(), view.size);\n this.bgRect.fillColor = this.backgroundColor;\n this.bgRect.sendToBack();\n }","function bg(ctx) {\n\tctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n\tctx.fillStyle = '#1c1c1c';\n\tfor (var x = -1; x < ctx.canvas.width + 1; x += cellSize) {\n\t\tctx.fillRect(x, 0, 2, ctx.canvas.height);\n\t}\n\tfor (var y = -1; y < ctx.canvas.height + 1; y += cellSize) {\n\t\tctx.fillRect(0, y, ctx.canvas.width, 2);\n\t}\n}","function drawBackround(){\n ctx.fillStyle = 'rgb(148,229,255)';\n ctx.fillRect(\n 0,\n 0,\n WIDTH,\n HEIGHT\n );\n}","drawBackground(ctx) {\n this.drawHorizonGradient(ctx);\n if(this.moon !== undefined) {\n this.moon.draw(ctx);\n } else {\n this.sun.draw(ctx);\n }\n this.drawTrees(ctx);\n }","draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }","function draw_background(graphics_context, color = \"white\")\n{\n\tgraphics_context.save();\n\n\tgraphics_context.fillStyle = color;\n\tgraphics_context.fillRect\n\t(\n\t\t0, 0,\n\t\tgraphics_context.canvas.width,\n\t\tgraphics_context.canvas.height\n\t);\n\n\tgraphics_context.restore();\n}","function DrawBackground(){\n\n // draw the background\n ctx.fillStyle = trial.background_colour;\n ctx.fillRect(0, 0, trial.canvas_dimensions[0], trial.canvas_dimensions[1]);\n\n // draw the progress text\n ctx.font = \"28px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n var info_text = \"Block \" + counter.block + \" of \" + counter.n_blocks + \", Trial \" + counter.trial + \" of \" + trial.n_trials;\n ctx.fillText(info_text, trial.canvas_dimensions[0]/2, 3* ctx.measureText('M').width/2);\n\n\n }","drawBg() {\n let g = this,\n cxt = g.context,\n sunnum = window._main.sunnum,\n cards = window._main.cards,\n img = imageFromPath(allImg.bg);\n cxt.drawImage(img, 0, 0);\n sunnum.draw(cxt);\n }","function background(col){\r\n ctx.fillStyle = col;\r\n return ctx.fillRect(0,0,creation.width,creation.height);\r\n}","function backgroundGradient() {\n if (ball.x < width) {\n push();\n colorMode(HSB,255);\n background(map(ball.x,0,width,0,255),180,200);\n pop();\n }\n}","function setBackground()\n{\n canvas.style.backgroundColor = 'rgb(' + [paintColor[0],paintColor[1],paintColor[2]].join(',') + ')';\n}","function draw() {\n background(0);\n}","function draw() {\n background(0);\n}","drawGradientBackground() {\n const grd = this.ctx.createLinearGradient(0, 0, this.width, this.height);\n grd.addColorStop(0, '#333333');\n grd.addColorStop(1, '#000000');\n this.ctx.fillStyle = grd;\n this.ctx.fillRect(0, 0, this.width, this.height);\n }","function updateBackground(){\n gameWorld.ctx.fillStyle = \"rgb(0,0,0)\";\n gameWorld.ctx.fillRect(0, 0, gameWorld.canvas.width, gameWorld.canvas.height);\n}","function draw() {\n background(240);\n drawTarget();\n}","function drawFrame(perc) {\n background(backColor);\n}","function drawBackgrounds() {\n for (i = 0; i < 3; i++) {\n addBackgroundObject('./img/background/03_farBG/Completo.png', bg_elem_3_x + i * 1726, -110, 0.45); //far away background layer\n }\n\n for (j = 0; j < 6; j++) {\n addBackgroundObject('./img/background/02_middleBG/completo.png', bg_elem_2_x + j * 1050, 70, 0.28); //middle distanced background layer\n }\n\n for (k = 0; k < 10; k++) {\n addBackgroundObject('./img/background/01_nearBG/completo.png', bg_elem_1_x + k * 960, -30, 0.45); //nearest background layer\n }\n}","function paintBG(ctx, color, dim) {\n\tctx.beginPath();\n\tctx.fillStyle = color;\n ctx.fillRect(0,0,dim[0],dim[1]);\n\tctx.closePath();\t\n}","function draw() {\n drawbackground();\n drawHoles();\n }","draw_background(){\n this.svg.append('rect')\n .attr(\"class\", \"timeline-bg\")\n .attr('y', `${this.label_height - 5}`)\n .attr('x', -5)\n .attr('width', `${this.WIDTH}`)\n .attr('height', '100%')\n }","generateBg() {\n this.addChild(BgContainer.generateRect());\n }","function Background() {\n this.x = 0;\n this.y = 0;\n this.w = bg.width;\n this.h = bg.height;\n this.render = function () {\n context.drawImage(bg, this.x--, 0);\n if(this.x <= -499){\n this.x = 0;\n }\n }\n }","function draw() { \r\n background(234,31,58); // Set the background to black\r\n y = y - 1; \r\n if (y < 2) { \r\n y = height; \r\n } \r\n stroke(234,31,58);\r\n fill(234,31,184);\r\n rect(0, y, width, y); \r\n \r\n stroke(234,31,58);\r\n fill(234,226,128);\r\n rect(0, y, width, y/2); \r\n \r\n stroke(234,31,58);\r\n fill(250,159,114);\r\n rect(0, y, width, y/4); \r\n\r\n}","function createBackground(){\n\t\tvar bg = createSquare(stageWidth, stageHeight, 0, 0, null, Graphics.getRGB(0,0,0,0));\n\t\tstage.addChild( bg );\n\t\tupdate = true;\n\t}","function drawBackground(canvas, settings) {\n const ctx = canvas.getContext(\"2d\");\n ctx.fillStyle = settings.colours.bg;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n}","function drawBackground() {\n let randomNumber = Math.floor(Math.random() * 3);\n if (randomNumber == 2) {\n bgColor = \"whitesmoke\";\n }\n else {\n bgColor = \"black\";\n }\n crc2.fillStyle = bgColor;\n crc2.fillRect(0, 0, crc2.canvas.width, crc2.canvas.height);\n }","function drawBackground(w,h,color= '#000000', width=1,style = 'solid'){\n if(this.background){\n this.removeChild(this.background);\n }\n var background = new PIXI.Graphics();\n const {hex,alpha} = parseColor(color);\n background.beginFill(hex,alpha)\n // drawBackground.lineStyle(width,parseColor(color))\n background.drawRect(\n 0,\n 0,\n w,\n h\n );\n background.endFill();\n this.background = background;\n this.addChildAt(background,0)\n }","redrawBg() {\n this.clearBg();\n this.drawBg();\n }","function drawBackground(W,H) {\n\t\tvar colors = currentColors;\n\n\t\tif(bgCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(bgCtx === null) {\n\t\t\tbgCtx = bgCanvas.getContext(\"2d\");\n\t\t}\n\n\t\tif(!bgCtx) {\n\t\t\t//$log.log(preDebugMsg + \"no canvas to draw bg on\");\n\t\t\treturn;\n\t\t}\n\n\t\tbgCtx.clearRect(0,0, W,H);\n\n\t\tif(colors.hasOwnProperty(\"skin\")) {\n\t\t\tvar drewBack = false;\n\t\t\tif(colors.skin.hasOwnProperty(\"gradient\") && W > 0 && H > 0) {\n\t\t\t\tvar OK = true;\n\t\t\t\tvar grd = bgCtx.createLinearGradient(0,0,W,H);\n\t\t\t\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\n\t\t\t\t\tvar cc = colors.skin.gradient[i];\n\t\t\t\t\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\n\t\t\t\t\t\tgrd.addColorStop(cc.pos, cc.color);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tOK = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(OK) {\n\t\t\t\t\tbgCtx.fillStyle = grd;\n\t\t\t\t\tbgCtx.fillRect(0,0,W,H);\n\t\t\t\t\tdrewBack = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!drewBack && colors.skin.hasOwnProperty(\"color\")) {\n\t\t\t\tbgCtx.fillStyle = colors.skin.color;\n\t\t\t\tbgCtx.fillRect(0,0,W,H);\n\t\t\t\tdrewBack = true;\n\t\t\t}\n\n\t\t\tif(colors.skin.hasOwnProperty(\"border\")) {\n\t\t\t\tbgCtx.fillStyle = colors.skin.border;\n\t\t\t\tbgCtx.fillRect(0,0, W,1);\n\t\t\t\tbgCtx.fillRect(0,H-1, W,H);\n\t\t\t\tbgCtx.fillRect(0,0, 1,H);\n\t\t\t\tbgCtx.fillRect(W-1,0, W,H);\n\t\t\t}\n\t\t}\n\t}","function draw() {\n background(204, 231, 227)\n checkState();\n}","function draw_bg() {\n title = ctx.drawImage(sprites, 13, 11, 321, 34, 0, 0, 399, 34);\n greenTop = ctx.drawImage(sprites, 0, 53, 399, 56, 0, 53, 399, 53);\n purpleTop = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 272, 399, 37);\n\tpurpleBot = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 473, 399, 37);\n}","function Background(x, y, width, height, color) {\n this.x = x; this.y = y; \n this.width = width; this.height = height;\n this.color = color;\n\n // Draw background image to given canvas context\n this.draw = function(surface) {\n surface.beginPath();\n surface.fillStyle = this.color;\n surface.fillRect(this.x, this.y, this.width, this.height);\n }\n }","function draw() {\n background(10,0,40);\n environment.draw()\n}","playbackground1() {\r\n background(\"white\");\r\n\r\n //giving the background image details\r\n background(background_image_one);\r\n\r\n //displaying the variables\r\n\r\n \r\n ground.display();\r\n // drawSprites();\r\n\r\n \r\n \r\n \r\n }","_setBackgroundLayerStyles() {\n this.b.fillStyle = \"white\";\n this.b.fillRect(0, 0, WORLD.WIDTH, WORLD.HEIGHT);\n }","function drawBackgroundSquares() {\n for (var index = 0; index < self.allBackgroundSquares.length; index++) {\n var square = self.allBackgroundSquares[index];\n self.draw.fillStyle = square.color;\n self.draw.fillRect(square.x, square.y, square.width, square.height);\n }\n }","function drawBackground(){\n ctx.drawImage(space, 0, 0, canvas.width, canvas.height);\n switch(levelnum){\n case 0:\n //Free Flight\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\n break;\n case 1:\n //Mercury\n ctx.drawImage(mercuryground, 0,canvas.height-25,canvas.width,25);\n break;\n case 2:\n //Venus\n ctx.drawImage(venusground, 0,canvas.height-25,canvas.width,25);\n break;\n case 3:\n //Moon\n ctx.drawImage(moonground, 0,canvas.height-25,canvas.width,25);\n break;\n case 4:\n //Mars\n ctx.drawImage(marsground, 0,canvas.height-25,canvas.width,25);\n break;\n case 5:\n //Ganymede\n ctx.drawImage(ganymedeground, 0,canvas.height-25,canvas.width,25);\n break;\n case 6:\n //Titan\n ctx.drawImage(titanground, 0,canvas.height-25,canvas.width,25);\n break;\n case 7:\n //Uranus\n ctx.drawImage(uranusground, 0,canvas.height-25,canvas.width,25);\n break;\n case 8:\n //Neptune\n ctx.drawImage(neptuneground, 0,canvas.height-25,canvas.width,25);\n break;\n case 9:\n //Black Hole\n break;\n default:\n //Not recognised\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\n break;\n }\n //bonus landing area\n if (levelnum != 0 && levelnum != 9){\n ctx.fillStyle = \"#00F\";\n ctx.fillRect(800,(canvas.height/2)+300, 100, 10);\n }\n}","create() {\n let background = this.add.image(0, 0, 'background');\n background.displayOriginX = 0;\n background.displayOriginY = 0;\n background.displayWidth = this.sys.canvas.width;\n background.displayHeight = this.sys.canvas.height;\n }","function drawSky() {\n\n addBackgroundobject('./img/background/sky.png', 0, 0, -80, 0.5);\n\n}","function makeBackground(){\n\timg = createImage(width, height);\n\n\timg.loadPixels();\n\tlet xoff = 0;\n\tfor (let i = 0; i < width; i++){\n\n\t\tlet yoff = 0;\n\n\t\tfor (let j = 0; j> 1) * 256;\n\n\t\tbf.position(bgAddress + (scrTile << 10));\n\t\n\t\tfor(let i=0;i<16;i++) {\n\t\t\tfor(let j=0;j<16;j++) {\n\t\t\t\t\t\t\n\t\t\t\tlet tile = bf.getShort() + 0x6800;\n\t\t\t\tlet flag = bf.get();\n\t\t\t\tlet pal = bf.get();\n\t\t\t\tif(hideBackground) {\t// hide background based on flag and color, 0x10 maybe the switch\n\t\t\t\t\tlet hide = flag & 0xF;\n\t\t\t\t\tif((pal & 0x80) == 0)\n\t\t\t\t\t\thide = 16;\n\t\t\t\t\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20), hide);\n\t\t\t\t} else \n\t\t\t\t\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20));\n\t\t\t\tctxBack.putImageData(imageData, scrx + (i)%32 * gridHeight, scry + (j) * gridWidth);\n\t\t\t}\n\t\t}\n\t}\n\n}","function Background() {\n\n // Implement abstract function draw\n this.draw = function() {\n this.context.drawImage(imageRepository.background, this.x, this.y);\n };\n}","function drawBackground(W,H) {\n\t\tvar colors = $scope.gimme(\"GroupColors\");\n\t\tif(typeof colors === 'string') {\n\t\t\tcolors = JSON.parse(colors);\n\t\t}\n\n\t\tif(colors.hasOwnProperty(\"skin\")) {\n\t\t\tvar drewBack = false\n\t\t\tif(colors.skin.hasOwnProperty(\"gradient\")) {\n\t\t\t\tvar OK = true;\n\n\t\t\t\tvar grd = ctx.createLinearGradient(0,0,W,H);\n\t\t\t\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\n\t\t\t\t\tvar cc = colors.skin.gradient[i];\n\t\t\t\t\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\n\t\t\t\t\t\tgrd.addColorStop(cc.pos, cc.color);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tOK = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(OK) {\n\t\t\t\t\tctx.fillStyle = grd;\n\t\t\t\t\tctx.fillRect(0,0,W,H);\n\t\t\t\t\tdrewBack = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!drewBack && colors.skin.hasOwnProperty(\"color\")) {\n\t\t\t\tctx.fillStyle = colors.skin.color;\n\t\t\t\tctx.fillRect(0,0,W,H);\n\t\t\t\tdrewBack = true;\n\t\t\t}\n\n\t\t\tif(colors.skin.hasOwnProperty(\"border\")) {\n\t\t\t\tctx.fillStyle = colors.skin.border;\n\t\t\t\tctx.fillRect(0,0, W,1);\n\t\t\t\tctx.fillRect(0,H-1, W,H);\n\t\t\t\tctx.fillRect(0,0, 1,H);\n\t\t\t\tctx.fillRect(W-1,0, W,H);\n\t\t\t}\n\t\t}\n\t}","function createBackground() {\n\t\t\tbg = new createjs.Shape();\t\t\n\t\t\tstage.addChild(bg);\n \t}","_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}","function draw() {\n background(255,0,0)\n rectMode(CENTER)\n rect(250.250,100,100)\n}","function displayBg() \n{\n\tvar bg = new Image();\n\tbg.src = \"Images/background.jpg\";\n\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\n}","function drawBackground() {\n\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n timePassedSinceHurt = new Date().getTime() - lastHurtStarted;\n timePassedSinceDead = new Date().getTime() - deadStarted;\n\n drawSky();\n drawHills();\n drawClouds();\n drawShadows();\n drawGround();\n}","function drawBG() {\n magicalCanvas.crc2.clearRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n if (day == true) {\n //sky\n magicalCanvas.crc2.fillStyle = \"skyblue\";\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n //background\n magicalCanvas.crc2.fillStyle = \"limegreen\";\n magicalCanvas.crc2.strokeStyle = \"limegreen\";\n magicalCanvas.crc2.lineWidth = 2;\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 50);\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 250, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 50);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n //foreground\n magicalCanvas.crc2.fillStyle = \"forestgreen\";\n magicalCanvas.crc2.strokeStyle = \"forestgreen\";\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 150);\n magicalCanvas.crc2.bezierCurveTo(20, magicalCanvas.canvas.height - 150, 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 20);\n magicalCanvas.crc2.bezierCurveTo(magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 150, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 150);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n }\n else {\n //sky\n magicalCanvas.crc2.fillStyle = \"#252D3F\";\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n //background\n magicalCanvas.crc2.fillStyle = \"#142615\";\n magicalCanvas.crc2.strokeStyle = \"#142615\";\n magicalCanvas.crc2.lineWidth = 2;\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 30);\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 270, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 30);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n }\n }","function Background() {\n\tthis.speed = 1; // Redefine speed of the background for panning\n\t\n\t// Implement abstract function\n\tthis.draw = function() {\n\t\t// Pan background\n\t\tthis.x -= this.speed;\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y);\n\t\t\n\t\t// Draw another image at the top edge of the first image\n\t\tthis.context.drawImage(imageRepository.background, this.x + this.canvasWidth, this.y);\n\n\t\t// If the image scrolled off the screen, reset\n\t\tif (this.x <= -this.canvasWidth)\n\t\t\tthis.x = 0;\n\t};\n}","function Background() {\n this.speed = 1; // Redefine speed of the background for panning\n // Implement abstract function\n this.draw = function() {\n // Pan background\n this.x -= this.speed;\n this.context.drawImage(imageRepository.background, this.x, this.y);\n // Draw another image at the top edge of the first image\n this.context.drawImage(imageRepository.background, this.x - this.canvasWidth, this.y);\n // If the image scrolled off the screen, reset\n if (this.x >= this.canvasWidth) {\n this.x = 0;\n }\n };\n}","function drawBackground(width, height, color, x, y, type) {\n this.gamearea = gameArea;\n this.type = type;\n if (type == 'image' || type == 'background') {\n this.image = new Image();\n this.image.src = color;\n }\n this.width = width;\n this.height = height;\n this.speedX = 0;\n this.speedY = 0;\n this.x = x;\n this.y = y;\n this.update = function() {\n ctx = gameArea.context;\n if (type == 'image' || type == 'background') {\n ctx.drawImage(this.image,\n this.x,\n this.y,\n this.width, this.height);\n\n if (type == 'background') {\n ctx.drawImage(this.image,\n this.x + this.width,\n this.y,\n this.width, this.height);\n }\n }\n else {\n ctx.fillStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }\n }\n this.newPos = function() {\n this.x += this.speedX;\n this.y += this.speedY;\n if (this.type == 'background') {\n if (this.x == -(this.width)) {\n this.x = 0;\n }\n }\n }\n this.clicked = function () {\n let myleft = this.x;\n let myright = this.x + (this.width);\n let mytop = this.y;\n let mybottom = this.y + (this.height);\n var clicked = true;\n if ((mybottom < gameArea.y) || (mytop > gameArea.y) || (myright < gameArea.x) || (myleft > gameArea.x)) {\n clicked = false;\n }\n return clicked;\n }\n}","createBackground() {\n const canvas = document.getElementById(\"background\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = window.innerWidth;\n //save some space for the footer\n canvas.height = window.innerHeight;\n //clear previous canvas to avoid memory leaks\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n this.RED_OFFSET = Math.floor(Math.random() * (MAX_RED - MIN_RED)) + MIN_RED; \n this.GREEN_OFFSET = Math.floor(Math.random() * (MAX_GREEN - MIN_GREEN)) + MIN_GREEN; \n this.BLUE_OFFSET = Math.floor(Math.random() * (MAX_BLUE - MIN_BLUE)) + MIN_BLUE; \n //each overlapping layer will contain randomly drawn shapes and colors\n this.canvasLayers = new Array(NUM_LAYERS);\n //parameters that will be fed into the drawLayer on each iteration. These will be updated each time\n //we call the drawLayer function\n const step = Math.floor(window.width / this.canvasLayers.length);\n const parameters = {\n blue: 150,\n green: 155, \n red: 255,\n position: 0,\n step: step\n }\n\n for (let position = 0; position < this.canvasLayers.length; position++) {\n parameters.position = position;\n this.drawLayer(canvas, ctx, parameters);\n }\n\n this.drawClouds(canvas, ctx);\n this.drawSun(canvas, ctx);\n }","function Background()\n{\n\tthis.speed = 1; // Redefine speed of the background for panning\n\t// Implement abstract function\n\tthis.draw = function()\n {\n\t\t// Pan background\n\t\tthis.y += this.speed;\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y);\n\t\t// Draw another image at the top edge of the first image\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y - this.canvasHeight);\n\t\t// If the image scrolled off the screen, reset\n\t\tif (this.y >= this.canvasHeight)\n\t\t\tthis.y = 0;\n\n\t};\n}","initBackground() {\n\t\tthis.background = new createjs.Shape();\n\t\tthis.background.graphics.beginFill(\"black\").drawRect(0, 0, this.width, this.height);\n\t\tthis.background.x = 0;\n\t\tthis.background.y = 0;\n\t\tthis.stage.addChild(this.background);\n\t\t//this.updateStage();\n\t}","function drawBackground() {\n\t\n\tif (backgroundImg.width >= canvas.width) {\n\t\t// If the image has fully passed through screen, reset x to default position and\n\t\t// draw again \n\t\tif (x <= -(backgroundImg.width + canvas.width)) \n\t\t{ \n\t\t\tx = -canvas.width;\n\t\t}\n\t\t\t\n\t\tif (x <= -(backgroundImg.width - canvas.width)) \n\t\t{ \n\t\t\t// Continuing to draw image if it's width runs out\n\t\t\tctx.drawImage(backgroundImg, (x + backgroundImg.width), 0, \n\t\t\tbackgroundImg.width, backgroundImg.height); \n\t\t}\n\t}\n\n\t// Drawing a new image from canvas.width\n\tctx.drawImage(backgroundImg, x, 0, backgroundImg.width, backgroundImg.height);\t\n\n\t// Amount for the x on image to move left each frame\n\tx -= xv;\t\n}","function Background() {\n\n // Implement abstract function\n this.draw = function () {\n this.context.drawImage(imageRepository.background, this.x, this.y);\n };\n}","animate(ctx){\n this.drawBackground(ctx);\n }","function createBackground() {\n\tvar background = document.createElementNS($SVG_LIB, \"rect\");\n\tbackground.setAttribute(\"id\", \"background\");\n\tbackground.setAttribute(\"fill\", backgroundColor);\n\tbackground.setAttribute(\"height\", size * height);\n\tbackground.setAttribute(\"width\", size * width);\n\tdocument.getElementById(\"components\").appendChild(background);\n}","background(r, g, b) {\n this.ctx.canvas.style.backgroundColor = getColorString(this.palette, r, g, b);\n }","function draw(context) {\n context.drawImage(background, ofsetted_x, ofsetted_y);\n debug.do_draw('panels') && draw_debug(context);\n }"],"string":"[\n \"function drawBackground() {\\n\\t// Draw the background\\n\\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\\n}\",\n \"function drawBackground() {\\n ctx.fillStyle = COLOR_BACKGROUND;\\n ctx.fillRect(0, 0, width, height);\\n}\",\n \"function Background() {\\n\\tctx.beginPath();\\n\\tctx.rect(0, 0, 1140, 600);\\n\\tctx.fillStyle = \\\"black\\\";\\n\\tctx.fill();\\n}\",\n \"drawbackground(){\\n CTX.fillStyle = \\\"#41f459\\\";\\n CTX.fillRect(this.x,this.y, this.width, this.height);\\n\\n\\n }\",\n \"function drawBackground() {\\n\\tcontext.save();\\n\\tcontext.fillStyle = \\\"#f0f0ff\\\";\\n\\tcontext.fillRect(0, 0, canvas.width, canvas.height);\\n\\tcontext.translate(0, canvas.height - 50);\\n\\tcontext.fillStyle = \\\"#007f00\\\";\\n\\tcontext.fillRect(0, 0, canvas.width, 50);\\n\\tcontext.restore();\\n}\",\n \"drawBackground() {\\n this.cxt.fillStyle = '#FFE5CE'\\n this.cxt.fillRect(0, 0, this.width, this.height)\\n }\",\n \"function drawBackground() {\\n context.fillStyle = \\\"gray\\\";\\n context.fillRect(0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawBackground() {\\r\\n context.drawImage(backgroundCanvas, 0, 0);\\r\\n }\",\n \"backgroundDisplay() {\\n push();\\n rectMode(CORNER);\\n noStroke();\\n fill(this.color);\\n rect(this.x, this.y, this.width, this.height);\\n pop()\\n }\",\n \"function drawBG()\\n{\\n ctx.beginPath();\\n ctx.rect(0, 0, DEFAULT_CANVAS_SIZE, DEFAULT_CANVAS_SIZE);\\n ctx.fillStyle = '#333'; // Gray\\n ctx.fill();\\n}\",\n \"function drawBackground() {\\n //drawShadow(); //drawDog shadow beneath dog first\\n context.fillStyle = BG_COLOR;\\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\\n context.fillStyle = '#83B799';\\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\\n}\",\n \"function drawBackground() {\\n // draw 3x3 copies of the background, offset by the position\\n const xOffset = ((x % background.width) + background.width) % background.width;\\n const yOffset = ((y % background.height) + background.height) % background.height;\\n for (let xPos = -xOffset; xPos < canvas.width; xPos += background.width) {\\n for (let yPos = -yOffset; yPos < canvas.height; yPos += background.height) {\\n ctx.drawImage(background, xPos, yPos);\\n }\\n }\\n}\",\n \"function draw() {\\n background(\\\"#222831\\\");\\n}\",\n \"_drawBackground() {\\n const { x, y, width, height } = this.config;\\n this._background = this.scene.add.rectangle( x, y, width, height,\\n this.config.backgroundColor );\\n this._background.setOrigin( 0, 0 );\\n }\",\n \"background(lib){\\n lib.moveTo(lib.width/2,lib.height/2);\\n lib.penColor(\\\"black\\\");\\n lib.dot(500);\\n }\",\n \"function drawBackGround() {\\n\\t//for (let i = 0; i < 14; i++) {\\n\\t//\\tfor (let j = 0; j < 10; j++) {\\n\\t//\\t\\tcontext.drawImage(bg, 64*i, 64*j);\\n\\t//\\t}\\n\\t//}\\n\\tcontext.drawImage(bg, 0, 0,800,600);\\n\\n}\",\n \"drawBackground() {\\n const width = this.canvas.width;\\n const height = this.canvas.height;\\n const radius = this.getBorderRadius();\\n this.context.fillStyle = this.getBackgroundColor();\\n this.context.beginPath();\\n this.context.moveTo(radius, 0);\\n this.context.arcTo(width, 0, width, radius, radius);\\n this.context.arcTo(width, height, width - radius, height, radius);\\n this.context.arcTo(0, height, 0, height - radius, radius);\\n this.context.arcTo(0, 0, radius, 0, radius);\\n this.context.fill();\\n }\",\n \"function draw() {\\n background(220);\\n}\",\n \"function draw() {\\n background(204, 153, 0);\\n}\",\n \"function draw(){\\r\\n background(\\\"white\\\");\\r\\n \\r\\n \\r\\n \\r\\n}\",\n \"function drawBackground() {\\n var STEP_Y = 12,\\n TOP_MARGIN = STEP_Y*4,\\n LEFT_MARGIN = 35,\\n i = context.canvas.height;\\n \\n context.save();\\n\\n context.strokeStyle = 'lightgray';\\n context.lineWidth = 0.5;\\n\\n while(i > TOP_MARGIN) { // Draw horizontal lines from bottom up\\n context.beginPath();\\n context.moveTo(0, i);\\n context.lineTo(context.canvas.width, i);\\n context.stroke();\\n i -= STEP_Y;\\n }\\n\\n // Draw vertical line\\n context.strokeStyle = 'rgba(100,0,0,0.3)';\\n context.lineWidth = 1;\\n\\n context.beginPath();\\n context.moveTo(LEFT_MARGIN, 0);\\n context.lineTo(LEFT_MARGIN, context.canvas.height);\\n context.stroke();\\n\\n context.restore();\\n}\",\n \"function drawBackground() {\\n\\tcanvasContext.fillStyle = 'black';\\n\\tcanvasContext.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\\n}\",\n \"function draw() {\\n\\tbackground(0, 0, 255); // blue background\\n}\",\n \"function drawBackground() {\\n // Wasser\\n L10_Canvas.crc2.fillStyle = \\\"#3686e1\\\";\\n L10_Canvas.crc2.fillRect(0, 0, 600, 800);\\n // Stein\\n L10_Canvas.crc2.fillStyle = \\\"#768b99\\\";\\n L10_Canvas.crc2.beginPath();\\n L10_Canvas.crc2.moveTo(0, 480);\\n L10_Canvas.crc2.quadraticCurveTo(320, 450, 350, 650);\\n L10_Canvas.crc2.lineTo(0, 600);\\n L10_Canvas.crc2.stroke();\\n L10_Canvas.crc2.fill();\\n // Sand\\n L10_Canvas.crc2.fillStyle = \\\"#ae8f58\\\";\\n L10_Canvas.crc2.beginPath();\\n L10_Canvas.crc2.moveTo(0, 600);\\n L10_Canvas.crc2.quadraticCurveTo(150, 550, 300, 600);\\n L10_Canvas.crc2.quadraticCurveTo(450, 650, 600, 600);\\n L10_Canvas.crc2.lineTo(600, 800);\\n L10_Canvas.crc2.lineTo(0, 800);\\n L10_Canvas.crc2.fill();\\n }\",\n \"function drawBackground() {\\n var STEP_Y = 12,\\n i = context.canvas.height;\\n \\n context.strokeStyle = 'rgba(0,0,200,0.225)';\\n context.lineWidth = 0.5;\\n\\n context.save();\\n context.restore();\\n\\n while(i > STEP_Y*4) {\\n context.beginPath();\\n context.moveTo(0, i);\\n context.lineTo(context.canvas.width, i);\\n context.stroke();\\n i -= STEP_Y;\\n }\\n\\n context.save();\\n\\n context.strokeStyle = 'rgba(100,0,0,0.3)';\\n context.lineWidth = 1;\\n\\n context.beginPath();\\n\\n context.moveTo(35,0);\\n context.lineTo(35,context.canvas.height);\\n context.stroke();\\n\\n context.restore();\\n}\",\n \"function draw() {\\n // Place your drawing code here \\n background('black');\\n \\n image(bg, bgX, 0, bgWidth, bgHeight);\\n image(bg, bgX + bgWidth, 0, bgWidth, bgHeight);\\n \\n// noFill();\\n// stroke('white');\\n// strokeWeight(3);\\n// rect(bgX, 0, bgWidth, bgHeight);\\n// rect(bgX + bgWidth, 0, bgWidth, bgHeight);\\n \\n bgX -= 5;\\n if (bgX < -bgWidth) {\\n bgX = 0; \\n }\\n \\n}\",\n \"function drawBG() {\\n\\tsetBG('#00B2EE');\\n\\tdrawGrid(16);\\n\\tlet i;\\n\\tfor (i = 0; i < levelWidth; i++) {\\n\\t\\tdrawTile(tiles[0], i * 16, canvas.height - 16, 0);\\n\\t}\\n\\tdecorateBG();\\n}\",\n \"function background(){\\n //background\\n ctx.fillStyle = '#000000';\\n ctx.fillRect(0, 0, width, height);\\n //grid of dots\\n ctx.fillStyle = '#AAAAAA';\\n for(var h = 50; h < height; h += 50){\\n for(var w = 50; w < width; w += 50){\\n drawDot(w, h);\\n }\\n }\\n}\",\n \"drawBackground(ctx) {\\n if (this.background) {\\n if (!ctx) {\\n this.background.draw(this.ctx)\\n } else {\\n this.background.draw(ctx)\\n }\\n }\\n }\",\n \"function createBackground(ctx){\\n ctx.clearRect(0, 30, 400, 600);\\n ctx.fillStyle = bgColour;\\n ctx.fillRect(0, 30, 400, 600);\\n}\",\n \"function drawBackground() {\\n\\n // first clear the the whole canvas\\n ctx.clearRect(0, 0, canvas.width, canvas.height);\\n\\n // this will generate the main gradient (main-light) of wallpaper\\n let mainGrd = ctx.createRadialGradient(\\n canvas.width / 2, rndNum(-85, -100), 1,\\n canvas.width / 2, canvasMax / 4, canvasMin * 1.8);\\n mainGrd.addColorStop(.4, \\\"#1a0003\\\");\\n mainGrd.addColorStop(0, \\\"#d58801\\\");\\n\\n // after creating the gradient and set it colors,\\n // we should set it as the fillStyle of the context and\\n // paint whole canvas\\n ctx.fillStyle = mainGrd;\\n ctx.fillRect(0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawBackground(chart) {\\n\\t\\tvar background = chart.rect(\\n\\t\\t\\twidth,\\n\\t\\t\\theight\\n\\t\\t);\\n\\t\\tbackground.move(\\n\\t\\t\\tleft,\\n\\t\\t\\ttop\\n\\t\\t);\\n\\t\\tbackground.attr({\\n\\t\\t\\t\\\"opacity\\\": \\\"0\\\"\\n\\t\\t});\\n\\n\\t\\treturn background;\\n\\t}\",\n \"function drawBackground(){\\n ctx = myGameArea.context;\\n //clear canvas\\n ctx.clearRect(0, 0, 6656, 468);\\n backgroundImg.draw();\\n \\n }\",\n \"drawBg() {\\n let ctx = this.bgCanvas.getContext(\\\"2d\\\");\\n // important: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect\\n // using beginPath() after clear() prevents odd behavior\\n ctx.beginPath();\\n ctx.fillStyle = \\\"white\\\";\\n ctx.lineStyle = \\\"black\\\";\\n ctx.lineWidth = 1;\\n\\n // white rectangle for background\\n ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);\\n }\",\n \"function drawBackground() {\\n var background = new Image();\\n background.src = \\\"plain-bg2.png\\\";\\n background.onload = function() {\\n ctx.drawImage(background,0,0,canvas.width, canvas.height)};\\n}\",\n \"function draw_background() {\\n\\t// fills background\\n\\tbackground(colors.bg);\\n\\t// draws golden quadrilateral\\n\\tnoStroke();\\n\\tfill(colors.bg_quad);\\n\\tquad(Math.floor(width / 3), 0, width, Math.floor(height / 3), \\n\\t\\tMath.floor(width / 3 * 2), height, 0, Math.floor(height * .55));\\n\\n\\t// fills in top left w/ custom shape to shape the side of the quadrilateral into a curve\\n\\tfill(colors.bg_dark);\\n\\tbeginShape();\\n\\tvertex(0, 0);\\n\\tvertex(Math.floor(width / 3), 0);\\n\\t// temporary variable for computing coordinates of vertices for easy input\\n\\tlet v = [{x: Math.floor(width * .2), y: Math.floor(height * .2)}, \\n\\t\\t{x: Math.floor(width * .25), y: width * .4}, {x: 0, y: Math.floor(height * .55)}];\\n\\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\\n\\tendShape();\\n\\n\\t// fills in top right w/ custom shape to shape other side of quadrilateral\\n\\tbeginShape();\\n\\tvertex(Math.floor(width / 3), 0);\\n\\tvertex(width, 0);\\n\\tvertex(width, height / 3);\\n\\tv = [{x: Math.floor(width * .8), y: Math.floor(height * .28)}, \\n\\t\\t{x: Math.floor(width * .55), y: Math.floor(height * .2)}, {x: Math.floor(width / 3), y: 0}];\\n\\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\\n\\tendShape();\\n}\",\n \"function drawBackground() {\\n // sky\\n skyTop.tesselate(HORIZONTAL, 0);\\n skyBackground.tesselate(HORIZONTAL, skyTop.height);\\n\\n // grass blades\\n groundHeight = HEIGHT - grass.height * 2;\\n for (var pos in grassBladePositions) {\\n grassBlade = grassBladePositions[pos];\\n grassBlade.draw(pos * grassBlade.width,\\n groundHeight - grassBlade.height);\\n }\\n\\n // ground\\n grass.tesselate(HORIZONTAL, groundHeight);\\n stone.tesselate(HORIZONTAL, groundHeight + grass.height);\\n // drawTesselation(stone, HORIZONTAL, lowestHeight);\\n}\",\n \"function showBackground() {\\n\\n clearGameBoard();\\n var background = new Image();\\n background.src = 'images/background05.png';\\n ctx.drawImage(background, 0, 0, game.width, game.height);\\n\\n var fontSize = game.width * 0.025;\\n ctx.font = fontSize+'pt Calibri';\\n\\n if (game.width >= 768) {\\n ctx.lineWidth = 3.3;\\n } else {\\n ctx.lineWidth = 1.5;\\n }\\n \\n // stroke color\\n ctx.strokeStyle = 'yellow';\\n \\n ctx.shadowColor = \\\"rgba(0,0,0,0.3)\\\";\\n\\n if (game.width >= 768) {\\n ctx.strokeText('Space Invaders', game.width/2 - (fontSize*5), fontSize + 10);\\n } else {\\n ctx.strokeText('Space Invaders', 160, 15);\\n }\\n \\n\\n }\",\n \"setupBackground() {\\n this.bgRect = new paper.Path.Rectangle(new paper.Point(), view.size);\\n this.bgRect.fillColor = this.backgroundColor;\\n this.bgRect.sendToBack();\\n }\",\n \"function bg(ctx) {\\n\\tctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\\n\\tctx.fillStyle = '#1c1c1c';\\n\\tfor (var x = -1; x < ctx.canvas.width + 1; x += cellSize) {\\n\\t\\tctx.fillRect(x, 0, 2, ctx.canvas.height);\\n\\t}\\n\\tfor (var y = -1; y < ctx.canvas.height + 1; y += cellSize) {\\n\\t\\tctx.fillRect(0, y, ctx.canvas.width, 2);\\n\\t}\\n}\",\n \"function drawBackround(){\\n ctx.fillStyle = 'rgb(148,229,255)';\\n ctx.fillRect(\\n 0,\\n 0,\\n WIDTH,\\n HEIGHT\\n );\\n}\",\n \"drawBackground(ctx) {\\n this.drawHorizonGradient(ctx);\\n if(this.moon !== undefined) {\\n this.moon.draw(ctx);\\n } else {\\n this.sun.draw(ctx);\\n }\\n this.drawTrees(ctx);\\n }\",\n \"draw() {\\n // Displaying the background\\n image(hubImage, 0, 0, width, height);\\n }\",\n \"function draw_background(graphics_context, color = \\\"white\\\")\\n{\\n\\tgraphics_context.save();\\n\\n\\tgraphics_context.fillStyle = color;\\n\\tgraphics_context.fillRect\\n\\t(\\n\\t\\t0, 0,\\n\\t\\tgraphics_context.canvas.width,\\n\\t\\tgraphics_context.canvas.height\\n\\t);\\n\\n\\tgraphics_context.restore();\\n}\",\n \"function DrawBackground(){\\n\\n // draw the background\\n ctx.fillStyle = trial.background_colour;\\n ctx.fillRect(0, 0, trial.canvas_dimensions[0], trial.canvas_dimensions[1]);\\n\\n // draw the progress text\\n ctx.font = \\\"28px Arial\\\";\\n ctx.fillStyle = \\\"white\\\";\\n ctx.textAlign = \\\"center\\\";\\n var info_text = \\\"Block \\\" + counter.block + \\\" of \\\" + counter.n_blocks + \\\", Trial \\\" + counter.trial + \\\" of \\\" + trial.n_trials;\\n ctx.fillText(info_text, trial.canvas_dimensions[0]/2, 3* ctx.measureText('M').width/2);\\n\\n\\n }\",\n \"drawBg() {\\n let g = this,\\n cxt = g.context,\\n sunnum = window._main.sunnum,\\n cards = window._main.cards,\\n img = imageFromPath(allImg.bg);\\n cxt.drawImage(img, 0, 0);\\n sunnum.draw(cxt);\\n }\",\n \"function background(col){\\r\\n ctx.fillStyle = col;\\r\\n return ctx.fillRect(0,0,creation.width,creation.height);\\r\\n}\",\n \"function backgroundGradient() {\\n if (ball.x < width) {\\n push();\\n colorMode(HSB,255);\\n background(map(ball.x,0,width,0,255),180,200);\\n pop();\\n }\\n}\",\n \"function setBackground()\\n{\\n canvas.style.backgroundColor = 'rgb(' + [paintColor[0],paintColor[1],paintColor[2]].join(',') + ')';\\n}\",\n \"function draw() {\\n background(0);\\n}\",\n \"function draw() {\\n background(0);\\n}\",\n \"drawGradientBackground() {\\n const grd = this.ctx.createLinearGradient(0, 0, this.width, this.height);\\n grd.addColorStop(0, '#333333');\\n grd.addColorStop(1, '#000000');\\n this.ctx.fillStyle = grd;\\n this.ctx.fillRect(0, 0, this.width, this.height);\\n }\",\n \"function updateBackground(){\\n gameWorld.ctx.fillStyle = \\\"rgb(0,0,0)\\\";\\n gameWorld.ctx.fillRect(0, 0, gameWorld.canvas.width, gameWorld.canvas.height);\\n}\",\n \"function draw() {\\n background(240);\\n drawTarget();\\n}\",\n \"function drawFrame(perc) {\\n background(backColor);\\n}\",\n \"function drawBackgrounds() {\\n for (i = 0; i < 3; i++) {\\n addBackgroundObject('./img/background/03_farBG/Completo.png', bg_elem_3_x + i * 1726, -110, 0.45); //far away background layer\\n }\\n\\n for (j = 0; j < 6; j++) {\\n addBackgroundObject('./img/background/02_middleBG/completo.png', bg_elem_2_x + j * 1050, 70, 0.28); //middle distanced background layer\\n }\\n\\n for (k = 0; k < 10; k++) {\\n addBackgroundObject('./img/background/01_nearBG/completo.png', bg_elem_1_x + k * 960, -30, 0.45); //nearest background layer\\n }\\n}\",\n \"function paintBG(ctx, color, dim) {\\n\\tctx.beginPath();\\n\\tctx.fillStyle = color;\\n ctx.fillRect(0,0,dim[0],dim[1]);\\n\\tctx.closePath();\\t\\n}\",\n \"function draw() {\\n drawbackground();\\n drawHoles();\\n }\",\n \"draw_background(){\\n this.svg.append('rect')\\n .attr(\\\"class\\\", \\\"timeline-bg\\\")\\n .attr('y', `${this.label_height - 5}`)\\n .attr('x', -5)\\n .attr('width', `${this.WIDTH}`)\\n .attr('height', '100%')\\n }\",\n \"generateBg() {\\n this.addChild(BgContainer.generateRect());\\n }\",\n \"function Background() {\\n this.x = 0;\\n this.y = 0;\\n this.w = bg.width;\\n this.h = bg.height;\\n this.render = function () {\\n context.drawImage(bg, this.x--, 0);\\n if(this.x <= -499){\\n this.x = 0;\\n }\\n }\\n }\",\n \"function draw() { \\r\\n background(234,31,58); // Set the background to black\\r\\n y = y - 1; \\r\\n if (y < 2) { \\r\\n y = height; \\r\\n } \\r\\n stroke(234,31,58);\\r\\n fill(234,31,184);\\r\\n rect(0, y, width, y); \\r\\n \\r\\n stroke(234,31,58);\\r\\n fill(234,226,128);\\r\\n rect(0, y, width, y/2); \\r\\n \\r\\n stroke(234,31,58);\\r\\n fill(250,159,114);\\r\\n rect(0, y, width, y/4); \\r\\n\\r\\n}\",\n \"function createBackground(){\\n\\t\\tvar bg = createSquare(stageWidth, stageHeight, 0, 0, null, Graphics.getRGB(0,0,0,0));\\n\\t\\tstage.addChild( bg );\\n\\t\\tupdate = true;\\n\\t}\",\n \"function drawBackground(canvas, settings) {\\n const ctx = canvas.getContext(\\\"2d\\\");\\n ctx.fillStyle = settings.colours.bg;\\n ctx.fillRect(0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawBackground() {\\n let randomNumber = Math.floor(Math.random() * 3);\\n if (randomNumber == 2) {\\n bgColor = \\\"whitesmoke\\\";\\n }\\n else {\\n bgColor = \\\"black\\\";\\n }\\n crc2.fillStyle = bgColor;\\n crc2.fillRect(0, 0, crc2.canvas.width, crc2.canvas.height);\\n }\",\n \"function drawBackground(w,h,color= '#000000', width=1,style = 'solid'){\\n if(this.background){\\n this.removeChild(this.background);\\n }\\n var background = new PIXI.Graphics();\\n const {hex,alpha} = parseColor(color);\\n background.beginFill(hex,alpha)\\n // drawBackground.lineStyle(width,parseColor(color))\\n background.drawRect(\\n 0,\\n 0,\\n w,\\n h\\n );\\n background.endFill();\\n this.background = background;\\n this.addChildAt(background,0)\\n }\",\n \"redrawBg() {\\n this.clearBg();\\n this.drawBg();\\n }\",\n \"function drawBackground(W,H) {\\n\\t\\tvar colors = currentColors;\\n\\n\\t\\tif(bgCanvas === null) {\\n\\t\\t\\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\\n\\t\\t\\tif(myCanvasElement.length > 0) {\\n\\t\\t\\t\\tbgCanvas = myCanvasElement[0];\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\t//$log.log(preDebugMsg + \\\"no canvas to draw on!\\\");\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif(bgCtx === null) {\\n\\t\\t\\tbgCtx = bgCanvas.getContext(\\\"2d\\\");\\n\\t\\t}\\n\\n\\t\\tif(!bgCtx) {\\n\\t\\t\\t//$log.log(preDebugMsg + \\\"no canvas to draw bg on\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tbgCtx.clearRect(0,0, W,H);\\n\\n\\t\\tif(colors.hasOwnProperty(\\\"skin\\\")) {\\n\\t\\t\\tvar drewBack = false;\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"gradient\\\") && W > 0 && H > 0) {\\n\\t\\t\\t\\tvar OK = true;\\n\\t\\t\\t\\tvar grd = bgCtx.createLinearGradient(0,0,W,H);\\n\\t\\t\\t\\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\\n\\t\\t\\t\\t\\tvar cc = colors.skin.gradient[i];\\n\\t\\t\\t\\t\\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\\n\\t\\t\\t\\t\\t\\tgrd.addColorStop(cc.pos, cc.color);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\tOK = false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(OK) {\\n\\t\\t\\t\\t\\tbgCtx.fillStyle = grd;\\n\\t\\t\\t\\t\\tbgCtx.fillRect(0,0,W,H);\\n\\t\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(!drewBack && colors.skin.hasOwnProperty(\\\"color\\\")) {\\n\\t\\t\\t\\tbgCtx.fillStyle = colors.skin.color;\\n\\t\\t\\t\\tbgCtx.fillRect(0,0,W,H);\\n\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"border\\\")) {\\n\\t\\t\\t\\tbgCtx.fillStyle = colors.skin.border;\\n\\t\\t\\t\\tbgCtx.fillRect(0,0, W,1);\\n\\t\\t\\t\\tbgCtx.fillRect(0,H-1, W,H);\\n\\t\\t\\t\\tbgCtx.fillRect(0,0, 1,H);\\n\\t\\t\\t\\tbgCtx.fillRect(W-1,0, W,H);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function draw() {\\n background(204, 231, 227)\\n checkState();\\n}\",\n \"function draw_bg() {\\n title = ctx.drawImage(sprites, 13, 11, 321, 34, 0, 0, 399, 34);\\n greenTop = ctx.drawImage(sprites, 0, 53, 399, 56, 0, 53, 399, 53);\\n purpleTop = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 272, 399, 37);\\n\\tpurpleBot = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 473, 399, 37);\\n}\",\n \"function Background(x, y, width, height, color) {\\n this.x = x; this.y = y; \\n this.width = width; this.height = height;\\n this.color = color;\\n\\n // Draw background image to given canvas context\\n this.draw = function(surface) {\\n surface.beginPath();\\n surface.fillStyle = this.color;\\n surface.fillRect(this.x, this.y, this.width, this.height);\\n }\\n }\",\n \"function draw() {\\n background(10,0,40);\\n environment.draw()\\n}\",\n \"playbackground1() {\\r\\n background(\\\"white\\\");\\r\\n\\r\\n //giving the background image details\\r\\n background(background_image_one);\\r\\n\\r\\n //displaying the variables\\r\\n\\r\\n \\r\\n ground.display();\\r\\n // drawSprites();\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n }\",\n \"_setBackgroundLayerStyles() {\\n this.b.fillStyle = \\\"white\\\";\\n this.b.fillRect(0, 0, WORLD.WIDTH, WORLD.HEIGHT);\\n }\",\n \"function drawBackgroundSquares() {\\n for (var index = 0; index < self.allBackgroundSquares.length; index++) {\\n var square = self.allBackgroundSquares[index];\\n self.draw.fillStyle = square.color;\\n self.draw.fillRect(square.x, square.y, square.width, square.height);\\n }\\n }\",\n \"function drawBackground(){\\n ctx.drawImage(space, 0, 0, canvas.width, canvas.height);\\n switch(levelnum){\\n case 0:\\n //Free Flight\\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 1:\\n //Mercury\\n ctx.drawImage(mercuryground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 2:\\n //Venus\\n ctx.drawImage(venusground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 3:\\n //Moon\\n ctx.drawImage(moonground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 4:\\n //Mars\\n ctx.drawImage(marsground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 5:\\n //Ganymede\\n ctx.drawImage(ganymedeground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 6:\\n //Titan\\n ctx.drawImage(titanground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 7:\\n //Uranus\\n ctx.drawImage(uranusground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 8:\\n //Neptune\\n ctx.drawImage(neptuneground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 9:\\n //Black Hole\\n break;\\n default:\\n //Not recognised\\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\\n break;\\n }\\n //bonus landing area\\n if (levelnum != 0 && levelnum != 9){\\n ctx.fillStyle = \\\"#00F\\\";\\n ctx.fillRect(800,(canvas.height/2)+300, 100, 10);\\n }\\n}\",\n \"create() {\\n let background = this.add.image(0, 0, 'background');\\n background.displayOriginX = 0;\\n background.displayOriginY = 0;\\n background.displayWidth = this.sys.canvas.width;\\n background.displayHeight = this.sys.canvas.height;\\n }\",\n \"function drawSky() {\\n\\n addBackgroundobject('./img/background/sky.png', 0, 0, -80, 0.5);\\n\\n}\",\n \"function makeBackground(){\\n\\timg = createImage(width, height);\\n\\n\\timg.loadPixels();\\n\\tlet xoff = 0;\\n\\tfor (let i = 0; i < width; i++){\\n\\n\\t\\tlet yoff = 0;\\n\\n\\t\\tfor (let j = 0; j> 1) * 256;\\n\\n\\t\\tbf.position(bgAddress + (scrTile << 10));\\n\\t\\n\\t\\tfor(let i=0;i<16;i++) {\\n\\t\\t\\tfor(let j=0;j<16;j++) {\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tlet tile = bf.getShort() + 0x6800;\\n\\t\\t\\t\\tlet flag = bf.get();\\n\\t\\t\\t\\tlet pal = bf.get();\\n\\t\\t\\t\\tif(hideBackground) {\\t// hide background based on flag and color, 0x10 maybe the switch\\n\\t\\t\\t\\t\\tlet hide = flag & 0xF;\\n\\t\\t\\t\\t\\tif((pal & 0x80) == 0)\\n\\t\\t\\t\\t\\t\\thide = 16;\\n\\t\\t\\t\\t\\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20), hide);\\n\\t\\t\\t\\t} else \\n\\t\\t\\t\\t\\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20));\\n\\t\\t\\t\\tctxBack.putImageData(imageData, scrx + (i)%32 * gridHeight, scry + (j) * gridWidth);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n}\",\n \"function Background() {\\n\\n // Implement abstract function draw\\n this.draw = function() {\\n this.context.drawImage(imageRepository.background, this.x, this.y);\\n };\\n}\",\n \"function drawBackground(W,H) {\\n\\t\\tvar colors = $scope.gimme(\\\"GroupColors\\\");\\n\\t\\tif(typeof colors === 'string') {\\n\\t\\t\\tcolors = JSON.parse(colors);\\n\\t\\t}\\n\\n\\t\\tif(colors.hasOwnProperty(\\\"skin\\\")) {\\n\\t\\t\\tvar drewBack = false\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"gradient\\\")) {\\n\\t\\t\\t\\tvar OK = true;\\n\\n\\t\\t\\t\\tvar grd = ctx.createLinearGradient(0,0,W,H);\\n\\t\\t\\t\\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\\n\\t\\t\\t\\t\\tvar cc = colors.skin.gradient[i];\\n\\t\\t\\t\\t\\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\\n\\t\\t\\t\\t\\t\\tgrd.addColorStop(cc.pos, cc.color);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\tOK = false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(OK) {\\n\\t\\t\\t\\t\\tctx.fillStyle = grd;\\n\\t\\t\\t\\t\\tctx.fillRect(0,0,W,H);\\n\\t\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(!drewBack && colors.skin.hasOwnProperty(\\\"color\\\")) {\\n\\t\\t\\t\\tctx.fillStyle = colors.skin.color;\\n\\t\\t\\t\\tctx.fillRect(0,0,W,H);\\n\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"border\\\")) {\\n\\t\\t\\t\\tctx.fillStyle = colors.skin.border;\\n\\t\\t\\t\\tctx.fillRect(0,0, W,1);\\n\\t\\t\\t\\tctx.fillRect(0,H-1, W,H);\\n\\t\\t\\t\\tctx.fillRect(0,0, 1,H);\\n\\t\\t\\t\\tctx.fillRect(W-1,0, W,H);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function createBackground() {\\n\\t\\t\\tbg = new createjs.Shape();\\t\\t\\n\\t\\t\\tstage.addChild(bg);\\n \\t}\",\n \"_draw_all(){\\r\\n\\t\\tthis._draw_bg();\\r\\n\\t\\tthis._draw_fg();\\r\\n\\t}\",\n \"function draw() {\\n background(255,0,0)\\n rectMode(CENTER)\\n rect(250.250,100,100)\\n}\",\n \"function displayBg() \\n{\\n\\tvar bg = new Image();\\n\\tbg.src = \\\"Images/background.jpg\\\";\\n\\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\\n}\",\n \"function drawBackground() {\\n\\n ctx.fillStyle = \\\"white\\\";\\n ctx.fillRect(0, 0, canvas.width, canvas.height);\\n\\n timePassedSinceHurt = new Date().getTime() - lastHurtStarted;\\n timePassedSinceDead = new Date().getTime() - deadStarted;\\n\\n drawSky();\\n drawHills();\\n drawClouds();\\n drawShadows();\\n drawGround();\\n}\",\n \"function drawBG() {\\n magicalCanvas.crc2.clearRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n if (day == true) {\\n //sky\\n magicalCanvas.crc2.fillStyle = \\\"skyblue\\\";\\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n //background\\n magicalCanvas.crc2.fillStyle = \\\"limegreen\\\";\\n magicalCanvas.crc2.strokeStyle = \\\"limegreen\\\";\\n magicalCanvas.crc2.lineWidth = 2;\\n magicalCanvas.crc2.beginPath();\\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 50);\\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 250, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 50);\\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.closePath();\\n magicalCanvas.crc2.fill();\\n magicalCanvas.crc2.stroke();\\n //foreground\\n magicalCanvas.crc2.fillStyle = \\\"forestgreen\\\";\\n magicalCanvas.crc2.strokeStyle = \\\"forestgreen\\\";\\n magicalCanvas.crc2.beginPath();\\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 150);\\n magicalCanvas.crc2.bezierCurveTo(20, magicalCanvas.canvas.height - 150, 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 20);\\n magicalCanvas.crc2.bezierCurveTo(magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 150, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 150);\\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.closePath();\\n magicalCanvas.crc2.fill();\\n magicalCanvas.crc2.stroke();\\n }\\n else {\\n //sky\\n magicalCanvas.crc2.fillStyle = \\\"#252D3F\\\";\\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n //background\\n magicalCanvas.crc2.fillStyle = \\\"#142615\\\";\\n magicalCanvas.crc2.strokeStyle = \\\"#142615\\\";\\n magicalCanvas.crc2.lineWidth = 2;\\n magicalCanvas.crc2.beginPath();\\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 30);\\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 270, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 30);\\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.closePath();\\n magicalCanvas.crc2.fill();\\n magicalCanvas.crc2.stroke();\\n }\\n }\",\n \"function Background() {\\n\\tthis.speed = 1; // Redefine speed of the background for panning\\n\\t\\n\\t// Implement abstract function\\n\\tthis.draw = function() {\\n\\t\\t// Pan background\\n\\t\\tthis.x -= this.speed;\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x, this.y);\\n\\t\\t\\n\\t\\t// Draw another image at the top edge of the first image\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x + this.canvasWidth, this.y);\\n\\n\\t\\t// If the image scrolled off the screen, reset\\n\\t\\tif (this.x <= -this.canvasWidth)\\n\\t\\t\\tthis.x = 0;\\n\\t};\\n}\",\n \"function Background() {\\n this.speed = 1; // Redefine speed of the background for panning\\n // Implement abstract function\\n this.draw = function() {\\n // Pan background\\n this.x -= this.speed;\\n this.context.drawImage(imageRepository.background, this.x, this.y);\\n // Draw another image at the top edge of the first image\\n this.context.drawImage(imageRepository.background, this.x - this.canvasWidth, this.y);\\n // If the image scrolled off the screen, reset\\n if (this.x >= this.canvasWidth) {\\n this.x = 0;\\n }\\n };\\n}\",\n \"function drawBackground(width, height, color, x, y, type) {\\n this.gamearea = gameArea;\\n this.type = type;\\n if (type == 'image' || type == 'background') {\\n this.image = new Image();\\n this.image.src = color;\\n }\\n this.width = width;\\n this.height = height;\\n this.speedX = 0;\\n this.speedY = 0;\\n this.x = x;\\n this.y = y;\\n this.update = function() {\\n ctx = gameArea.context;\\n if (type == 'image' || type == 'background') {\\n ctx.drawImage(this.image,\\n this.x,\\n this.y,\\n this.width, this.height);\\n\\n if (type == 'background') {\\n ctx.drawImage(this.image,\\n this.x + this.width,\\n this.y,\\n this.width, this.height);\\n }\\n }\\n else {\\n ctx.fillStyle = color;\\n ctx.fillRect(this.x, this.y, this.width, this.height);\\n }\\n }\\n this.newPos = function() {\\n this.x += this.speedX;\\n this.y += this.speedY;\\n if (this.type == 'background') {\\n if (this.x == -(this.width)) {\\n this.x = 0;\\n }\\n }\\n }\\n this.clicked = function () {\\n let myleft = this.x;\\n let myright = this.x + (this.width);\\n let mytop = this.y;\\n let mybottom = this.y + (this.height);\\n var clicked = true;\\n if ((mybottom < gameArea.y) || (mytop > gameArea.y) || (myright < gameArea.x) || (myleft > gameArea.x)) {\\n clicked = false;\\n }\\n return clicked;\\n }\\n}\",\n \"createBackground() {\\n const canvas = document.getElementById(\\\"background\\\");\\n const ctx = canvas.getContext(\\\"2d\\\");\\n canvas.width = window.innerWidth;\\n //save some space for the footer\\n canvas.height = window.innerHeight;\\n //clear previous canvas to avoid memory leaks\\n ctx.clearRect(0, 0, canvas.width, canvas.height);\\n this.RED_OFFSET = Math.floor(Math.random() * (MAX_RED - MIN_RED)) + MIN_RED; \\n this.GREEN_OFFSET = Math.floor(Math.random() * (MAX_GREEN - MIN_GREEN)) + MIN_GREEN; \\n this.BLUE_OFFSET = Math.floor(Math.random() * (MAX_BLUE - MIN_BLUE)) + MIN_BLUE; \\n //each overlapping layer will contain randomly drawn shapes and colors\\n this.canvasLayers = new Array(NUM_LAYERS);\\n //parameters that will be fed into the drawLayer on each iteration. These will be updated each time\\n //we call the drawLayer function\\n const step = Math.floor(window.width / this.canvasLayers.length);\\n const parameters = {\\n blue: 150,\\n green: 155, \\n red: 255,\\n position: 0,\\n step: step\\n }\\n\\n for (let position = 0; position < this.canvasLayers.length; position++) {\\n parameters.position = position;\\n this.drawLayer(canvas, ctx, parameters);\\n }\\n\\n this.drawClouds(canvas, ctx);\\n this.drawSun(canvas, ctx);\\n }\",\n \"function Background()\\n{\\n\\tthis.speed = 1; // Redefine speed of the background for panning\\n\\t// Implement abstract function\\n\\tthis.draw = function()\\n {\\n\\t\\t// Pan background\\n\\t\\tthis.y += this.speed;\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x, this.y);\\n\\t\\t// Draw another image at the top edge of the first image\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x, this.y - this.canvasHeight);\\n\\t\\t// If the image scrolled off the screen, reset\\n\\t\\tif (this.y >= this.canvasHeight)\\n\\t\\t\\tthis.y = 0;\\n\\n\\t};\\n}\",\n \"initBackground() {\\n\\t\\tthis.background = new createjs.Shape();\\n\\t\\tthis.background.graphics.beginFill(\\\"black\\\").drawRect(0, 0, this.width, this.height);\\n\\t\\tthis.background.x = 0;\\n\\t\\tthis.background.y = 0;\\n\\t\\tthis.stage.addChild(this.background);\\n\\t\\t//this.updateStage();\\n\\t}\",\n \"function drawBackground() {\\n\\t\\n\\tif (backgroundImg.width >= canvas.width) {\\n\\t\\t// If the image has fully passed through screen, reset x to default position and\\n\\t\\t// draw again \\n\\t\\tif (x <= -(backgroundImg.width + canvas.width)) \\n\\t\\t{ \\n\\t\\t\\tx = -canvas.width;\\n\\t\\t}\\n\\t\\t\\t\\n\\t\\tif (x <= -(backgroundImg.width - canvas.width)) \\n\\t\\t{ \\n\\t\\t\\t// Continuing to draw image if it's width runs out\\n\\t\\t\\tctx.drawImage(backgroundImg, (x + backgroundImg.width), 0, \\n\\t\\t\\tbackgroundImg.width, backgroundImg.height); \\n\\t\\t}\\n\\t}\\n\\n\\t// Drawing a new image from canvas.width\\n\\tctx.drawImage(backgroundImg, x, 0, backgroundImg.width, backgroundImg.height);\\t\\n\\n\\t// Amount for the x on image to move left each frame\\n\\tx -= xv;\\t\\n}\",\n \"function Background() {\\n\\n // Implement abstract function\\n this.draw = function () {\\n this.context.drawImage(imageRepository.background, this.x, this.y);\\n };\\n}\",\n \"animate(ctx){\\n this.drawBackground(ctx);\\n }\",\n \"function createBackground() {\\n\\tvar background = document.createElementNS($SVG_LIB, \\\"rect\\\");\\n\\tbackground.setAttribute(\\\"id\\\", \\\"background\\\");\\n\\tbackground.setAttribute(\\\"fill\\\", backgroundColor);\\n\\tbackground.setAttribute(\\\"height\\\", size * height);\\n\\tbackground.setAttribute(\\\"width\\\", size * width);\\n\\tdocument.getElementById(\\\"components\\\").appendChild(background);\\n}\",\n \"background(r, g, b) {\\n this.ctx.canvas.style.backgroundColor = getColorString(this.palette, r, g, b);\\n }\",\n \"function draw(context) {\\n context.drawImage(background, ofsetted_x, ofsetted_y);\\n debug.do_draw('panels') && draw_debug(context);\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.840327","0.83144766","0.8288564","0.8146599","0.81359756","0.81241894","0.80891436","0.8056861","0.802413","0.8013045","0.79130584","0.78841805","0.78572387","0.78559095","0.78409606","0.78127265","0.77953005","0.7791962","0.7768092","0.77617973","0.7738038","0.77342945","0.77248245","0.77241486","0.7712989","0.76777774","0.764632","0.75916797","0.75373816","0.75309384","0.7508517","0.7503374","0.74968505","0.7478999","0.7446551","0.74352896","0.7427754","0.7424929","0.7381953","0.73799103","0.7347159","0.7341219","0.7307525","0.7274661","0.72481024","0.7234932","0.7227836","0.7122677","0.70993006","0.7094605","0.7094605","0.7089473","0.7080205","0.708018","0.7079015","0.70762545","0.7066231","0.70617986","0.70501876","0.70451623","0.7041397","0.70226234","0.6999996","0.69867986","0.696276","0.69625485","0.6954444","0.6949504","0.6947391","0.69445324","0.6934798","0.69335264","0.6925623","0.6919596","0.6916067","0.6912107","0.690659","0.6905616","0.6903135","0.6900676","0.688","0.68653226","0.68524194","0.68479335","0.68332165","0.68237644","0.68102497","0.6806546","0.6785522","0.6755144","0.67523926","0.67478704","0.6743007","0.6734922","0.6730787","0.6720739","0.6720129","0.67140764","0.67115873","0.6703872","0.6692029"],"string":"[\n \"0.840327\",\n \"0.83144766\",\n \"0.8288564\",\n \"0.8146599\",\n \"0.81359756\",\n \"0.81241894\",\n \"0.80891436\",\n \"0.8056861\",\n \"0.802413\",\n \"0.8013045\",\n \"0.79130584\",\n \"0.78841805\",\n \"0.78572387\",\n \"0.78559095\",\n \"0.78409606\",\n \"0.78127265\",\n \"0.77953005\",\n \"0.7791962\",\n \"0.7768092\",\n \"0.77617973\",\n \"0.7738038\",\n \"0.77342945\",\n \"0.77248245\",\n \"0.77241486\",\n \"0.7712989\",\n \"0.76777774\",\n \"0.764632\",\n \"0.75916797\",\n \"0.75373816\",\n \"0.75309384\",\n \"0.7508517\",\n \"0.7503374\",\n \"0.74968505\",\n \"0.7478999\",\n \"0.7446551\",\n \"0.74352896\",\n \"0.7427754\",\n \"0.7424929\",\n \"0.7381953\",\n \"0.73799103\",\n \"0.7347159\",\n \"0.7341219\",\n \"0.7307525\",\n \"0.7274661\",\n \"0.72481024\",\n \"0.7234932\",\n \"0.7227836\",\n \"0.7122677\",\n \"0.70993006\",\n \"0.7094605\",\n \"0.7094605\",\n \"0.7089473\",\n \"0.7080205\",\n \"0.708018\",\n \"0.7079015\",\n \"0.70762545\",\n \"0.7066231\",\n \"0.70617986\",\n \"0.70501876\",\n \"0.70451623\",\n \"0.7041397\",\n \"0.70226234\",\n \"0.6999996\",\n \"0.69867986\",\n \"0.696276\",\n \"0.69625485\",\n \"0.6954444\",\n \"0.6949504\",\n \"0.6947391\",\n \"0.69445324\",\n \"0.6934798\",\n \"0.69335264\",\n \"0.6925623\",\n \"0.6919596\",\n \"0.6916067\",\n \"0.6912107\",\n \"0.690659\",\n \"0.6905616\",\n \"0.6903135\",\n \"0.6900676\",\n \"0.688\",\n \"0.68653226\",\n \"0.68524194\",\n \"0.68479335\",\n \"0.68332165\",\n \"0.68237644\",\n \"0.68102497\",\n \"0.6806546\",\n \"0.6785522\",\n \"0.6755144\",\n \"0.67523926\",\n \"0.67478704\",\n \"0.6743007\",\n \"0.6734922\",\n \"0.6730787\",\n \"0.6720739\",\n \"0.6720129\",\n \"0.67140764\",\n \"0.67115873\",\n \"0.6703872\",\n \"0.6692029\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":35,"cells":{"query":{"kind":"string","value":"Filtrar por nombre y especie"},"document":{"kind":"string","value":"function handleFilter(data) {\n if (data.key === \"name\") {\n return setFilterName(data.value);\n } else if (data.key === \"species\") {\n return setFilterSpecies(data.value);\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 filtrarProd(){\nlet filtrado = productos.filter(prod => {\n \n return prod.nombre.toLowerCase().includes($(\"#txtFiltrar\").val().toLowerCase())\n})\nlistarProductos(filtrado)\n$(\"#txtFiltrar\").val(\"\")\n}","function filtro() {\n let selectorSexo = document.getElementById(\"selectorSexo\");\n let inputNombre = document.getElementById(\"inombre\");\n\n const sexo = selectorSexo.value;\n const nombre = inputNombre.value.trim().toLowerCase();\n\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\n console.debug(\"personas %o\", personas);\n\n //creamos una copia para no modificar el original\n let personasFiltradas = personas.map((el) => el);\n\n //filtrar por sexo, si es 't' todos no hace falta filtrar\n if (sexo == \"h\" || sexo == \"m\") {\n personasFiltradas = personasFiltradas.filter((el) => el.sexo == sexo);\n console.debug(\"filtrado por sexo %o\", personasFiltradas);\n }\n\n //filtrar por nombre buscado\n if (nombre != \" \") {\n personasFiltradas = personasFiltradas.filter((el) =>\n el.nombre.toLowerCase().includes(nombre)\n );\n console.debug(\"filtrado por nombre %o\", personasFiltradas);\n }\n\n maquetarLista(personasFiltradas);\n}","function filtrar(value) {\n $(\".items\").filter(function () {\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);//SI ES DIFERENTE A -1 ES QUE ENCONTRO\n });\n}","function filterNames() {\n //3.1. get value of filterInput and convert it to upper case for comparision\n let filterValue = filterInput.value.toUpperCase();\n\n //3.2. get ul containing all the names\n let nameList = document.querySelector('.list');\n\n //3.3. get all the names from the nameList in a array\n let namesArray = Array.from(nameList.querySelectorAll('.list__item'));\n\n //3.4. loop through namesArray to compare filterValue with the names in the namesArray\n for (let i = 0; i < namesArray.length; i++){\n //3.4.1. get currentname\n let currentname = namesArray[i].innerText.toUpperCase();\n //3.4.2 compare both the names\n if(currentname.indexOf(filterValue) > -1){\n //if matched do nothing\n namesArray[i].style.display ='';\n }else{\n //else display none\n namesArray[i].style.display ='none';\n }\n }\n}","function filtre_texte(txt) {\r\n tabObj = tabObjInit.filter(function (elm) {\r\n var pattern = new RegExp(\"(\" + txt + \")\", 'ig');\r\n if ( elm.Nom.match(pattern) ) {\r\n return true;\r\n } else {\r\n return false\r\n }\r\n });\r\n ecrit_liste(tabObj);\r\n}","async function filtrarNomes(){\n let valorInput = filterInput.value.charAt(0).toUpperCase() + filterInput.value.toLowerCase().substring(1);\n let nomes = buscarDadosNoJSON();\n \n nomes.then((nomeDoJSON) => {\n let resultados = nomeDoJSON.filter(nome => {\n let regex = new RegExp(`${valorInput}`, 'gi');\n return nome.name.match(regex);\n });\n\n if(resultados.length > 0)\n mostrarResultados(resultados)\n });\n }","filtrarSugerencias(resultado, busqueda){\n \n //filtrar con .filter\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\n console.log(filtro);\n \n //mostrar los pines\n this.mostrarPines(filtro);\n }","function filterNames() {\r\n //Search value, list items, pokemon names\r\n const filterValue = searchResult.value.toLowerCase(); //Gets search value\r\n const pokemonListLi = pokemonList.querySelectorAll('li'); //Gets list items\r\n const pokemonListNames = pokemonList.querySelectorAll('.pokemon-name'); //Gets pokemon names\r\n\r\n for (let i = 0; i < pokemonListNames.length; i++) {\r\n /*if at least one value of search appears in name, list item stays\r\n if value of search never occurs, list item is hidden*/\r\n if (pokemonListNames[i].textContent.toLowerCase().indexOf(filterValue) > -1) {\r\n pokemonListLi[i].style.display = '';\r\n } else {\r\n pokemonListLi[i].style.display = 'none';\r\n }\r\n }\r\n}","function filterItem (){\n let filter = valorfilter();\n estructuraFilter = \"\";\n if (filter == \"Prime\"){\n for (propiedad of carrito) {\n if (propiedad.premium) imprimirItemFilter(propiedad);\n }\n noItenCarrito();\n } else if (filter == \"Todos\") {\n estructuraPrincipalCarrito();\n } \n}","function filterByName (data) {\n const arrCard = document.querySelectorAll('.card');\n const searchInput = document.querySelector('.search-input');\n const arrName = [...document.querySelectorAll('#name')];\n searchInput.addEventListener('input', elInput => {\n const gallery = document.querySelector('#gallery');\n let dataArr = [];\n gallery.innerHTML = '';\n data.map(card => {\n let name = card.name.first + card.name.last;\n if(name.match(elInput.target.value)) {\n createCardsNew (card);\n dataArr.push(card);\n }\n });\n byClickCreateModal (dataArr);\n });\n}","function filterNames(event) {\n let searchString = event.target.value.toLowerCase()\n\n $lis.forEach((li) => {\n if (li.querySelector('a').innerText.toLowerCase().includes(searchString)) {\n li.style.display = ''\n }\n else {\n li.style.display = 'none'\n }\n })\n}","function filterBySearchTerm(){\n let inputName = document.querySelector('#input-pokemon-name').value;\n let pokemonNames = arrayOfPokemon.filter(pokemon => pokemon.name.startsWith(inputName));\n\n let inputType = document.querySelector('#input-pokemon-type').value;\n let pokemonTypes = arrayOfPokemon.filter(pokemon => pokemon.primary_type.startsWith(inputType));\n\n if (inputName !== \"\"){\n document.querySelector('#pokemon-list').innerText = '';\n displayList(pokemonNames);\n } else if (inputType !== \"\"){\n document.querySelector('#pokemon-list').innerText = '';\n displayList(pokemonTypes);\n } else if (inputName == \"\" && inputType == \"\"){\n let pokemonList = document.querySelector('#pokemon-list');\n pokemonList.innerHTML = \"\";\n displayList(arrayOfPokemon);\n };\n}","function filterMovies(titlename) {\r\n const filteredMovies = movies.filter(word => word.Title.includes(titlename));\r\n addMoviesToDom(filteredMovies);\r\n}","function filtros1(){\n\t\n\t\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#empleados tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}","function filterBy(filter) {\n JsontoHTML()\n for (let i = 0; i < all_html.length; i++) {\n let c = databaseObj[i];\n let genre = (JSON.parse(c[\"genres\"]))\n for (let a = 0; a < genre.length; a++) {\n if (genre[a][\"name\"] === filter) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }\n }\n storage()\n }","function filterByName(name){\n document.querySelectorAll('.card').forEach(el => {\n if(el.querySelector('h3').innerText.toLowerCase().indexOf(name.toLowerCase()) > -1){\n el.classList.remove('hidden')\n }else{\n el.classList.add('hidden')\n }\n })\n }","function ObtenerResultadosFiltrados(){\n var comparar=[];\n $(selector+' .campoFiltrado input.campoBlancoTextoSeleccion').each(function(i,campo){\n if(ValidarCadena($(campo).val())){\n comparar.push(\n $(campo).attr('identificador')\n );\n }\n });\n return descargasGenerales.filter(function(elemento){\n if(comparar.length==0){\n return true;\n }\n for(let i=0;i {\n if (item.textContent.toUpperCase().indexOf(filterValue) > -1) {\n item.parentElement.style.display = \"\";\n } else {\n item.parentElement.style.display = \"none\";\n }\n });\n}","function filtresPers(searchFilter) {\n\t\treturn listPers.filter(p => p.nom.includes(searchFilter)||p.prenom.includes(searchFilter)||p.nomBiblio.includes(searchFilter)||p.titre.includes(searchFilter));\n\t}","function filterNames() {\n // Get the input value\n\n let filterValue = document.getElementById('filterInput').value.toUpperCase();\n\n // Get the ul\n\n let ul = document.getElementById('names');\n\n // Get the lis from ul , an array would also be created from this\n let li = ul.querySelectorAll('li.collection-item');\n\n // Loop through \n\nfor( let i=0; i < li.length; i++) {\n let a = li[i].getElementsByTagName('a')[0];\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\n li[i].style.display = '';\n } else {\n li[i].style.display = 'none'\n }\n}\n}","function filterAndSearch(films, searched, filtered, num) {\n\titems.innerHTML = \"\";\n\tvar arrayOne = [];\n\tvar arrayTwo = [];\n\tvar filmRating;\n\tfor (var i=0; iMath.round(slider.noUiSlider.get()[0])&&filmRatingGenre: \" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\n\t\t}\n\t}\n\tif (items.innerHTML == \"\") {\n\t\titems.innerHTML = \"No Results Found\";\n\t}\n}","function searchConcepto() {\n\tvar input, i, filter, li, ul, txtValue;\n\tinput = document.getElementById('buscarConcepto');\n\tfilter = input.value.toUpperCase();\n\t//collection-item getElementsByClassName('prueba') ;\n\tlet array_aux = document.getElementById('listadoconceptos').getElementsByTagName('A');\n\t//console.log(array_aux);\n\tfor (i = 0; i < array_aux.length; i++) {\n\t\ta = array_aux[i].getAttribute('concepto');\n\t\ttxtValue = a;\n\t\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tarray_aux[i].parentElement.style.display = '';\n\t\t} else {\n\t\t\tarray_aux[i].parentElement.style.display = 'none';\n\t\t}\n\t}\n}","function searchData(){\n var dd = dList\n var q = document.getElementById('filter').value;\n var data = dd.filter(function (thisData) {\n return thisData.name.toLowerCase().includes(q) ||\n thisData.rotation_period.includes(q) ||\n thisData.orbital_period.includes(q) || \n thisData.diameter.includes(q) || \n thisData.climate.includes(q) ||\n thisData.gravity.includes(q) || \n thisData.terrain.includes(q) || \n thisData.surface_water.includes (q) ||\n thisData.population.includes(q)\n });\n showData(data); // mengirim data ke function showData\n}","function filtro(tmpIdDecada, filtro) {\n\n // Violencias\n $(\"#\" + tmpIdDecada + \" .flt\").show();\n\n for (var tmpObra in arrayDecadas) {\n // todo get\n if (filtro === \"filtro_1\") {\n }\n if (getIDByCollection(tmpIdDecada) == arrayDecadas[tmpObra][\"collection_name\"]\n && arrayDecadas[tmpObra][\"violencias\"] == filtro) {\n $(\"#i-\" + decadas[\"ID\"]).addClass(\"flt\").hide();\n }\n }\n\n}","function filterEmployee() {\n // Declare variables\n const input = document.querySelector('input');\n const filter = input.value.toUpperCase();\n let name = document.querySelectorAll('.name');\n const heading4 = document.querySelectorAll('h4')\n const card = document.querySelectorAll('.card');\n const btn = document.querySelector('button');\n\n\n // Loop through all employees name, and hide those who don't match the search query\n for (let i = 0; i < card.length; i++) {\n if (name[i].textContent.toUpperCase().includes(filter)) {\n showModalFunc(card[i]);\n } else {\n removeModalFunc(card[i]);\n }\n const clearFilter = (e) => {\n e.preventDefault();\n input.value = '';\n }\n }\n }","function filterByNameOrAdress(classNameOf) {\n const drinkNames = document.querySelectorAll(classNameOf);\n\n for (let index = 0; index < drinkNames.length; index++) {\n if (\n drinkNames[index].innerHTML\n .toLowerCase()\n .includes(searchTxt.value.toLowerCase())\n ) {\n drinkNames[index].style.display = \"block\";\n } else {\n drinkNames[index].style.display = \"none\";\n }\n }\n }","function mostrarResultados(nomesFiltrados){\n ul.innerHTML = [];\n letters.forEach(letra =>{\n let li = document.createElement('li');\n let h5 = document.createElement('h5');\n \n ul.append(li);\n li.classList.add('collection-header');\n li.append(h5);\n h5.innerHTML = `${letra}`;\n \n nomesFiltrados.forEach((nomeFiltrado) => {\n if(letra === nomeFiltrado.letter){\n let liItem = document.createElement('li');\n let aItem = document.createElement('a');\n ul.append(liItem);\n liItem.classList.add('collection-item');\n liItem.append(aItem);\n aItem.href = '#';\n aItem.innerHTML = `${nomeFiltrado.name}`;\n }\n });\n });\n}","function filtrar(){\n $(\"#grillaProductos>div\").hide();\n let arrayTemp=[];\n for (let i=0; i<$(\".checkbox\").length; i++ ){\n if($(\".checkbox\")[i].checked){\n switch (i){\n case 0:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"shampoo\"));\n break;\n case 1:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"acondicionador\"));\n break;\n case 2:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"combo\"));\n break;\n }\n }\n }\n \n if (arrayTemp.length === 0){\n $(\"#grillaProductos>div\").show();\n }else{\n arrayTemp.forEach(element => {\n $(`#${element.nombre}CardgrillaProductos`).show(); \n });\n }\n }","function filtrar() {\n var input, filter, table, tr, td, i;\n input = $('#filtrar');\n filter = input.val().toUpperCase();\n table = $('#tabela');\n tr = $('tr');\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName('td')[0];\n if (td) {\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = '';\n } else {\n tr[i].style.display = 'none';\n }\n }\n }\n}","function filterAccion() {\n let texto = \"Accion\";\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.categoria.indexOf(texto) > -1;\n });\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n \n}","function filterEmployeesByName() {\n const $cards = $(\".card\");\n let $matched = 0;\n let $filterInput = $(\"#filter\").val();\n\n if ($filterInput !== \"\") {\n $(\".card\").each(function () {\n let n = $(this).children(\".info\").children(\".name\").text();\n let u = $(this).children(\".info\").children(\".username\").text();\n if (n.indexOf($filterInput) < 0 && u.indexOf($filterInput) < 0) {\n $(this).hide();\n } else {\n $matched += 1;\n $(this).show();\n }\n if ($matched === 0) {\n $('.main-footer span').text(\"No matched face...\");\n } else {\n $('.main-footer span').text(\"So many beautiful faces ...\");\n }\n });\n } else {\n //show all employees if input field is blank.\n $(\".card\").show();\n }\n}","function comprobarNombre(pokemon) {\n\n var valueFiltro = filtroInput.value.toLowerCase();\n\n var nombre = pokemon.name;\n\n contador = 0;\n\n return nombre.includes(valueFiltro);\n\n}","function filterBiblio() {\n let texto = document.querySelector(\"#textBuscar\");\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.titulo.indexOf(texto.value.charAt(0).toUpperCase() + texto.value.toLowerCase().slice(1)) > -1;\n });\n texto.value=\"\"\n texto.focus()\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n}","function filter() {\n let preFilter = [];\n let gender = selectG.value;\n let stat = selectS.value;\n let filteredChar = [];\n\n if (gender != \"Gender\") {\n filteredChar.push(\"gender\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, false);\n print(preFilter);\n }\n }\n\n if (stat != \"Status\") {\n filteredChar.push(\"status\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, false);\n print(preFilter);\n }\n }\n }","function filtros(){\n\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#supernumerario tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\tif(recibe.length>0 && detector=='estado'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.estado\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\treturn false;\n}","function search() {\n let input, filter, elements, a, txtValue;\n input = document.getElementById('search-bar');\n filter = input.value.toUpperCase();\n elements = document.getElementsByClassName('pokebox');\n \n for (let i = 0; i < elements.length; i++) {\n a = elements[i].getElementsByClassName('name')[0];\n txtValue = a.textContent || a.innerText;\n\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n elements[i].style.display = \"\";\n } else {\n elements[i].style.display = \"none\";\n }\n }\n}","resultadoDePesquisa(){\n \n var input, filter, ul, li, a, i;\n\n var entrei = \"nao\";\n \n input = document.getElementById('buscaPrincipal');\n filter = input.value.toUpperCase();\n ul = $(\".area-pesquisa-principal\");\n\n li = $(\".area-pesquisa-principal .caixa-branca\");\n\n for (i = 0; i < li.length; i++) {\n a = li[i];\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n entrei = \"sim\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n \n }","function loadFilteredFilmList(value) {\n axios.get('https://data.sfgov.org/resource/wwmu-gmzc.json').then(res => {\n var regex = new RegExp(value, \"gi\");\n var searchValue = res.data.filter(film => {\n return film.title.match(regex);\n });\n renderFilmList(searchValue);\n }).catch();\n}","function filtroUsuarios() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Nome\r\n td3 = tr[i].getElementsByTagName(\"td\")[2]; //Permissões\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}","function filter2Dos() {\n var filterInput = $(this).val().toLowerCase();\n $('.text-wrapper').each(function () {\n var cardText = $(this).text().toLowerCase();\n if (cardText.indexOf(filterInput) != -1) {\n $(this).parent().show();\n } else {\n $(this).parent().hide();\n }\n });\n}","function nameFilter(element, index, array) {\n var $item = $(\"#\" + element);\n\n if (visible.filterOn.length > 0 && visible.items[element].name.toLowerCase().indexOf(visible.filterOn.toLowerCase()) === -1) {\n return false;\n }\n return true;\n }","function filterItems(e){\n\t//convert text to lowercase\n\tvar text = e.target.value.toLowerCase();\n\t//get li's\n\tvar items = itemList.getElementsByTagName('li');\n\t//Convert HTML collection to an array\n\tArray.from(items).forEach(function(item){\n\t\tvar itemName = item.firstChild.textContent;\n\t\t// console.log(itemName); //check if we get the item names\n\t\tif(itemName.toLowerCase().indexOf(text) != -1){//check if the search is equal to the item(matching) -1 if not match\n\t\t\titem.style.display = 'block'; //shows the search item(s)\n\t\t} else{\n\t\t\titem.style.display = 'none'; //if not match, remove display\n\t\t}\n\n\t});\n}","function searchNameText(e) {\n\tcardsList.innerHTML = ''; // clear the container for the new filtered cards\n\tbtnLoadMore.style.display = 'none';\n\tlet keyword = e.target.value;\n\tlet arrByName = dataArr.filter(\n\t\t(card) => { \n\t\t\treturn( \n\t\t\t\tcard.name.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\n\t\t\t\tcard.artist.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\n\t\t\t\tcard.setName.toLowerCase().indexOf(keyword.toLowerCase()) > -1 \n\t\t\t\t)\n\t\t}\t\n\t);\n\trenderCardList(arrByName);\n\tconsole.log(arrByName);\n}","function finder() {\n filter = keyword.value.toUpperCase();\n var li = box_search.getElementsByTagName(\"li\");\n // Recorriendo elementos a filtrar mediante los li\n for (i = 0; i < li.length; i++) {\n var a = li[i].getElementsByTagName(\"a\")[0];\n textValue = a.textContent || a.innerText;\n\n // QUIERO QUE ME APAREZCAN LAS OPCIONES SI TEXTVALUE.STARTSWITH = FILTER \n\n if (textValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"flex\";\n box_search.style.display = \"flex\";\n if (keyword.value === \"\") {\n box_search.style.display = \"none\";\n }\n }\n else {\n li[i].style.display = \"none\";\n }\n\n }\n\n}","function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}","function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}","function filtros2(){\n\t\n\t\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#externos tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}","function filterByName(element)\r\n{\r\n _upObject.filterByName(element.value, \"name\");\r\n}","function filtro(categoria) {\n setCat(categoria)\n }","function filterByName(searchForName, personList) {\n searchForName = searchForName.toLowerCase();\n return personList.filter((person) => {\n console.log(person)\n // Only needs to check if letters typed so far are included in name, not equal to name. \n return person.name.toLowerCase().includes(searchForName);\n });\n}","function filterData(tex) {\n const tempRests = rests.filter((itm) => itm.name.toLowerCase().includes(tex.toLowerCase()));\n setFilteredRests(tempRests);\n }","_filter(value) {\n //convert text to lower case\n const filterValue = value.toLowerCase();\n //get matching products\n return this.products.filter(option => option.toLowerCase().includes(filterValue));\n }","function filterName(){\n\t// Set filters to localstorage\n\tvar formName = $(\"#searchTitle\").val();\n\tif(formName == \"\"){\n\t\tfilterResults();\n\t}\n\telse{\n\t\tsearchResults(formName, \"600\", \"2800\");\n\t}\n}","function nameFilterEvent() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"filterInputName\");\n filter = input.value.toUpperCase();\n\n ul = document.getElementsByClassName(\"eventListTable\");\n li = ul[0].getElementsByTagName(\"li\");\n \n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"h1\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}","function filtroProdutos() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Descrição\r\n td3 = tr[i].getElementsByTagName(\"td\")[3]; //Código de barras\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}","filteravanzado(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup2\n const newData = data.filter(function (item) {\n\n const itemDataTitle = item.titulo.toUpperCase()\n const itemDataSubt = item.subtitulo.toUpperCase()\n const campo = itemDataTitle+\" \"+itemDataSubt\n const textData = text.toUpperCase()\n return campo.indexOf(textData) > -1\n })\n this.setState({\n listaAviso2: newData,\n textBuscar2: text,\n })\n }","findItem(query) {\n if (query === '') {\n return this.dataSearch.slice(0, 5);\n }\n const regex = new RegExp(`${query.trim()}`, 'i');\n return this.dataSearch.filter(film => film.name.search(regex) >= 0);\n }","function filter(kataKunci) {\n var filteredItems = []\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var namaItem = item[1]\n var isMatched = namaItem.toLowerCase().includes(kataKunci.toLowerCase())\n\n if(isMatched == true) {\n filteredItems.push(item)\n }\n }\n return filteredItems\n}","function filterTasks() {\n let result = filter.value.toLowerCase()\n document.querySelectorAll(\".collection-item\").forEach(function (item) { //NodeList\n if (item.innerText.toLowerCase().includes(result)) {\n item.style.display = \"block\"\n } else {\n item.style.display = \"none\"\n }\n })\n /*\n Array.from(taskList.children).forEach(function(item){\n item.style.display = (item.textContent.toLowerCase().includes(e.target.value.toLowerCase())? \"block\" : \"none\")\n })\n */\n}","function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).css({display: 'block'})\n }\n else {\n $(items[i]).css({display: 'none'})\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}","function filtrarProductosXEtiqueta() {\n let textoIngresado = $(\"#txtFiltroProductos\").val();\n textoIngresado = textoIngresado.toLowerCase();\n let arrayFiltrados = { data: Array(), error: \"\" };\n for (let i = 0; i < productos.length; i++) {\n let unProd = productos[i];\n let unaEtiqueta = unProd.etiquetas;\n let x = 0;\n let encontrado = false;\n while (!encontrado && x < unaEtiqueta.length) {\n let etiquetaX = unaEtiqueta[x];\n if (etiquetaX.includes(textoIngresado)) {\n arrayFiltrados.data.push(unProd);\n encontrado = true;\n }\n x++;\n }\n }\n crearListadoProductos(arrayFiltrados);\n}","function sexoSeleccionado(){\n console.trace('sexoSeleccionado');\n let sexo = document.getElementById(\"selector\").value;\n console.debug(sexo);\n if(sexo == 't'){\n pintarLista( personas );\n }else{\n const personasFiltradas = personas.filter( el => el.sexo == sexo) ;\n pintarLista( personasFiltradas );\n \n \n }//sexoSeleccionado\n limpiarSelectores('sexoselec');\n \n}","function filter(films, margins) {\n\tif (margins[0]==10&&margins[1]==100) {\n\t}else{\n\t\titems.innerHTML=\"\";\n\t\tvar searchedFilms = [];\n\t\tvar filmRating;\n\t\tfor (var i=0; iGenre: \" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\n\t\t\tfilmRating = films[i].rating.replace(\".\", \"\");\n\t\t\tfilmRating = filmRating.replace(\".\", \"\");\n\t\t\tif (filmRating>margins[0]&&filmRating l.titre.includes(searchFilter)||l.auteur.nom.includes(searchFilter)||l.auteur.prenom.includes(searchFilter));\n\t}","filteredFruits(){\n return this.fruits.filter((element)=> {\n return element.match(this.filterInputText)\n })\n }","function filterGenres() {\r\n var genderMovieSelect = $(\"#genders-movie select\").val()\r\n if (genderMovieSelect != \"all\") {\r\n $(\"#movie .template\").each(function() {\r\n var gid = $(this).attr(\"data-generi\").split(',');\r\n if (gid.includes(genderMovieSelect)) $(this).show()\r\n else $(this).hide()\r\n });\r\n } else {\r\n $(\"#movie .template\").show()\r\n }\r\n var genderTVSelect = $(\"#genders-tv select\").val()\r\n if (genderTVSelect != \"all\") {\r\n $(\"#tvshow .template\").each(function() {\r\n var gid = $(this).attr(\"data-generi\").split(',');\r\n if (gid.includes(genderMovieSelect)) $(this).show()\r\n else $(this).hide()\r\n });\r\n } else {\r\n $(\"#tvshow .template\").show()\r\n }\r\n }","function filterFunction() {\n var input, filter, ul, li, a, i;\n input = document.getElementById(\"mySearches\");\n filter = input.value.toUpperCase();\n div = document.getElementById(\"mySearch\");\n a = div.getElementsByTagName(\"a\");\n for (i = 0; i < a.length; i++) {\n txtValue = a[i].textContent || a[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n a[i].style.display = \"\";\n } else {\n a[i].style.display = \"none\";\n }\n }\n}","function filtros3(){\n\t\n\t\n\tvar recibe=$(this).val();\t\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#admin tr').show();\n\t\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='area'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.area\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='super'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.super\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='baja'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.baja\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='inicio'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.inicio\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='fin'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.fin\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='jefe'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.jefe\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}","function displayFilterValues(type, name) {\n $(\"#filterType\").text(type);\n\n //to ensure that the name is not too long\n const maxNameLength = 25;\n if (name.length > maxNameLength) {\n const nameArr = name.split(' ');\n name = '';\n for (let count = 0; count < nameArr.length; count++) {\n if ((name + nameArr[count]).length > maxNameLength) break;\n name += ' ' + nameArr[count];\n }\n name = name.substring(1);\n }\n\n $(\"#filterName\").text(name);\n}","function filterNames () {\n\n // Declare variable to hold value of filtered names\n let filteredNames;\n\n // If all...\n if (isAllShowing===true) {\n filteredNames = myNames.map((name) => {\n name.is_visible=true\n return name\n });\n setMyNames(filteredNames);\n }\n\n // If first...\n else if (isFirstShowing===true) {\n filteredNames = myNames.map((name) => {\n if (name.type==='first') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n\n // If middle...\n else if (isMiddleShowing===true) {\n filteredNames = myNames.map((name) => {\n if (name.type==='middle') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n\n // If full...(implied as all other types are specified in above conditionals)\n else {\n filteredNames = myNames.map((name) => {\n if (name.type==='full') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n }","selectFilterFacilidade(facilidades){\n\n //to open the DropDown\n this.getDropDownBoxFacilidades().click();\n\n //Search by the passed facilidades and click in checkBoxes\n facilidades.forEach((item) => {\n this.getCheckboxesFacilidades().contains(item).click();\n });\n }","function filtra(event){\n\t\n\tconst searchString=event.currentTarget.value.toLowerCase();\n\tconst trovati = document.querySelectorAll('.cercato');\n\tconst corpo = document.querySelector('body');\n\tconst primaSezione = document.querySelector('section');\n\tconst oggetti = document.querySelectorAll('.oggetto');\n\t\n\tconst sezFiltrati = document.createElement('div');\n\tsezFiltrati.classList.add('filtrati');\n\tcorpo.insertBefore(sezFiltrati, primaSezione);\n\t\t\n\t\tfor(let obj of oggetti){\n\t\t\t\n\t\t\t\n\t\t\tif(obj.childNodes[4].innerText.toLowerCase().includes(searchString)){\n\n\t\t\t\t\n\t\t\t\tconst oggetto1 = document.createElement('div'); \n\t\t\t\toggetto1.classList.add('cercato');\n\t\t\t\tsezFiltrati.appendChild(oggetto1);\n\t\t\t\t\n\t\t\t\tconst titolo = document.createElement('h2'); \n\t\t\t\ttitolo.innerText = obj.childNodes[1].innerText;\n\t\t\t\toggetto1.appendChild(titolo);\n\t\t\t\t\n\t\t\t\tconst immagine1 = document.createElement('img');\n\t\t\t\timmagine1.src = obj.childNodes[2].src;\n\t\t\t\toggetto1.appendChild(immagine1);\n\t\t\t\t\n\t\t\t\tconst codice1 = document.createElement('h3');\n\t\t\t\tcodice1.textContent = obj.childNodes[3].textContent;\n\t\t\t\toggetto1.appendChild(codice1);\n\t\t\n\t\t\t\tconst didascalia1 = document.createElement('article');\n\t\t\t\t\n\t\t\t\tdidascalia1.textContent = obj.childNodes[4].textContent;\n\t\t\t\toggetto1.appendChild(didascalia1);\n\t\t\t\t\n\t\t\t\tconst filtraggio = document.querySelectorAll('.filtrati');\t\n//\t\t\t\tconsole.log(filtraggio);\n\t\t\t\tlet conta = 0;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tfor(let item of filtraggio){\t\t\t\t\t\t\t\t\n\t\t\t\t\tconta++;\n//\t\t\t\t\tconsole.log(conta);\n\t\t\t\t}\n\t\t\t\tif(conta > 1){\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor(let item of filtraggio){\n\t\t\t\t\t\titem.remove();\n\t\t\t\t\t\tconta--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(searchString == ''){\n\t\t\tconst filtraggio = document.querySelectorAll('.filtrati');\n//\t\t\tconsole.log('Stringa vuota');\n\t\t\tfor(let item of filtraggio){\n\t\t\t\t\n\t\t\t\t\t\titem.remove();\n\t\t\t}\n\t\t}\n}","function filtro(arreglo, criterios,signo) { \n return arreglo.filter(function(obj) {return Object.keys(criterios).every(function(c) { //retorna los objetos que no cumplan los criterios si signo es true\n if (signo) //retorna los objetos que cumplen los criterios si signo es false\n return obj[c] != criterios[c]; // ejmplo de uso (arregloObjetos,{atributo1:a,atributo2:b},true)\n else \n return obj[c] == criterios[c]; \n }); \n }); \n }","function getCarsByName(name, count = 5) {\n return data\n .filter((car) =>\n car.Name.toLocaleLowerCase().startsWith(name ? name.toLowerCase() : name)\n )\n .slice(0, count);\n}","function queryUserName(name){\n var results = users.filter(function(o){\n if(o.name.toLowerCase().indexOf(name.toLowerCase()) > - 1){\n return o;\n }\n });\n showUserResults(results);\n}","function searchAuthName() {\n let input, filter, table, tr, td, i;\n input = document.getElementById(\"searchAName\");\n filter = input.value.toUpperCase();\n table = document.getElementById('authorsTable');\n tr = table.getElementsByTagName(\"tr\");\n\n // Loop through all list items, and hide those who don't match the search query\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName('td')[1];\n if (td) {\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n };\n };\n };\n }","function filter(){\n\n\tvar fifilter = $('#filter');\n\n\tvar wadahFilter = fifilter.val().toLowerCase();\n\n\tvar buah = $('.buah');\n\t\tfor (var a = 0; a < buah.length; a++) {\n\n\t\t\tvar wadahLi = $(buah[a]).text().toLowerCase();\n\t\t\t\n\t\t\tif(wadahLi.indexOf(wadahFilter) >= 0){\n\t\t\t\t\t$(buah[a]).slideDown();\n\t\t\t}else{\n\t\t\t\t\t$(buah[a]).slideUp();\n\t\t\t}\n\t\t}\n\n\t// buah.each(function(){\n\t// \tvar bubuah = $(this);\n\t// \tvar namaBuah = bubuah.text().toLowerCase();\n\n\t// \tif(namaBuah.indexOf(wadahFilter) >= 0 ){\n\t// \t\t$(this).slideDown();\n\t// \t}else{\n\t// \t\t$(this).slideUp();\n\t// \t}\n\t// });\n\t\n\n}","filterFunc (searchExpression, value) {\n const itemValue = value.name\n\n return (!searchExpression || !itemValue)\n ? false\n : itemValue.toUpperCase().indexOf(searchExpression.toUpperCase()) !== -1\n }","function search() {\n let input, filter, li, a, i, txtValue;\n input = document.querySelector(\".search\");\n filter = input.value.toUpperCase();\n li = document.getElementsByClassName(\"readthis\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByClassName(\"studentdetails\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}","function filterUser(value) {\n const filterIndex = select.selectedIndex\n let filter = select.options[select.selectedIndex].text\n if (value.length >= 3) {\n filteredUsers = users.filter((user) => {\n if (user[filter].toLowerCase().includes(value.toLowerCase())) {\n return user[filter]\n }\n })\n createCards(filteredUsers)\n } else if (value.length === 0) {\n createCards(users)\n }\n\n}","function filterByGame() {\n clearSearchbar();\n const chosenGame = this.value;\n const allGameCategories = Array.from(document.querySelectorAll(\".game-name\"));\n allGameCategories.forEach(gameName => {\n if (gameName.textContent !== chosenGame) {\n gameName.parentElement.parentElement.parentElement.classList.add(\"hidden\");\n }\n else(gameName.parentElement.parentElement.parentElement.classList.remove(\"hidden\"));\n });\n checkAllTermsHidden();\n}","function filterTasks(e){\n const text=e.target.value.toLowerCase();\n //We used for each as the query selector all returns nodelist\n document.querySelectorAll('.collection-item').forEach(function(task)\n {\n const item=task.firstChild.textContent;\n if(item.toLowerCase().indexOf(text)!=-1)\n {\n task.style.display='block';\n\n }\n else{\n task.style.display='none';\n }\n });\n}","function textFilter() {\n var filterValue, input, ul, li, i;\n input = document.querySelector(\"#filterCompany\");\n filterValue = input.value.toUpperCase();\n ul = document.querySelector(\"#listOfCompanies\")\n li = document.querySelectorAll(\"#listOfCompanies li\");\n\n for(i=0; i < li.length; i++) {\n var a = li[i];\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\n li[i].style.display = \"\";\n }\n else {\n li[i].style.display = \"none\";\n }\n }\n}","function searchText(value) {\r\n const card = document.querySelectorAll('.card');\r\n for (let i = 0; i < card.length; i++) {\r\n const userName = card[i].querySelector('.card-name').textContent\r\n if (userName.indexOf(value) > -1) {\r\n card[i].style.display = \"\";\r\n } else {\r\n card[i].style.display = \"none\";\r\n\r\n }\r\n }\r\n}","function filtrarAuto() {\r\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\r\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\r\n // console.log(resultado);\r\n if (resultado.length)\r\n mostrarAutos(resultado);\r\n else\r\n noHayResultados();\r\n}","function createFilterFor(query) {\n\n return function filterFn(proyecto) {\n return (proyecto.titulo.indexOf(query) === 0);\n };\n }","function filterByName(val){\n return val.speaker == this;\n }","function SearchByName(){\n if(inputSearch.value !== \"\"){\n setTimeout(responsiveVoice.speak(inputSearch.value),0);\n resultHotel= [];\n result = hotels.filter((hotel) =>{\n if( hotel.name.toLocaleLowerCase().indexOf(inputSearch.value.toLocaleLowerCase()) > -1){\n return hotel;\n }\n })\n inputSearch.value=\"\";\n resultHotel = result;\n display(result);\n }else{\n alerts(\"Add your Search\",3000);\n }\n range();\n filterByPrice()\n}","filteredBirds() {\n return vm.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(vm.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }","function filterProjectsBy(evt) {\n var category = evt.target.value;\n $('.project-filterable').hide();\n if (category) {\n $('.' + category).show();\n } else {\n $('.project-filterable').show();\n }\n}","function filterTasks(e){\n console.log(\"Task filter...\")\n var searchFilter, listItem, txtValue;\n searchFilter = filter.value.toUpperCase();\n listItem = document.querySelectorAll('.collection-item');\n //looping through the list items, and hiding unmatching results\n listItem.forEach(function(element){\n txtValue = element.textContent || element.innerText;\n if(txtValue.toUpperCase().indexOf(searchFilter) > -1){\n element.style.display = \"\";\n }else{\n element.style.display = \"none\";\n }\n });\n}","filter(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup\n const newData = data.filter(function (item) {\n const itemData = item.titulo.toUpperCase()\n const textData = text.toUpperCase()\n return itemData.indexOf(textData) > -1\n })\n this.setState({\n listaAviso: newData,\n textBuscar: text,\n })\n }","function search() {\n const text = this.value;\n if (text === '') {\n rows.forEach(row => row.style.display = null);\n return;\n }\n const length = names.length;\n const regex = new RegExp(text, 'gi');\n for (let i = 0; i < length; i++) {\n if (names[i].match(regex)) rows[i].style.display = null;\n else rows[i].style.display = 'none';\n }\n}","function createFilterFor(query) {\n\n return function filterFn(fondeo) {\n return (fondeo.titulo.indexOf(query) === 0);\n };\n }","filterSuggest(results, search) {\n const filter = results.filter( filter => filter.calle.indexOf(search) !== -1 );\n\n // Mostrar pines del Filtro\n this.showPins(filter);\n }","function filterUl(value) {\n var list = $(\"#drag-list-container li\").hide()\n .filter(function () {\n var item = $(this).text();\n var padrao = new RegExp(value, \"i\");\n return padrao.test(item);\n }).closest(\"li\").show();\n}","filteredBirds() {\n return this.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(this.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }","function searchName(){\n\n const searchValue = document.querySelector('.search-input').value;\n const cards = document.querySelectorAll(\".card\");\n for (let index = 0; index < cards.length; index++) {\n const name = cards[index].querySelector(\"#name\").innerHTML;\n if (name.indexOf(searchValue)!=-1) {\n cards[index].style.display = \"\";\n }\n else{\n cards[index].style.display = \"none\";\n }\n \n }\n\n}","function searchEmployees() {\n const searchName = searchBar.value.toLowerCase();\n const cards = document.querySelectorAll(\".card\");\n const names = document.querySelectorAll(\".card-name\");\n\n names.forEach((name, index) => {\n const nameValue = name.textContent.toLowerCase();\n\n if (nameValue.includes(searchName)) {\n cards[index].style.display = \"flex\";\n } else {\n cards[index].style.display = \"none\";\n }\n });\n}","function searchmovie() {\r\n var search,filter,ul,li,a,i,text;\r\n search=document.getElementById(\"inputid\");\r\n filter=search.value.toUpperCase();\r\n ul=document.getElementById(\"ulid\");\r\n li=ul.getElementsByTagName(\"li\");\r\n for(i=0; i -1)\r\n {\r\n li[i].style.display=\"\";\r\n }\r\n else\r\n {\r\n li[i].style.display=\"none\";\r\n }\r\n }\r\n}","function searchCoffeeNames(e) {\n e.preventDefault();\n var userCoffeeName = document.getElementById(\"user-search\").value;\n var filteredNames = [];\n coffees.forEach(function(coffee) {\n\n if(coffee.name.toLowerCase().includes(userCoffeeName.toLowerCase())){\n filteredNames.push(coffee);\n\n }\n });\n divBody.innerHTML = renderCoffees(filteredNames);\n}"],"string":"[\n \"function filtrarProd(){\\nlet filtrado = productos.filter(prod => {\\n \\n return prod.nombre.toLowerCase().includes($(\\\"#txtFiltrar\\\").val().toLowerCase())\\n})\\nlistarProductos(filtrado)\\n$(\\\"#txtFiltrar\\\").val(\\\"\\\")\\n}\",\n \"function filtro() {\\n let selectorSexo = document.getElementById(\\\"selectorSexo\\\");\\n let inputNombre = document.getElementById(\\\"inombre\\\");\\n\\n const sexo = selectorSexo.value;\\n const nombre = inputNombre.value.trim().toLowerCase();\\n\\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\\n console.debug(\\\"personas %o\\\", personas);\\n\\n //creamos una copia para no modificar el original\\n let personasFiltradas = personas.map((el) => el);\\n\\n //filtrar por sexo, si es 't' todos no hace falta filtrar\\n if (sexo == \\\"h\\\" || sexo == \\\"m\\\") {\\n personasFiltradas = personasFiltradas.filter((el) => el.sexo == sexo);\\n console.debug(\\\"filtrado por sexo %o\\\", personasFiltradas);\\n }\\n\\n //filtrar por nombre buscado\\n if (nombre != \\\" \\\") {\\n personasFiltradas = personasFiltradas.filter((el) =>\\n el.nombre.toLowerCase().includes(nombre)\\n );\\n console.debug(\\\"filtrado por nombre %o\\\", personasFiltradas);\\n }\\n\\n maquetarLista(personasFiltradas);\\n}\",\n \"function filtrar(value) {\\n $(\\\".items\\\").filter(function () {\\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);//SI ES DIFERENTE A -1 ES QUE ENCONTRO\\n });\\n}\",\n \"function filterNames() {\\n //3.1. get value of filterInput and convert it to upper case for comparision\\n let filterValue = filterInput.value.toUpperCase();\\n\\n //3.2. get ul containing all the names\\n let nameList = document.querySelector('.list');\\n\\n //3.3. get all the names from the nameList in a array\\n let namesArray = Array.from(nameList.querySelectorAll('.list__item'));\\n\\n //3.4. loop through namesArray to compare filterValue with the names in the namesArray\\n for (let i = 0; i < namesArray.length; i++){\\n //3.4.1. get currentname\\n let currentname = namesArray[i].innerText.toUpperCase();\\n //3.4.2 compare both the names\\n if(currentname.indexOf(filterValue) > -1){\\n //if matched do nothing\\n namesArray[i].style.display ='';\\n }else{\\n //else display none\\n namesArray[i].style.display ='none';\\n }\\n }\\n}\",\n \"function filtre_texte(txt) {\\r\\n tabObj = tabObjInit.filter(function (elm) {\\r\\n var pattern = new RegExp(\\\"(\\\" + txt + \\\")\\\", 'ig');\\r\\n if ( elm.Nom.match(pattern) ) {\\r\\n return true;\\r\\n } else {\\r\\n return false\\r\\n }\\r\\n });\\r\\n ecrit_liste(tabObj);\\r\\n}\",\n \"async function filtrarNomes(){\\n let valorInput = filterInput.value.charAt(0).toUpperCase() + filterInput.value.toLowerCase().substring(1);\\n let nomes = buscarDadosNoJSON();\\n \\n nomes.then((nomeDoJSON) => {\\n let resultados = nomeDoJSON.filter(nome => {\\n let regex = new RegExp(`${valorInput}`, 'gi');\\n return nome.name.match(regex);\\n });\\n\\n if(resultados.length > 0)\\n mostrarResultados(resultados)\\n });\\n }\",\n \"filtrarSugerencias(resultado, busqueda){\\n \\n //filtrar con .filter\\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\\n console.log(filtro);\\n \\n //mostrar los pines\\n this.mostrarPines(filtro);\\n }\",\n \"function filterNames() {\\r\\n //Search value, list items, pokemon names\\r\\n const filterValue = searchResult.value.toLowerCase(); //Gets search value\\r\\n const pokemonListLi = pokemonList.querySelectorAll('li'); //Gets list items\\r\\n const pokemonListNames = pokemonList.querySelectorAll('.pokemon-name'); //Gets pokemon names\\r\\n\\r\\n for (let i = 0; i < pokemonListNames.length; i++) {\\r\\n /*if at least one value of search appears in name, list item stays\\r\\n if value of search never occurs, list item is hidden*/\\r\\n if (pokemonListNames[i].textContent.toLowerCase().indexOf(filterValue) > -1) {\\r\\n pokemonListLi[i].style.display = '';\\r\\n } else {\\r\\n pokemonListLi[i].style.display = 'none';\\r\\n }\\r\\n }\\r\\n}\",\n \"function filterItem (){\\n let filter = valorfilter();\\n estructuraFilter = \\\"\\\";\\n if (filter == \\\"Prime\\\"){\\n for (propiedad of carrito) {\\n if (propiedad.premium) imprimirItemFilter(propiedad);\\n }\\n noItenCarrito();\\n } else if (filter == \\\"Todos\\\") {\\n estructuraPrincipalCarrito();\\n } \\n}\",\n \"function filterByName (data) {\\n const arrCard = document.querySelectorAll('.card');\\n const searchInput = document.querySelector('.search-input');\\n const arrName = [...document.querySelectorAll('#name')];\\n searchInput.addEventListener('input', elInput => {\\n const gallery = document.querySelector('#gallery');\\n let dataArr = [];\\n gallery.innerHTML = '';\\n data.map(card => {\\n let name = card.name.first + card.name.last;\\n if(name.match(elInput.target.value)) {\\n createCardsNew (card);\\n dataArr.push(card);\\n }\\n });\\n byClickCreateModal (dataArr);\\n });\\n}\",\n \"function filterNames(event) {\\n let searchString = event.target.value.toLowerCase()\\n\\n $lis.forEach((li) => {\\n if (li.querySelector('a').innerText.toLowerCase().includes(searchString)) {\\n li.style.display = ''\\n }\\n else {\\n li.style.display = 'none'\\n }\\n })\\n}\",\n \"function filterBySearchTerm(){\\n let inputName = document.querySelector('#input-pokemon-name').value;\\n let pokemonNames = arrayOfPokemon.filter(pokemon => pokemon.name.startsWith(inputName));\\n\\n let inputType = document.querySelector('#input-pokemon-type').value;\\n let pokemonTypes = arrayOfPokemon.filter(pokemon => pokemon.primary_type.startsWith(inputType));\\n\\n if (inputName !== \\\"\\\"){\\n document.querySelector('#pokemon-list').innerText = '';\\n displayList(pokemonNames);\\n } else if (inputType !== \\\"\\\"){\\n document.querySelector('#pokemon-list').innerText = '';\\n displayList(pokemonTypes);\\n } else if (inputName == \\\"\\\" && inputType == \\\"\\\"){\\n let pokemonList = document.querySelector('#pokemon-list');\\n pokemonList.innerHTML = \\\"\\\";\\n displayList(arrayOfPokemon);\\n };\\n}\",\n \"function filterMovies(titlename) {\\r\\n const filteredMovies = movies.filter(word => word.Title.includes(titlename));\\r\\n addMoviesToDom(filteredMovies);\\r\\n}\",\n \"function filtros1(){\\n\\t\\n\\t\\n\\tvar recibe=$(this).val();\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#empleados tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='cedula'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.cedula\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='costo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.costo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='cargo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.cargo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\t\\n\\treturn false;\\n}\",\n \"function filterBy(filter) {\\n JsontoHTML()\\n for (let i = 0; i < all_html.length; i++) {\\n let c = databaseObj[i];\\n let genre = (JSON.parse(c[\\\"genres\\\"]))\\n for (let a = 0; a < genre.length; a++) {\\n if (genre[a][\\\"name\\\"] === filter) {\\n $(\\\".items\\\").append([all_html[i]].map(movie_item_template).join(\\\"\\\"));\\n }\\n }\\n }\\n storage()\\n }\",\n \"function filterByName(name){\\n document.querySelectorAll('.card').forEach(el => {\\n if(el.querySelector('h3').innerText.toLowerCase().indexOf(name.toLowerCase()) > -1){\\n el.classList.remove('hidden')\\n }else{\\n el.classList.add('hidden')\\n }\\n })\\n }\",\n \"function ObtenerResultadosFiltrados(){\\n var comparar=[];\\n $(selector+' .campoFiltrado input.campoBlancoTextoSeleccion').each(function(i,campo){\\n if(ValidarCadena($(campo).val())){\\n comparar.push(\\n $(campo).attr('identificador')\\n );\\n }\\n });\\n return descargasGenerales.filter(function(elemento){\\n if(comparar.length==0){\\n return true;\\n }\\n for(let i=0;i {\\n if (item.textContent.toUpperCase().indexOf(filterValue) > -1) {\\n item.parentElement.style.display = \\\"\\\";\\n } else {\\n item.parentElement.style.display = \\\"none\\\";\\n }\\n });\\n}\",\n \"function filtresPers(searchFilter) {\\n\\t\\treturn listPers.filter(p => p.nom.includes(searchFilter)||p.prenom.includes(searchFilter)||p.nomBiblio.includes(searchFilter)||p.titre.includes(searchFilter));\\n\\t}\",\n \"function filterNames() {\\n // Get the input value\\n\\n let filterValue = document.getElementById('filterInput').value.toUpperCase();\\n\\n // Get the ul\\n\\n let ul = document.getElementById('names');\\n\\n // Get the lis from ul , an array would also be created from this\\n let li = ul.querySelectorAll('li.collection-item');\\n\\n // Loop through \\n\\nfor( let i=0; i < li.length; i++) {\\n let a = li[i].getElementsByTagName('a')[0];\\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\\n li[i].style.display = '';\\n } else {\\n li[i].style.display = 'none'\\n }\\n}\\n}\",\n \"function filterAndSearch(films, searched, filtered, num) {\\n\\titems.innerHTML = \\\"\\\";\\n\\tvar arrayOne = [];\\n\\tvar arrayTwo = [];\\n\\tvar filmRating;\\n\\tfor (var i=0; iMath.round(slider.noUiSlider.get()[0])&&filmRatingGenre: \\\" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\\n\\t\\t}\\n\\t}\\n\\tif (items.innerHTML == \\\"\\\") {\\n\\t\\titems.innerHTML = \\\"No Results Found\\\";\\n\\t}\\n}\",\n \"function searchConcepto() {\\n\\tvar input, i, filter, li, ul, txtValue;\\n\\tinput = document.getElementById('buscarConcepto');\\n\\tfilter = input.value.toUpperCase();\\n\\t//collection-item getElementsByClassName('prueba') ;\\n\\tlet array_aux = document.getElementById('listadoconceptos').getElementsByTagName('A');\\n\\t//console.log(array_aux);\\n\\tfor (i = 0; i < array_aux.length; i++) {\\n\\t\\ta = array_aux[i].getAttribute('concepto');\\n\\t\\ttxtValue = a;\\n\\t\\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\\n\\t\\t\\tarray_aux[i].parentElement.style.display = '';\\n\\t\\t} else {\\n\\t\\t\\tarray_aux[i].parentElement.style.display = 'none';\\n\\t\\t}\\n\\t}\\n}\",\n \"function searchData(){\\n var dd = dList\\n var q = document.getElementById('filter').value;\\n var data = dd.filter(function (thisData) {\\n return thisData.name.toLowerCase().includes(q) ||\\n thisData.rotation_period.includes(q) ||\\n thisData.orbital_period.includes(q) || \\n thisData.diameter.includes(q) || \\n thisData.climate.includes(q) ||\\n thisData.gravity.includes(q) || \\n thisData.terrain.includes(q) || \\n thisData.surface_water.includes (q) ||\\n thisData.population.includes(q)\\n });\\n showData(data); // mengirim data ke function showData\\n}\",\n \"function filtro(tmpIdDecada, filtro) {\\n\\n // Violencias\\n $(\\\"#\\\" + tmpIdDecada + \\\" .flt\\\").show();\\n\\n for (var tmpObra in arrayDecadas) {\\n // todo get\\n if (filtro === \\\"filtro_1\\\") {\\n }\\n if (getIDByCollection(tmpIdDecada) == arrayDecadas[tmpObra][\\\"collection_name\\\"]\\n && arrayDecadas[tmpObra][\\\"violencias\\\"] == filtro) {\\n $(\\\"#i-\\\" + decadas[\\\"ID\\\"]).addClass(\\\"flt\\\").hide();\\n }\\n }\\n\\n}\",\n \"function filterEmployee() {\\n // Declare variables\\n const input = document.querySelector('input');\\n const filter = input.value.toUpperCase();\\n let name = document.querySelectorAll('.name');\\n const heading4 = document.querySelectorAll('h4')\\n const card = document.querySelectorAll('.card');\\n const btn = document.querySelector('button');\\n\\n\\n // Loop through all employees name, and hide those who don't match the search query\\n for (let i = 0; i < card.length; i++) {\\n if (name[i].textContent.toUpperCase().includes(filter)) {\\n showModalFunc(card[i]);\\n } else {\\n removeModalFunc(card[i]);\\n }\\n const clearFilter = (e) => {\\n e.preventDefault();\\n input.value = '';\\n }\\n }\\n }\",\n \"function filterByNameOrAdress(classNameOf) {\\n const drinkNames = document.querySelectorAll(classNameOf);\\n\\n for (let index = 0; index < drinkNames.length; index++) {\\n if (\\n drinkNames[index].innerHTML\\n .toLowerCase()\\n .includes(searchTxt.value.toLowerCase())\\n ) {\\n drinkNames[index].style.display = \\\"block\\\";\\n } else {\\n drinkNames[index].style.display = \\\"none\\\";\\n }\\n }\\n }\",\n \"function mostrarResultados(nomesFiltrados){\\n ul.innerHTML = [];\\n letters.forEach(letra =>{\\n let li = document.createElement('li');\\n let h5 = document.createElement('h5');\\n \\n ul.append(li);\\n li.classList.add('collection-header');\\n li.append(h5);\\n h5.innerHTML = `${letra}`;\\n \\n nomesFiltrados.forEach((nomeFiltrado) => {\\n if(letra === nomeFiltrado.letter){\\n let liItem = document.createElement('li');\\n let aItem = document.createElement('a');\\n ul.append(liItem);\\n liItem.classList.add('collection-item');\\n liItem.append(aItem);\\n aItem.href = '#';\\n aItem.innerHTML = `${nomeFiltrado.name}`;\\n }\\n });\\n });\\n}\",\n \"function filtrar(){\\n $(\\\"#grillaProductos>div\\\").hide();\\n let arrayTemp=[];\\n for (let i=0; i<$(\\\".checkbox\\\").length; i++ ){\\n if($(\\\".checkbox\\\")[i].checked){\\n switch (i){\\n case 0:\\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\\\"shampoo\\\"));\\n break;\\n case 1:\\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\\\"acondicionador\\\"));\\n break;\\n case 2:\\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\\\"combo\\\"));\\n break;\\n }\\n }\\n }\\n \\n if (arrayTemp.length === 0){\\n $(\\\"#grillaProductos>div\\\").show();\\n }else{\\n arrayTemp.forEach(element => {\\n $(`#${element.nombre}CardgrillaProductos`).show(); \\n });\\n }\\n }\",\n \"function filtrar() {\\n var input, filter, table, tr, td, i;\\n input = $('#filtrar');\\n filter = input.val().toUpperCase();\\n table = $('#tabela');\\n tr = $('tr');\\n for (i = 0; i < tr.length; i++) {\\n td = tr[i].getElementsByTagName('td')[0];\\n if (td) {\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\\n tr[i].style.display = '';\\n } else {\\n tr[i].style.display = 'none';\\n }\\n }\\n }\\n}\",\n \"function filterAccion() {\\n let texto = \\\"Accion\\\";\\n Mangas = JSON.parse(localStorage.getItem(\\\"biblioteca\\\"));\\n\\n Mangas = Mangas.filter(function (manga) {\\n return manga.categoria.indexOf(texto) > -1;\\n });\\n contarRegistro(Mangas)\\n cargarManga4(Mangas);\\n \\n}\",\n \"function filterEmployeesByName() {\\n const $cards = $(\\\".card\\\");\\n let $matched = 0;\\n let $filterInput = $(\\\"#filter\\\").val();\\n\\n if ($filterInput !== \\\"\\\") {\\n $(\\\".card\\\").each(function () {\\n let n = $(this).children(\\\".info\\\").children(\\\".name\\\").text();\\n let u = $(this).children(\\\".info\\\").children(\\\".username\\\").text();\\n if (n.indexOf($filterInput) < 0 && u.indexOf($filterInput) < 0) {\\n $(this).hide();\\n } else {\\n $matched += 1;\\n $(this).show();\\n }\\n if ($matched === 0) {\\n $('.main-footer span').text(\\\"No matched face...\\\");\\n } else {\\n $('.main-footer span').text(\\\"So many beautiful faces ...\\\");\\n }\\n });\\n } else {\\n //show all employees if input field is blank.\\n $(\\\".card\\\").show();\\n }\\n}\",\n \"function comprobarNombre(pokemon) {\\n\\n var valueFiltro = filtroInput.value.toLowerCase();\\n\\n var nombre = pokemon.name;\\n\\n contador = 0;\\n\\n return nombre.includes(valueFiltro);\\n\\n}\",\n \"function filterBiblio() {\\n let texto = document.querySelector(\\\"#textBuscar\\\");\\n Mangas = JSON.parse(localStorage.getItem(\\\"biblioteca\\\"));\\n\\n Mangas = Mangas.filter(function (manga) {\\n return manga.titulo.indexOf(texto.value.charAt(0).toUpperCase() + texto.value.toLowerCase().slice(1)) > -1;\\n });\\n texto.value=\\\"\\\"\\n texto.focus()\\n contarRegistro(Mangas)\\n cargarManga4(Mangas);\\n}\",\n \"function filter() {\\n let preFilter = [];\\n let gender = selectG.value;\\n let stat = selectS.value;\\n let filteredChar = [];\\n\\n if (gender != \\\"Gender\\\") {\\n filteredChar.push(\\\"gender\\\");\\n if (filteredChar.length == 1) {\\n limpiartodo();\\n preFilter = filterGender(preFilter, gender, true);\\n print(preFilter);\\n }\\n else {\\n limpiartodo();\\n preFilter = filterGender(preFilter, gender, false);\\n print(preFilter);\\n }\\n }\\n\\n if (stat != \\\"Status\\\") {\\n filteredChar.push(\\\"status\\\");\\n if (filteredChar.length == 1) {\\n limpiartodo();\\n preFilter = filterStatus(preFilter, stat, true);\\n print(preFilter);\\n }\\n else {\\n limpiartodo();\\n preFilter = filterStatus(preFilter, stat, false);\\n print(preFilter);\\n }\\n }\\n }\",\n \"function filtros(){\\n\\n\\tvar recibe=$(this).val();\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#supernumerario tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='cedula'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.cedula\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='costo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.costo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='cargo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.cargo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\tif(recibe.length>0 && detector=='estado'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.estado\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\treturn false;\\n}\",\n \"function search() {\\n let input, filter, elements, a, txtValue;\\n input = document.getElementById('search-bar');\\n filter = input.value.toUpperCase();\\n elements = document.getElementsByClassName('pokebox');\\n \\n for (let i = 0; i < elements.length; i++) {\\n a = elements[i].getElementsByClassName('name')[0];\\n txtValue = a.textContent || a.innerText;\\n\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n elements[i].style.display = \\\"\\\";\\n } else {\\n elements[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"resultadoDePesquisa(){\\n \\n var input, filter, ul, li, a, i;\\n\\n var entrei = \\\"nao\\\";\\n \\n input = document.getElementById('buscaPrincipal');\\n filter = input.value.toUpperCase();\\n ul = $(\\\".area-pesquisa-principal\\\");\\n\\n li = $(\\\".area-pesquisa-principal .caixa-branca\\\");\\n\\n for (i = 0; i < li.length; i++) {\\n a = li[i];\\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"\\\";\\n entrei = \\\"sim\\\";\\n } else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n \\n }\",\n \"function loadFilteredFilmList(value) {\\n axios.get('https://data.sfgov.org/resource/wwmu-gmzc.json').then(res => {\\n var regex = new RegExp(value, \\\"gi\\\");\\n var searchValue = res.data.filter(film => {\\n return film.title.match(regex);\\n });\\n renderFilmList(searchValue);\\n }).catch();\\n}\",\n \"function filtroUsuarios() {\\r\\n var input, filter, table, tr, td, td2, td3, i;\\r\\n input = document.getElementById(\\\"search\\\");\\r\\n filter = input.value.toUpperCase();\\r\\n table = document.getElementById(\\\"table\\\");\\r\\n tr = table.getElementsByTagName(\\\"tr\\\");\\r\\n for (i = 0; i < tr.length; i++) {\\r\\n td = tr[i].getElementsByTagName(\\\"td\\\")[0]; //ID\\r\\n td2 = tr[i].getElementsByTagName(\\\"td\\\")[1]; //Nome\\r\\n td3 = tr[i].getElementsByTagName(\\\"td\\\")[2]; //Permissões\\r\\n if (td || td2 || td3) {\\r\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\\r\\n tr[i].style.display = \\\"\\\";\\r\\n } else {\\r\\n tr[i].style.display = \\\"none\\\";\\r\\n }\\r\\n }\\r\\n }\\r\\n}\",\n \"function filter2Dos() {\\n var filterInput = $(this).val().toLowerCase();\\n $('.text-wrapper').each(function () {\\n var cardText = $(this).text().toLowerCase();\\n if (cardText.indexOf(filterInput) != -1) {\\n $(this).parent().show();\\n } else {\\n $(this).parent().hide();\\n }\\n });\\n}\",\n \"function nameFilter(element, index, array) {\\n var $item = $(\\\"#\\\" + element);\\n\\n if (visible.filterOn.length > 0 && visible.items[element].name.toLowerCase().indexOf(visible.filterOn.toLowerCase()) === -1) {\\n return false;\\n }\\n return true;\\n }\",\n \"function filterItems(e){\\n\\t//convert text to lowercase\\n\\tvar text = e.target.value.toLowerCase();\\n\\t//get li's\\n\\tvar items = itemList.getElementsByTagName('li');\\n\\t//Convert HTML collection to an array\\n\\tArray.from(items).forEach(function(item){\\n\\t\\tvar itemName = item.firstChild.textContent;\\n\\t\\t// console.log(itemName); //check if we get the item names\\n\\t\\tif(itemName.toLowerCase().indexOf(text) != -1){//check if the search is equal to the item(matching) -1 if not match\\n\\t\\t\\titem.style.display = 'block'; //shows the search item(s)\\n\\t\\t} else{\\n\\t\\t\\titem.style.display = 'none'; //if not match, remove display\\n\\t\\t}\\n\\n\\t});\\n}\",\n \"function searchNameText(e) {\\n\\tcardsList.innerHTML = ''; // clear the container for the new filtered cards\\n\\tbtnLoadMore.style.display = 'none';\\n\\tlet keyword = e.target.value;\\n\\tlet arrByName = dataArr.filter(\\n\\t\\t(card) => { \\n\\t\\t\\treturn( \\n\\t\\t\\t\\tcard.name.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\\n\\t\\t\\t\\tcard.artist.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\\n\\t\\t\\t\\tcard.setName.toLowerCase().indexOf(keyword.toLowerCase()) > -1 \\n\\t\\t\\t\\t)\\n\\t\\t}\\t\\n\\t);\\n\\trenderCardList(arrByName);\\n\\tconsole.log(arrByName);\\n}\",\n \"function finder() {\\n filter = keyword.value.toUpperCase();\\n var li = box_search.getElementsByTagName(\\\"li\\\");\\n // Recorriendo elementos a filtrar mediante los li\\n for (i = 0; i < li.length; i++) {\\n var a = li[i].getElementsByTagName(\\\"a\\\")[0];\\n textValue = a.textContent || a.innerText;\\n\\n // QUIERO QUE ME APAREZCAN LAS OPCIONES SI TEXTVALUE.STARTSWITH = FILTER \\n\\n if (textValue.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"flex\\\";\\n box_search.style.display = \\\"flex\\\";\\n if (keyword.value === \\\"\\\") {\\n box_search.style.display = \\\"none\\\";\\n }\\n }\\n else {\\n li[i].style.display = \\\"none\\\";\\n }\\n\\n }\\n\\n}\",\n \"function filter(word) {\\n let length = items.length\\n let collection = []\\n let hidden = 0\\n for (let i = 0; i < length; i++) {\\n if (items[i].value.toLowerCase().startsWith(word)) {\\n $(items[i]).show()\\n }\\n else {\\n $(items[i]).hide()\\n hidden++\\n }\\n }\\n\\n //If all items are hidden, show the empty view\\n if (hidden === length) {\\n $('#empty').show()\\n }\\n else {\\n $('#empty').hide()\\n }\\n}\",\n \"function filter(word) {\\n let length = items.length\\n let collection = []\\n let hidden = 0\\n for (let i = 0; i < length; i++) {\\n if (items[i].value.toLowerCase().startsWith(word)) {\\n $(items[i]).show()\\n }\\n else {\\n $(items[i]).hide()\\n hidden++\\n }\\n }\\n\\n //If all items are hidden, show the empty view\\n if (hidden === length) {\\n $('#empty').show()\\n }\\n else {\\n $('#empty').hide()\\n }\\n}\",\n \"function filtros2(){\\n\\t\\n\\t\\n\\tvar recibe=$(this).val();\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#externos tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='cedula'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.cedula\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='costo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.costo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='cargo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.cargo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\t\\n\\treturn false;\\n}\",\n \"function filterByName(element)\\r\\n{\\r\\n _upObject.filterByName(element.value, \\\"name\\\");\\r\\n}\",\n \"function filtro(categoria) {\\n setCat(categoria)\\n }\",\n \"function filterByName(searchForName, personList) {\\n searchForName = searchForName.toLowerCase();\\n return personList.filter((person) => {\\n console.log(person)\\n // Only needs to check if letters typed so far are included in name, not equal to name. \\n return person.name.toLowerCase().includes(searchForName);\\n });\\n}\",\n \"function filterData(tex) {\\n const tempRests = rests.filter((itm) => itm.name.toLowerCase().includes(tex.toLowerCase()));\\n setFilteredRests(tempRests);\\n }\",\n \"_filter(value) {\\n //convert text to lower case\\n const filterValue = value.toLowerCase();\\n //get matching products\\n return this.products.filter(option => option.toLowerCase().includes(filterValue));\\n }\",\n \"function filterName(){\\n\\t// Set filters to localstorage\\n\\tvar formName = $(\\\"#searchTitle\\\").val();\\n\\tif(formName == \\\"\\\"){\\n\\t\\tfilterResults();\\n\\t}\\n\\telse{\\n\\t\\tsearchResults(formName, \\\"600\\\", \\\"2800\\\");\\n\\t}\\n}\",\n \"function nameFilterEvent() {\\n var input, filter, ul, li, a, i, txtValue;\\n input = document.getElementById(\\\"filterInputName\\\");\\n filter = input.value.toUpperCase();\\n\\n ul = document.getElementsByClassName(\\\"eventListTable\\\");\\n li = ul[0].getElementsByTagName(\\\"li\\\");\\n \\n for (i = 0; i < li.length; i++) {\\n a = li[i].getElementsByTagName(\\\"h1\\\")[0];\\n txtValue = a.textContent || a.innerText;\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"\\\";\\n } else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function filtroProdutos() {\\r\\n var input, filter, table, tr, td, td2, td3, i;\\r\\n input = document.getElementById(\\\"search\\\");\\r\\n filter = input.value.toUpperCase();\\r\\n table = document.getElementById(\\\"table\\\");\\r\\n tr = table.getElementsByTagName(\\\"tr\\\");\\r\\n for (i = 0; i < tr.length; i++) {\\r\\n td = tr[i].getElementsByTagName(\\\"td\\\")[0]; //ID\\r\\n td2 = tr[i].getElementsByTagName(\\\"td\\\")[1]; //Descrição\\r\\n td3 = tr[i].getElementsByTagName(\\\"td\\\")[3]; //Código de barras\\r\\n if (td || td2 || td3) {\\r\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\\r\\n tr[i].style.display = \\\"\\\";\\r\\n } else {\\r\\n tr[i].style.display = \\\"none\\\";\\r\\n }\\r\\n }\\r\\n }\\r\\n}\",\n \"filteravanzado(event) {\\n var text = event.target.value\\n console.log(text)\\n const data = this.state.listaBackup2\\n const newData = data.filter(function (item) {\\n\\n const itemDataTitle = item.titulo.toUpperCase()\\n const itemDataSubt = item.subtitulo.toUpperCase()\\n const campo = itemDataTitle+\\\" \\\"+itemDataSubt\\n const textData = text.toUpperCase()\\n return campo.indexOf(textData) > -1\\n })\\n this.setState({\\n listaAviso2: newData,\\n textBuscar2: text,\\n })\\n }\",\n \"findItem(query) {\\n if (query === '') {\\n return this.dataSearch.slice(0, 5);\\n }\\n const regex = new RegExp(`${query.trim()}`, 'i');\\n return this.dataSearch.filter(film => film.name.search(regex) >= 0);\\n }\",\n \"function filter(kataKunci) {\\n var filteredItems = []\\n for (var j = 0; j < items.length; j++) {\\n var item = items[j];\\n var namaItem = item[1]\\n var isMatched = namaItem.toLowerCase().includes(kataKunci.toLowerCase())\\n\\n if(isMatched == true) {\\n filteredItems.push(item)\\n }\\n }\\n return filteredItems\\n}\",\n \"function filterTasks() {\\n let result = filter.value.toLowerCase()\\n document.querySelectorAll(\\\".collection-item\\\").forEach(function (item) { //NodeList\\n if (item.innerText.toLowerCase().includes(result)) {\\n item.style.display = \\\"block\\\"\\n } else {\\n item.style.display = \\\"none\\\"\\n }\\n })\\n /*\\n Array.from(taskList.children).forEach(function(item){\\n item.style.display = (item.textContent.toLowerCase().includes(e.target.value.toLowerCase())? \\\"block\\\" : \\\"none\\\")\\n })\\n */\\n}\",\n \"function filter(word) {\\n let length = items.length\\n let collection = []\\n let hidden = 0\\n for (let i = 0; i < length; i++) {\\n if (items[i].value.toLowerCase().startsWith(word)) {\\n $(items[i]).css({display: 'block'})\\n }\\n else {\\n $(items[i]).css({display: 'none'})\\n hidden++\\n }\\n }\\n\\n //If all items are hidden, show the empty view\\n if (hidden === length) {\\n $('#empty').show()\\n }\\n else {\\n $('#empty').hide()\\n }\\n}\",\n \"function filtrarProductosXEtiqueta() {\\n let textoIngresado = $(\\\"#txtFiltroProductos\\\").val();\\n textoIngresado = textoIngresado.toLowerCase();\\n let arrayFiltrados = { data: Array(), error: \\\"\\\" };\\n for (let i = 0; i < productos.length; i++) {\\n let unProd = productos[i];\\n let unaEtiqueta = unProd.etiquetas;\\n let x = 0;\\n let encontrado = false;\\n while (!encontrado && x < unaEtiqueta.length) {\\n let etiquetaX = unaEtiqueta[x];\\n if (etiquetaX.includes(textoIngresado)) {\\n arrayFiltrados.data.push(unProd);\\n encontrado = true;\\n }\\n x++;\\n }\\n }\\n crearListadoProductos(arrayFiltrados);\\n}\",\n \"function sexoSeleccionado(){\\n console.trace('sexoSeleccionado');\\n let sexo = document.getElementById(\\\"selector\\\").value;\\n console.debug(sexo);\\n if(sexo == 't'){\\n pintarLista( personas );\\n }else{\\n const personasFiltradas = personas.filter( el => el.sexo == sexo) ;\\n pintarLista( personasFiltradas );\\n \\n \\n }//sexoSeleccionado\\n limpiarSelectores('sexoselec');\\n \\n}\",\n \"function filter(films, margins) {\\n\\tif (margins[0]==10&&margins[1]==100) {\\n\\t}else{\\n\\t\\titems.innerHTML=\\\"\\\";\\n\\t\\tvar searchedFilms = [];\\n\\t\\tvar filmRating;\\n\\t\\tfor (var i=0; iGenre: \\\" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\\n\\t\\t\\tfilmRating = films[i].rating.replace(\\\".\\\", \\\"\\\");\\n\\t\\t\\tfilmRating = filmRating.replace(\\\".\\\", \\\"\\\");\\n\\t\\t\\tif (filmRating>margins[0]&&filmRating l.titre.includes(searchFilter)||l.auteur.nom.includes(searchFilter)||l.auteur.prenom.includes(searchFilter));\\n\\t}\",\n \"filteredFruits(){\\n return this.fruits.filter((element)=> {\\n return element.match(this.filterInputText)\\n })\\n }\",\n \"function filterGenres() {\\r\\n var genderMovieSelect = $(\\\"#genders-movie select\\\").val()\\r\\n if (genderMovieSelect != \\\"all\\\") {\\r\\n $(\\\"#movie .template\\\").each(function() {\\r\\n var gid = $(this).attr(\\\"data-generi\\\").split(',');\\r\\n if (gid.includes(genderMovieSelect)) $(this).show()\\r\\n else $(this).hide()\\r\\n });\\r\\n } else {\\r\\n $(\\\"#movie .template\\\").show()\\r\\n }\\r\\n var genderTVSelect = $(\\\"#genders-tv select\\\").val()\\r\\n if (genderTVSelect != \\\"all\\\") {\\r\\n $(\\\"#tvshow .template\\\").each(function() {\\r\\n var gid = $(this).attr(\\\"data-generi\\\").split(',');\\r\\n if (gid.includes(genderMovieSelect)) $(this).show()\\r\\n else $(this).hide()\\r\\n });\\r\\n } else {\\r\\n $(\\\"#tvshow .template\\\").show()\\r\\n }\\r\\n }\",\n \"function filterFunction() {\\n var input, filter, ul, li, a, i;\\n input = document.getElementById(\\\"mySearches\\\");\\n filter = input.value.toUpperCase();\\n div = document.getElementById(\\\"mySearch\\\");\\n a = div.getElementsByTagName(\\\"a\\\");\\n for (i = 0; i < a.length; i++) {\\n txtValue = a[i].textContent || a[i].innerText;\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n a[i].style.display = \\\"\\\";\\n } else {\\n a[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function filtros3(){\\n\\t\\n\\t\\n\\tvar recibe=$(this).val();\\t\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#admin tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='area'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.area\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='super'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.super\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='baja'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.baja\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='inicio'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.inicio\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='fin'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.fin\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='jefe'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.jefe\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\t\\n\\treturn false;\\n}\",\n \"function displayFilterValues(type, name) {\\n $(\\\"#filterType\\\").text(type);\\n\\n //to ensure that the name is not too long\\n const maxNameLength = 25;\\n if (name.length > maxNameLength) {\\n const nameArr = name.split(' ');\\n name = '';\\n for (let count = 0; count < nameArr.length; count++) {\\n if ((name + nameArr[count]).length > maxNameLength) break;\\n name += ' ' + nameArr[count];\\n }\\n name = name.substring(1);\\n }\\n\\n $(\\\"#filterName\\\").text(name);\\n}\",\n \"function filterNames () {\\n\\n // Declare variable to hold value of filtered names\\n let filteredNames;\\n\\n // If all...\\n if (isAllShowing===true) {\\n filteredNames = myNames.map((name) => {\\n name.is_visible=true\\n return name\\n });\\n setMyNames(filteredNames);\\n }\\n\\n // If first...\\n else if (isFirstShowing===true) {\\n filteredNames = myNames.map((name) => {\\n if (name.type==='first') {\\n name.is_visible=true\\n return name\\n }\\n else {\\n name.is_visible=false\\n return name;\\n }\\n });\\n setMyNames(filteredNames);\\n }\\n\\n // If middle...\\n else if (isMiddleShowing===true) {\\n filteredNames = myNames.map((name) => {\\n if (name.type==='middle') {\\n name.is_visible=true\\n return name\\n }\\n else {\\n name.is_visible=false\\n return name;\\n }\\n });\\n setMyNames(filteredNames);\\n }\\n\\n // If full...(implied as all other types are specified in above conditionals)\\n else {\\n filteredNames = myNames.map((name) => {\\n if (name.type==='full') {\\n name.is_visible=true\\n return name\\n }\\n else {\\n name.is_visible=false\\n return name;\\n }\\n });\\n setMyNames(filteredNames);\\n }\\n }\",\n \"selectFilterFacilidade(facilidades){\\n\\n //to open the DropDown\\n this.getDropDownBoxFacilidades().click();\\n\\n //Search by the passed facilidades and click in checkBoxes\\n facilidades.forEach((item) => {\\n this.getCheckboxesFacilidades().contains(item).click();\\n });\\n }\",\n \"function filtra(event){\\n\\t\\n\\tconst searchString=event.currentTarget.value.toLowerCase();\\n\\tconst trovati = document.querySelectorAll('.cercato');\\n\\tconst corpo = document.querySelector('body');\\n\\tconst primaSezione = document.querySelector('section');\\n\\tconst oggetti = document.querySelectorAll('.oggetto');\\n\\t\\n\\tconst sezFiltrati = document.createElement('div');\\n\\tsezFiltrati.classList.add('filtrati');\\n\\tcorpo.insertBefore(sezFiltrati, primaSezione);\\n\\t\\t\\n\\t\\tfor(let obj of oggetti){\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tif(obj.childNodes[4].innerText.toLowerCase().includes(searchString)){\\n\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst oggetto1 = document.createElement('div'); \\n\\t\\t\\t\\toggetto1.classList.add('cercato');\\n\\t\\t\\t\\tsezFiltrati.appendChild(oggetto1);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst titolo = document.createElement('h2'); \\n\\t\\t\\t\\ttitolo.innerText = obj.childNodes[1].innerText;\\n\\t\\t\\t\\toggetto1.appendChild(titolo);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst immagine1 = document.createElement('img');\\n\\t\\t\\t\\timmagine1.src = obj.childNodes[2].src;\\n\\t\\t\\t\\toggetto1.appendChild(immagine1);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst codice1 = document.createElement('h3');\\n\\t\\t\\t\\tcodice1.textContent = obj.childNodes[3].textContent;\\n\\t\\t\\t\\toggetto1.appendChild(codice1);\\n\\t\\t\\n\\t\\t\\t\\tconst didascalia1 = document.createElement('article');\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tdidascalia1.textContent = obj.childNodes[4].textContent;\\n\\t\\t\\t\\toggetto1.appendChild(didascalia1);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst filtraggio = document.querySelectorAll('.filtrati');\\t\\n//\\t\\t\\t\\tconsole.log(filtraggio);\\n\\t\\t\\t\\tlet conta = 0;\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tfor(let item of filtraggio){\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tconta++;\\n//\\t\\t\\t\\t\\tconsole.log(conta);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(conta > 1){\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tfor(let item of filtraggio){\\n\\t\\t\\t\\t\\t\\titem.remove();\\n\\t\\t\\t\\t\\t\\tconta--;\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(searchString == ''){\\n\\t\\t\\tconst filtraggio = document.querySelectorAll('.filtrati');\\n//\\t\\t\\tconsole.log('Stringa vuota');\\n\\t\\t\\tfor(let item of filtraggio){\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\titem.remove();\\n\\t\\t\\t}\\n\\t\\t}\\n}\",\n \"function filtro(arreglo, criterios,signo) { \\n return arreglo.filter(function(obj) {return Object.keys(criterios).every(function(c) { //retorna los objetos que no cumplan los criterios si signo es true\\n if (signo) //retorna los objetos que cumplen los criterios si signo es false\\n return obj[c] != criterios[c]; // ejmplo de uso (arregloObjetos,{atributo1:a,atributo2:b},true)\\n else \\n return obj[c] == criterios[c]; \\n }); \\n }); \\n }\",\n \"function getCarsByName(name, count = 5) {\\n return data\\n .filter((car) =>\\n car.Name.toLocaleLowerCase().startsWith(name ? name.toLowerCase() : name)\\n )\\n .slice(0, count);\\n}\",\n \"function queryUserName(name){\\n var results = users.filter(function(o){\\n if(o.name.toLowerCase().indexOf(name.toLowerCase()) > - 1){\\n return o;\\n }\\n });\\n showUserResults(results);\\n}\",\n \"function searchAuthName() {\\n let input, filter, table, tr, td, i;\\n input = document.getElementById(\\\"searchAName\\\");\\n filter = input.value.toUpperCase();\\n table = document.getElementById('authorsTable');\\n tr = table.getElementsByTagName(\\\"tr\\\");\\n\\n // Loop through all list items, and hide those who don't match the search query\\n for (i = 0; i < tr.length; i++) {\\n td = tr[i].getElementsByTagName('td')[1];\\n if (td) {\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\\n tr[i].style.display = \\\"\\\";\\n } else {\\n tr[i].style.display = \\\"none\\\";\\n };\\n };\\n };\\n }\",\n \"function filter(){\\n\\n\\tvar fifilter = $('#filter');\\n\\n\\tvar wadahFilter = fifilter.val().toLowerCase();\\n\\n\\tvar buah = $('.buah');\\n\\t\\tfor (var a = 0; a < buah.length; a++) {\\n\\n\\t\\t\\tvar wadahLi = $(buah[a]).text().toLowerCase();\\n\\t\\t\\t\\n\\t\\t\\tif(wadahLi.indexOf(wadahFilter) >= 0){\\n\\t\\t\\t\\t\\t$(buah[a]).slideDown();\\n\\t\\t\\t}else{\\n\\t\\t\\t\\t\\t$(buah[a]).slideUp();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t// buah.each(function(){\\n\\t// \\tvar bubuah = $(this);\\n\\t// \\tvar namaBuah = bubuah.text().toLowerCase();\\n\\n\\t// \\tif(namaBuah.indexOf(wadahFilter) >= 0 ){\\n\\t// \\t\\t$(this).slideDown();\\n\\t// \\t}else{\\n\\t// \\t\\t$(this).slideUp();\\n\\t// \\t}\\n\\t// });\\n\\t\\n\\n}\",\n \"filterFunc (searchExpression, value) {\\n const itemValue = value.name\\n\\n return (!searchExpression || !itemValue)\\n ? false\\n : itemValue.toUpperCase().indexOf(searchExpression.toUpperCase()) !== -1\\n }\",\n \"function search() {\\n let input, filter, li, a, i, txtValue;\\n input = document.querySelector(\\\".search\\\");\\n filter = input.value.toUpperCase();\\n li = document.getElementsByClassName(\\\"readthis\\\");\\n for (i = 0; i < li.length; i++) {\\n a = li[i].getElementsByClassName(\\\"studentdetails\\\")[0];\\n txtValue = a.textContent || a.innerText;\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"\\\";\\n } else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function filterUser(value) {\\n const filterIndex = select.selectedIndex\\n let filter = select.options[select.selectedIndex].text\\n if (value.length >= 3) {\\n filteredUsers = users.filter((user) => {\\n if (user[filter].toLowerCase().includes(value.toLowerCase())) {\\n return user[filter]\\n }\\n })\\n createCards(filteredUsers)\\n } else if (value.length === 0) {\\n createCards(users)\\n }\\n\\n}\",\n \"function filterByGame() {\\n clearSearchbar();\\n const chosenGame = this.value;\\n const allGameCategories = Array.from(document.querySelectorAll(\\\".game-name\\\"));\\n allGameCategories.forEach(gameName => {\\n if (gameName.textContent !== chosenGame) {\\n gameName.parentElement.parentElement.parentElement.classList.add(\\\"hidden\\\");\\n }\\n else(gameName.parentElement.parentElement.parentElement.classList.remove(\\\"hidden\\\"));\\n });\\n checkAllTermsHidden();\\n}\",\n \"function filterTasks(e){\\n const text=e.target.value.toLowerCase();\\n //We used for each as the query selector all returns nodelist\\n document.querySelectorAll('.collection-item').forEach(function(task)\\n {\\n const item=task.firstChild.textContent;\\n if(item.toLowerCase().indexOf(text)!=-1)\\n {\\n task.style.display='block';\\n\\n }\\n else{\\n task.style.display='none';\\n }\\n });\\n}\",\n \"function textFilter() {\\n var filterValue, input, ul, li, i;\\n input = document.querySelector(\\\"#filterCompany\\\");\\n filterValue = input.value.toUpperCase();\\n ul = document.querySelector(\\\"#listOfCompanies\\\")\\n li = document.querySelectorAll(\\\"#listOfCompanies li\\\");\\n\\n for(i=0; i < li.length; i++) {\\n var a = li[i];\\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\\n li[i].style.display = \\\"\\\";\\n }\\n else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function searchText(value) {\\r\\n const card = document.querySelectorAll('.card');\\r\\n for (let i = 0; i < card.length; i++) {\\r\\n const userName = card[i].querySelector('.card-name').textContent\\r\\n if (userName.indexOf(value) > -1) {\\r\\n card[i].style.display = \\\"\\\";\\r\\n } else {\\r\\n card[i].style.display = \\\"none\\\";\\r\\n\\r\\n }\\r\\n }\\r\\n}\",\n \"function filtrarAuto() {\\r\\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\\r\\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\\r\\n // console.log(resultado);\\r\\n if (resultado.length)\\r\\n mostrarAutos(resultado);\\r\\n else\\r\\n noHayResultados();\\r\\n}\",\n \"function createFilterFor(query) {\\n\\n return function filterFn(proyecto) {\\n return (proyecto.titulo.indexOf(query) === 0);\\n };\\n }\",\n \"function filterByName(val){\\n return val.speaker == this;\\n }\",\n \"function SearchByName(){\\n if(inputSearch.value !== \\\"\\\"){\\n setTimeout(responsiveVoice.speak(inputSearch.value),0);\\n resultHotel= [];\\n result = hotels.filter((hotel) =>{\\n if( hotel.name.toLocaleLowerCase().indexOf(inputSearch.value.toLocaleLowerCase()) > -1){\\n return hotel;\\n }\\n })\\n inputSearch.value=\\\"\\\";\\n resultHotel = result;\\n display(result);\\n }else{\\n alerts(\\\"Add your Search\\\",3000);\\n }\\n range();\\n filterByPrice()\\n}\",\n \"filteredBirds() {\\n return vm.birds.filter(\\n (bird) => {\\n let filterBirdResult = true\\n if (this.filterName !== \\\"\\\") {\\n filterBirdResult = bird.name.includes(vm.filterName)\\n\\n }\\n return filterBirdResult\\n\\n }\\n )\\n\\n }\",\n \"function filterProjectsBy(evt) {\\n var category = evt.target.value;\\n $('.project-filterable').hide();\\n if (category) {\\n $('.' + category).show();\\n } else {\\n $('.project-filterable').show();\\n }\\n}\",\n \"function filterTasks(e){\\n console.log(\\\"Task filter...\\\")\\n var searchFilter, listItem, txtValue;\\n searchFilter = filter.value.toUpperCase();\\n listItem = document.querySelectorAll('.collection-item');\\n //looping through the list items, and hiding unmatching results\\n listItem.forEach(function(element){\\n txtValue = element.textContent || element.innerText;\\n if(txtValue.toUpperCase().indexOf(searchFilter) > -1){\\n element.style.display = \\\"\\\";\\n }else{\\n element.style.display = \\\"none\\\";\\n }\\n });\\n}\",\n \"filter(event) {\\n var text = event.target.value\\n console.log(text)\\n const data = this.state.listaBackup\\n const newData = data.filter(function (item) {\\n const itemData = item.titulo.toUpperCase()\\n const textData = text.toUpperCase()\\n return itemData.indexOf(textData) > -1\\n })\\n this.setState({\\n listaAviso: newData,\\n textBuscar: text,\\n })\\n }\",\n \"function search() {\\n const text = this.value;\\n if (text === '') {\\n rows.forEach(row => row.style.display = null);\\n return;\\n }\\n const length = names.length;\\n const regex = new RegExp(text, 'gi');\\n for (let i = 0; i < length; i++) {\\n if (names[i].match(regex)) rows[i].style.display = null;\\n else rows[i].style.display = 'none';\\n }\\n}\",\n \"function createFilterFor(query) {\\n\\n return function filterFn(fondeo) {\\n return (fondeo.titulo.indexOf(query) === 0);\\n };\\n }\",\n \"filterSuggest(results, search) {\\n const filter = results.filter( filter => filter.calle.indexOf(search) !== -1 );\\n\\n // Mostrar pines del Filtro\\n this.showPins(filter);\\n }\",\n \"function filterUl(value) {\\n var list = $(\\\"#drag-list-container li\\\").hide()\\n .filter(function () {\\n var item = $(this).text();\\n var padrao = new RegExp(value, \\\"i\\\");\\n return padrao.test(item);\\n }).closest(\\\"li\\\").show();\\n}\",\n \"filteredBirds() {\\n return this.birds.filter(\\n (bird) => {\\n let filterBirdResult = true\\n if (this.filterName !== \\\"\\\") {\\n filterBirdResult = bird.name.includes(this.filterName)\\n\\n }\\n return filterBirdResult\\n\\n }\\n )\\n\\n }\",\n \"function searchName(){\\n\\n const searchValue = document.querySelector('.search-input').value;\\n const cards = document.querySelectorAll(\\\".card\\\");\\n for (let index = 0; index < cards.length; index++) {\\n const name = cards[index].querySelector(\\\"#name\\\").innerHTML;\\n if (name.indexOf(searchValue)!=-1) {\\n cards[index].style.display = \\\"\\\";\\n }\\n else{\\n cards[index].style.display = \\\"none\\\";\\n }\\n \\n }\\n\\n}\",\n \"function searchEmployees() {\\n const searchName = searchBar.value.toLowerCase();\\n const cards = document.querySelectorAll(\\\".card\\\");\\n const names = document.querySelectorAll(\\\".card-name\\\");\\n\\n names.forEach((name, index) => {\\n const nameValue = name.textContent.toLowerCase();\\n\\n if (nameValue.includes(searchName)) {\\n cards[index].style.display = \\\"flex\\\";\\n } else {\\n cards[index].style.display = \\\"none\\\";\\n }\\n });\\n}\",\n \"function searchmovie() {\\r\\n var search,filter,ul,li,a,i,text;\\r\\n search=document.getElementById(\\\"inputid\\\");\\r\\n filter=search.value.toUpperCase();\\r\\n ul=document.getElementById(\\\"ulid\\\");\\r\\n li=ul.getElementsByTagName(\\\"li\\\");\\r\\n for(i=0; i -1)\\r\\n {\\r\\n li[i].style.display=\\\"\\\";\\r\\n }\\r\\n else\\r\\n {\\r\\n li[i].style.display=\\\"none\\\";\\r\\n }\\r\\n }\\r\\n}\",\n \"function searchCoffeeNames(e) {\\n e.preventDefault();\\n var userCoffeeName = document.getElementById(\\\"user-search\\\").value;\\n var filteredNames = [];\\n coffees.forEach(function(coffee) {\\n\\n if(coffee.name.toLowerCase().includes(userCoffeeName.toLowerCase())){\\n filteredNames.push(coffee);\\n\\n }\\n });\\n divBody.innerHTML = renderCoffees(filteredNames);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7111127","0.70671946","0.6926898","0.65646803","0.65564334","0.65414715","0.6495549","0.64823645","0.6480472","0.64273787","0.6356719","0.6287484","0.628119","0.62747353","0.6254951","0.62457097","0.6240369","0.6231702","0.62291324","0.6214421","0.61833346","0.61649287","0.61540836","0.6152671","0.6150111","0.61392003","0.6131705","0.61268264","0.61259377","0.6095607","0.60922086","0.6086056","0.6080461","0.60792506","0.60767734","0.6075486","0.6068441","0.60681546","0.60640305","0.6064003","0.60636234","0.60502464","0.60488564","0.604296","0.60367113","0.60367113","0.60263735","0.5979184","0.5976218","0.59689987","0.5962634","0.59612143","0.5948518","0.5946755","0.5940837","0.59381574","0.5936582","0.5930257","0.59255344","0.59248585","0.5923567","0.59207857","0.59156793","0.5912786","0.59094304","0.58990616","0.5897481","0.5888217","0.588466","0.58823884","0.58691734","0.58639187","0.58576757","0.58512354","0.58500934","0.5843733","0.58343816","0.5820156","0.581933","0.5818533","0.5810253","0.58017683","0.5798005","0.5793281","0.5789564","0.5786442","0.57753366","0.57703155","0.57699883","0.5764388","0.5760336","0.57591444","0.575787","0.5753717","0.57503706","0.57480997","0.5741961","0.5738072","0.5730007","0.5728624","0.5724562"],"string":"[\n \"0.7111127\",\n \"0.70671946\",\n \"0.6926898\",\n \"0.65646803\",\n \"0.65564334\",\n \"0.65414715\",\n \"0.6495549\",\n \"0.64823645\",\n \"0.6480472\",\n \"0.64273787\",\n \"0.6356719\",\n \"0.6287484\",\n \"0.628119\",\n \"0.62747353\",\n \"0.6254951\",\n \"0.62457097\",\n \"0.6240369\",\n \"0.6231702\",\n \"0.62291324\",\n \"0.6214421\",\n \"0.61833346\",\n \"0.61649287\",\n \"0.61540836\",\n \"0.6152671\",\n \"0.6150111\",\n \"0.61392003\",\n \"0.6131705\",\n \"0.61268264\",\n \"0.61259377\",\n \"0.6095607\",\n \"0.60922086\",\n \"0.6086056\",\n \"0.6080461\",\n \"0.60792506\",\n \"0.60767734\",\n \"0.6075486\",\n \"0.6068441\",\n \"0.60681546\",\n \"0.60640305\",\n \"0.6064003\",\n \"0.60636234\",\n \"0.60502464\",\n \"0.60488564\",\n \"0.604296\",\n \"0.60367113\",\n \"0.60367113\",\n \"0.60263735\",\n \"0.5979184\",\n \"0.5976218\",\n \"0.59689987\",\n \"0.5962634\",\n \"0.59612143\",\n \"0.5948518\",\n \"0.5946755\",\n \"0.5940837\",\n \"0.59381574\",\n \"0.5936582\",\n \"0.5930257\",\n \"0.59255344\",\n \"0.59248585\",\n \"0.5923567\",\n \"0.59207857\",\n \"0.59156793\",\n \"0.5912786\",\n \"0.59094304\",\n \"0.58990616\",\n \"0.5897481\",\n \"0.5888217\",\n \"0.588466\",\n \"0.58823884\",\n \"0.58691734\",\n \"0.58639187\",\n \"0.58576757\",\n \"0.58512354\",\n \"0.58500934\",\n \"0.5843733\",\n \"0.58343816\",\n \"0.5820156\",\n \"0.581933\",\n \"0.5818533\",\n \"0.5810253\",\n \"0.58017683\",\n \"0.5798005\",\n \"0.5793281\",\n \"0.5789564\",\n \"0.5786442\",\n \"0.57753366\",\n \"0.57703155\",\n \"0.57699883\",\n \"0.5764388\",\n \"0.5760336\",\n \"0.57591444\",\n \"0.575787\",\n \"0.5753717\",\n \"0.57503706\",\n \"0.57480997\",\n \"0.5741961\",\n \"0.5738072\",\n \"0.5730007\",\n \"0.5728624\",\n \"0.5724562\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":36,"cells":{"query":{"kind":"string","value":"Checks if `value` is a property name and not a property path."},"document":{"kind":"string","value":"function isKey(value, object) {\n if (Array.isArray(value)) {\n return false;\n }\n const type = typeof value;\n if (\n type === \"number\" ||\n type === \"boolean\" ||\n value == null ||\n isSymbol(value)\n ) {\n return true;\n }\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object != null && value in Object(object))\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 isControlled(props, valueProp) {\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\n // Mirror that behavior here (rather than checking for just undefined).\n return props[valueProp] !== undefined && props[valueProp] !== null;\n}","function isControlled(props, valueProp) {\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\n // Mirror that behavior here (rather than checking for just undefined).\n return props[valueProp] !== undefined && props[valueProp] !== null;\n}","function checkOjects(value, obj) {\n return !!obj[value]\n }","validateVariablesValue(value, property, relativePath) {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n throw new Error(`Only an object can be converted to style vars (${relativePath}${property})`);\n }\n\n const keys = Object.keys(value);\n for (const k of keys) {\n if (!(\n // Define ok types of value (can be output as a style var)\n typeof value[k] === \"string\"\n || (typeof value[k] === \"number\" && Number.isFinite(value[k]))\n )) {\n throw new Error(\n `Style vars must have a value of type \"string\" or \"number\". Only flat objects are supported. ` +\n `In: ${relativePath}${property ? \":\" : \"\"}${property}`);\n }\n }\n\n return true;\n }","_isValidPropertyName(str) {\n return /^(?![0-9])[a-zA-Z0-9$_]+$/.test(str);\n }","function objectPropertyHasValue(prop) {\r\n\r\n return typeof prop !== 'undefined' && prop !== \"\" ? true : false;\r\n}","function isKey(value, key) {\n\t\t\t/// Validate a value as being equal to an object key.\n\t\t\t/// The value to validate.\n\t\t\t/// The name of the property\n\t\t\t/// \n\n\t\t\tif (value === null || value === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (Object.keys(obj).indexOf(value) !== -1) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tthrow new TypeError(\n\t\t\t\tkey + \" must be one of: \" + Object.keys(obj).join(\", \")\n\t\t\t);\n\t\t}","function assertProp(\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(\n prop,\n name,\n value,\n vm,\n absent,\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm,\n );\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || \"\");\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm,\n );\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name +\n '\".',\n vm,\n );\n }\n }\n }","function assertProp(prop, name, value, vm, absent) {\n\t if (prop.required && absent) {\n\t warn('Missing required prop: \"' + name + '\"', vm);\n\t return;\n\t }\n\t if (value == null && !prop.required) {\n\t return;\n\t }\n\t var type = prop.type;\n\t var valid = !type || type === true;\n\t var expectedTypes = [];\n\t if (type) {\n\t if (!Array.isArray(type)) {\n\t type = [type];\n\t }\n\t for (var i = 0; i < type.length && !valid; i++) {\n\t var assertedType = assertType(value, type[i]);\n\t expectedTypes.push(assertedType.expectedType || '');\n\t valid = assertedType.valid;\n\t }\n\t }\n\t if (!valid) {\n\t warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n\t return;\n\t }\n\t var validator = prop.validator;\n\t if (validator) {\n\t if (!validator(value)) {\n\t warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n\t }\n\t }\n\t}","function assertProp(prop, name, value, vm, absent) {\n\t if (prop.required && absent) {\n\t warn('Missing required prop: \"' + name + '\"', vm);\n\t return;\n\t }\n\t if (value == null && !prop.required) {\n\t return;\n\t }\n\t var type = prop.type;\n\t var valid = !type || type === true;\n\t var expectedTypes = [];\n\t if (type) {\n\t if (!Array.isArray(type)) {\n\t type = [type];\n\t }\n\t for (var i = 0; i < type.length && !valid; i++) {\n\t var assertedType = assertType(value, type[i]);\n\t expectedTypes.push(assertedType.expectedType || '');\n\t valid = assertedType.valid;\n\t }\n\t }\n\t if (!valid) {\n\t warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n\t return;\n\t }\n\t var validator = prop.validator;\n\t if (validator) {\n\t if (!validator(value)) {\n\t warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n\t }\n\t }\n\t}","function assertProp(prop, name, value, vm, absent) {\n\t if (prop.required && absent) {\n\t warn('Missing required prop: \"' + name + '\"', vm);\n\t return;\n\t }\n\t if (value == null && !prop.required) {\n\t return;\n\t }\n\t var type = prop.type;\n\t var valid = !type || type === true;\n\t var expectedTypes = [];\n\t if (type) {\n\t if (!Array.isArray(type)) {\n\t type = [type];\n\t }\n\t for (var i = 0; i < type.length && !valid; i++) {\n\t var assertedType = assertType(value, type[i]);\n\t expectedTypes.push(assertedType.expectedType || '');\n\t valid = assertedType.valid;\n\t }\n\t }\n\t if (!valid) {\n\t warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n\t return;\n\t }\n\t var validator = prop.validator;\n\t if (validator) {\n\t if (!validator(value)) {\n\t warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n\t }\n\t }\n\t}","function IsPropertyKey(argument) {\n if (Type(argument) === 'string') return true;\n if (Type(argument) === 'symbol') return true;\n return false;\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n `Invalid prop: type check failed for prop \"${name}\".` +\n ` Expected ${expectedTypes.map(capitalize).join(', ')}` +\n `, got ${toRawType(value)}.`,\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n }","function assertProp(\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i], vm);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n var haveExpectedTypes = expectedTypes.some(function (t) {\n return t;\n });\n if (!valid && haveExpectedTypes) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function check_property(obj, name, value)\n{\n property = Object.getOwnPropertyDescriptor(obj, name)\n assert(typeof property === \"object\")\n assert(property.value === value)\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n \n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function isMapProperty(name) {\n return isObjectProperty(name) || ['any','collect',\n 'collectEntries','collectMany','countBy','dropWhile',\n 'each','eachWithIndex','every','find','findAll',\n 'findResult','findResults','get','getAt','groupBy',\n 'inject','intersect','max','min',\n 'putAll','putAt','reverseEach', 'clear',\n 'sort','spread','subMap','add','take','takeWhile',\n 'withDefault','count','drop','keySet',\n 'put','size','isEmpty','remove','containsKey',\n 'containsValue','values'].indexOf(name) >= 0;\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}"],"string":"[\n \"function isControlled(props, valueProp) {\\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\\n // Mirror that behavior here (rather than checking for just undefined).\\n return props[valueProp] !== undefined && props[valueProp] !== null;\\n}\",\n \"function isControlled(props, valueProp) {\\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\\n // Mirror that behavior here (rather than checking for just undefined).\\n return props[valueProp] !== undefined && props[valueProp] !== null;\\n}\",\n \"function checkOjects(value, obj) {\\n return !!obj[value]\\n }\",\n \"validateVariablesValue(value, property, relativePath) {\\n if (Object.prototype.toString.call(value) !== '[object Object]') {\\n throw new Error(`Only an object can be converted to style vars (${relativePath}${property})`);\\n }\\n\\n const keys = Object.keys(value);\\n for (const k of keys) {\\n if (!(\\n // Define ok types of value (can be output as a style var)\\n typeof value[k] === \\\"string\\\"\\n || (typeof value[k] === \\\"number\\\" && Number.isFinite(value[k]))\\n )) {\\n throw new Error(\\n `Style vars must have a value of type \\\"string\\\" or \\\"number\\\". Only flat objects are supported. ` +\\n `In: ${relativePath}${property ? \\\":\\\" : \\\"\\\"}${property}`);\\n }\\n }\\n\\n return true;\\n }\",\n \"_isValidPropertyName(str) {\\n return /^(?![0-9])[a-zA-Z0-9$_]+$/.test(str);\\n }\",\n \"function objectPropertyHasValue(prop) {\\r\\n\\r\\n return typeof prop !== 'undefined' && prop !== \\\"\\\" ? true : false;\\r\\n}\",\n \"function isKey(value, key) {\\n\\t\\t\\t/// Validate a value as being equal to an object key.\\n\\t\\t\\t/// The value to validate.\\n\\t\\t\\t/// The name of the property\\n\\t\\t\\t/// \\n\\n\\t\\t\\tif (value === null || value === undefined) {\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (Object.keys(obj).indexOf(value) !== -1) {\\n\\t\\t\\t\\treturn value;\\n\\t\\t\\t}\\n\\n\\t\\t\\tthrow new TypeError(\\n\\t\\t\\t\\tkey + \\\" must be one of: \\\" + Object.keys(obj).join(\\\", \\\")\\n\\t\\t\\t);\\n\\t\\t}\",\n \"function assertProp(\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(\\n prop,\\n name,\\n value,\\n vm,\\n absent,\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm,\\n );\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || \\\"\\\");\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm,\\n );\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name +\\n '\\\".',\\n vm,\\n );\\n }\\n }\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n\\t if (prop.required && absent) {\\n\\t warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n\\t return;\\n\\t }\\n\\t if (value == null && !prop.required) {\\n\\t return;\\n\\t }\\n\\t var type = prop.type;\\n\\t var valid = !type || type === true;\\n\\t var expectedTypes = [];\\n\\t if (type) {\\n\\t if (!Array.isArray(type)) {\\n\\t type = [type];\\n\\t }\\n\\t for (var i = 0; i < type.length && !valid; i++) {\\n\\t var assertedType = assertType(value, type[i]);\\n\\t expectedTypes.push(assertedType.expectedType || '');\\n\\t valid = assertedType.valid;\\n\\t }\\n\\t }\\n\\t if (!valid) {\\n\\t warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n\\t return;\\n\\t }\\n\\t var validator = prop.validator;\\n\\t if (validator) {\\n\\t if (!validator(value)) {\\n\\t warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n\\t }\\n\\t }\\n\\t}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n\\t if (prop.required && absent) {\\n\\t warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n\\t return;\\n\\t }\\n\\t if (value == null && !prop.required) {\\n\\t return;\\n\\t }\\n\\t var type = prop.type;\\n\\t var valid = !type || type === true;\\n\\t var expectedTypes = [];\\n\\t if (type) {\\n\\t if (!Array.isArray(type)) {\\n\\t type = [type];\\n\\t }\\n\\t for (var i = 0; i < type.length && !valid; i++) {\\n\\t var assertedType = assertType(value, type[i]);\\n\\t expectedTypes.push(assertedType.expectedType || '');\\n\\t valid = assertedType.valid;\\n\\t }\\n\\t }\\n\\t if (!valid) {\\n\\t warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n\\t return;\\n\\t }\\n\\t var validator = prop.validator;\\n\\t if (validator) {\\n\\t if (!validator(value)) {\\n\\t warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n\\t }\\n\\t }\\n\\t}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n\\t if (prop.required && absent) {\\n\\t warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n\\t return;\\n\\t }\\n\\t if (value == null && !prop.required) {\\n\\t return;\\n\\t }\\n\\t var type = prop.type;\\n\\t var valid = !type || type === true;\\n\\t var expectedTypes = [];\\n\\t if (type) {\\n\\t if (!Array.isArray(type)) {\\n\\t type = [type];\\n\\t }\\n\\t for (var i = 0; i < type.length && !valid; i++) {\\n\\t var assertedType = assertType(value, type[i]);\\n\\t expectedTypes.push(assertedType.expectedType || '');\\n\\t valid = assertedType.valid;\\n\\t }\\n\\t }\\n\\t if (!valid) {\\n\\t warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n\\t return;\\n\\t }\\n\\t var validator = prop.validator;\\n\\t if (validator) {\\n\\t if (!validator(value)) {\\n\\t warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n\\t }\\n\\t }\\n\\t}\",\n \"function IsPropertyKey(argument) {\\n if (Type(argument) === 'string') return true;\\n if (Type(argument) === 'symbol') return true;\\n return false;\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n `Invalid prop: type check failed for prop \\\"${name}\\\".` +\\n ` Expected ${expectedTypes.map(capitalize).join(', ')}` +\\n `, got ${toRawType(value)}.`,\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n }\",\n \"function assertProp(\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i], vm);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n var haveExpectedTypes = expectedTypes.some(function (t) {\\n return t;\\n });\\n if (!valid && haveExpectedTypes) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function check_property(obj, name, value)\\n{\\n property = Object.getOwnPropertyDescriptor(obj, name)\\n assert(typeof property === \\\"object\\\")\\n assert(property.value === value)\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n \\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function isMapProperty(name) {\\n return isObjectProperty(name) || ['any','collect',\\n 'collectEntries','collectMany','countBy','dropWhile',\\n 'each','eachWithIndex','every','find','findAll',\\n 'findResult','findResults','get','getAt','groupBy',\\n 'inject','intersect','max','min',\\n 'putAll','putAt','reverseEach', 'clear',\\n 'sort','spread','subMap','add','take','takeWhile',\\n 'withDefault','count','drop','keySet',\\n 'put','size','isEmpty','remove','containsKey',\\n 'containsValue','values'].indexOf(name) >= 0;\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType);\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType);\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType);\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.60520184","0.60520184","0.60428756","0.58993435","0.5889884","0.585996","0.5847797","0.5843738","0.57885444","0.5783723","0.5783723","0.5783723","0.5783723","0.5783723","0.5783723","0.5781897","0.57815415","0.57815415","0.57815415","0.5776515","0.577588","0.577588","0.5771946","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.5762621","0.57625186","0.57500386","0.5747452","0.5747452","0.5747452","0.5747452","0.5747394","0.5742467","0.57264394","0.57261753","0.57261753","0.5724732","0.5724732","0.5724732","0.5724732"],"string":"[\n \"0.60520184\",\n \"0.60520184\",\n \"0.60428756\",\n \"0.58993435\",\n \"0.5889884\",\n \"0.585996\",\n \"0.5847797\",\n \"0.5843738\",\n \"0.57885444\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5781897\",\n \"0.57815415\",\n \"0.57815415\",\n \"0.57815415\",\n \"0.5776515\",\n \"0.577588\",\n \"0.577588\",\n \"0.5771946\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.5762621\",\n \"0.57625186\",\n \"0.57500386\",\n \"0.5747452\",\n \"0.5747452\",\n \"0.5747452\",\n \"0.5747452\",\n \"0.5747394\",\n \"0.5742467\",\n \"0.57264394\",\n \"0.57261753\",\n \"0.57261753\",\n \"0.5724732\",\n \"0.5724732\",\n \"0.5724732\",\n \"0.5724732\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":37,"cells":{"query":{"kind":"string","value":"click a los numeros;"},"document":{"kind":"string","value":"function Nu(num){\r\ndocument.getElementById(\"result\").value=document.getElementById(\"result\").value+num;\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function buttonClicked(key) {\r\n numberButtons.forEach(number => {\r\n if(number.innerText === key) {\r\n number.click();\r\n }\r\n })\r\n}","handleNumClick(i, e) {\n let numEvent = new CustomEvent('numPress', { 'detail': { 'number': i } });\n let keypad = document.getElementById('keypad');\n keypad.dispatchEvent(numEvent);\n }","function numberClickListener(evt) {\n var button_id = this.id;\n digit_response.push(button_id.split(\"_\")[1]);\n click_history.push({\n \"button\": button_id.split(\"_\")[1],\n \"rt\": Math.round(performance.now() - trial_onset)\n });\n if (flag_debug) {\n console.log(button_id, ' was clicked. ', digit_response, click_history);\n }\n }","function clickedNum(num) {\n if (state.result !== undefined) {\n clear();\n }\n\n if (state.operation === undefined) {\n state.operandOne = state.operandOne === \"0\" ? num : (state.operandOne + num);\n panel.textContent = state.operandOne;\n } else {\n state.operandTwo += num;\n panel.textContent = state.operandTwo;\n }\n }","function numClick(number) {\n\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n currentNum = number;\n } else {\n currentNum += number;\n }\n document.getElementById(\"result-display\").value = currentNum;\n\n }","function handleNumberClick(i) {\n function handleClick() {\n if (i == 0){\n if (!clickNonZero) {\n currentNumber = '0';\n } else {\n currentNumber += '0';\n }\n added = false;\n } else {\n if (!clickNonZero){\n currentNumber = '' + i;\n clickNonZero = true; \n } else {\n currentNumber += i;\n clickNonZero = true; \n }\n added = false; \n }\n // update the text\n paragraph.textContent = pastInput + currentNumber; \n }\n return handleClick;\n}","function displayNumbers(nr) {\n nr.addEventListener(\"click\", function () {\n clicked.push(nr.value);\n screen.innerText += nr.value;\n })\n\n}","function click(value) {\n if (!Number.isNaN(parseInt(value))) {\n number(value);\n } else {\n operation(value);\n }\n refresh();\n}","function clickButtonEl(key) {\n numbersEl.forEach((button) => {\n if (button.innerText === key) {\n button.click();\n }\n });\n}","function numberClicked(eventData) {\n let buttonInformation = eventData;\n let numberClicked = buttonInformation.target.textContent;\n insertDisplay(numberClicked);\n}","function onNumberClick($event, getNum) {\n $event.preventDefault();\n userAttempt = parseInt(getNum);\n angular.element('.check-btns').css({'pointer-events': 'auto','cursor':'pointer'});\n return false;\n }","function chitClicked() {\n press(chitNumberOf(this));\n}","function clickMe (clicked) {\n let num = clicked.value;\n console.log(arr);\n displayNumber (num);\n}","function addNum() {\n // add number to display\n\n function numClick(number) {\n\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n currentNum = number;\n } else {\n currentNum += number;\n }\n document.getElementById(\"result-display\").value = currentNum;\n\n }\n\n\n// event.target.id to get the number values from the button click\n\n// stackoverflow.com/a/35936912/313756\n\n\n\n $(\"#1\").click(function(){\n numClick(\"1\");\n });\n // if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n // currentNum = \"1\";\n // } else {\n // currentNum += \"1\";\n // }\n // document.getElementById(\"result-display\").value = currentNum;\n // });\n\n $(\"#2\").click(function(){\n numClick(\"2\");\n });\n\n $(\"#3\").click(function(){\n numClick(\"3\");\n });\n\n $(\"#4\").click(function(){\n numClick(\"4\");\n });\n\n $(\"#5\").click(function(){\n numClick(\"5\");\n });\n\n $(\"#6\").click(function(){\n numClick(\"6\");\n });\n\n $(\"#7\").click(function(){\n numClick(\"7\");\n });\n\n $(\"#8\").click(function(){\n numClick(\"8\");\n });\n\n $(\"#9\").click(function(){\n numClick(\"9\");\n });\n\n $(\"#0\").click(function(){\n numClick(\"0\");\n });\n\n}","function numberClick(event) {\n\tif (!ansPressed)\n\t{\n var content = disp.textContent;\n var btnNum = event.target.textContent.trim();\n \n if(content != \"0\"){\n\t //limit the display area to 12 characters\n\t if(content.length < 12)\n content += btnNum;\n } else {\n content = btnNum;\n }\n \ndisp.textContent = content;\n\t}\n\t\n}","function handleClick(number) {\n console.log(`Button ${number} was clicked`);\n }","function fnNum(a){\r\n\t\tvar bClear = false;\r\n\t\toText.value = \"0\";\r\n\t\tfor(var i=0;i3) {\n ;\n } else {\n if (string.charAt(string.indexOf(\"(\") + 1) != string.charAt(string.indexOf(\")\") - 1)) {\n var substring1 = Number(string.charAt(string.indexOf(\"(\") + 1) + string.charAt(string.indexOf(\")\") - 1));\n } else {\n var substring1 = Number(string.charAt(string.indexOf(\"(\") + 1));\n }\n if (Number(val) < substring1) {\n string += val;\n checkLength(string);\n displayBox.innerHTML = string;\n } else {\n displayBox.innerHTML = \"Invalid\";\n $(\"button\").prop(\"disabled\", true);\n $(\".calu-func\").attr(\"disabled\", false);\n }\n }\n }","function operandClicked(key) {\r\n operatorButtons.forEach(operator => {\r\n if(operator.innerText === key) {\r\n operator.click();\r\n }\r\n })\r\n}","function numberClick() {\n lowerDisplayString += $(this).attr('id');\n displayString += $(this).attr('id');\n $('#display').text(displayString);\n $('#lower-display').text(lowerDisplayString);\n $(this).addClass('keyFrame');\n keyFrame = $(this);\n window.setTimeout(removeKeyframe, 250);\n}","function clickDigit(number) {\n if (active==\"input\") {\n\n if ((decimalPoints + digitPoints) > 9) {\n return;\n }\n\n if (decimalActive) {\n decimalPoints ++;\n\n if (input >= 0) {\n input += number*Math.pow(10,(-1)*(decimalPoints));\n }\n\n else {\n input -= number*Math.pow(10,(-1)*(decimalPoints));\n }\n }\n\n else {\n\n if (input == 0 && number ==0) {\n return\n }\n\n else {\n digitPoints ++;\n\n if (input >= 0) {\n input = (input*10)+number;\n }\n\n else {\n input = (input*10)-number;\n }\n\n }\n\n }\n\n setScreen(\"input\");\n\n }\n\n else if (active==\"calculation\") {\n input = number;\n digitPoints=1;\n\n setScreen(\"input\");\n }\n\n else {\n setScreen(\"ERROR\");\n }\n\n}","function buttonPress(clickId,displayId,number){\n const clickBtn= document.getElementById(clickId);\n clickBtn.addEventListener(\"click\", function(){\n document.getElementById(displayId).value+=\n number;\n})\n}","function handleNum(e) {\n\n // There are two ways into this function: either clicking on the number or pressing said num in the keyboard\n // This \n let numberPressed;\n (e instanceof Event) ? numberPressed = e.target.textContent : numberPressed = e;\n\n if (lastBtnPressed == 'operator' || mainDisplay.textContent == '0') {\n mainDisplay.textContent = numberPressed;\n } else {\n mainDisplay.textContent += numberPressed;\n\n // If the width of the display is higher than the preset value, ignore last number (as to prevent visual overflow)\n if(getComputedStyle(mainDisplay).width != '370px') {\n let auxArr = Array.from(mainDisplay.textContent);\n auxArr.pop();\n mainDisplay.textContent = auxArr.join('');\n }\n }\n\n lastBtnPressed = 'number';\n clearBtn.textContent = 'C';\n}","function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}","function clickPlusMinus() {\n if (dispError()) return;\n if (currentNumber===undefined) {\n if (storedNumber === undefined) return;\n currentNumber = -1 * storedNumber;\n digitAfterPeriod = String(currentNumber).split('.')[1] === undefined ? 0 : String(currentNumber).split('.')[1].length + 1;\n } else {\n currentNumber *= -1;\n }\n displayStoredContent('');\n displayCurrentNumber();\n}","function strum(){\n let button;\n for(let i = 6; i >= 1; i--){\n button = document.getElementById(i);\n button.click();\n }\n}","function panierIncrement0(){\n boutonPanier[0] = document.querySelector('#bouton-panier-0');\n boutonPanier[0].addEventListener('click', () =>{\n i++;\n nbrPanier.innerHTML = i;\n prixPanier0();\n }); \n}","handleClick(e, number) {\n console.log(\"clicke\" + e.target);\n this.counter += number;\n }","function putNumber(num){ // for buttons\n line.value = line.value + num.toString();\n}","function clickDigit(digit) {\n if (operator === null) {\n if (firstOperand.includes('.') && digit === '.') {\n // Do Nothing\n } else {\n setFirstOperand(`${firstOperand}${digit}`)\n setDisplay(`${firstOperand}${digit}`)\n }\n } else {\n if (secondOperand.includes('.') && digit === '.') {\n // Do Nothing\n } else {\n setSecondOperand(`${secondOperand}${digit}`)\n setDisplay(`${secondOperand}${digit}`)\n }\n }\n }","function reiniciar() {\n $(\"#num1\").text(\"\");\n $(\"#num2\").text(\"\");\n $(\"#num3\").text(\"\");\n $(\"#num4\").text(\"\");\n $(\"#num5\").text(\"\");\n $(\"#num6\").text(\"\");\n $(\"#num7\").text(\"\");\n $(\"#num8\").text(\"\");\n $(\"#num9\").text(\"\");\n $(\".celda\").click(jugada);\n numero=0;\n // cualquiera de los dos se puede \n //$(document).on(\"click\", \".celda\", jugada);\n}","function numberClicked(number) {\r\n status = document.getElementById(\"hidden_status\").value ;\r\n \r\n if (status == 'eq') {\r\n number_new = number;\r\n document.getElementById(\"hidden_text\").value ='';\r\n document.getElementById(\"hidden_status\").value ='ok';\r\n }\r\n else if (status == 'operator') {\r\n number_new = number;\r\n document.getElementById(\"hidden_status\").value ='ok';\r\n } \r\n else{\r\n number_prev = document.getElementById(\"display\").value;\r\n number_new = number_prev + number; \r\n }\r\n \r\n\r\n document.getElementById(\"display\").value = number_new;\r\n\r\n addText(number);\r\n\r\n // decimal point can be only once\r\n if (number == '.') {\r\n disableDecimalPoint(true);\r\n }\r\n\r\n}","function doeClick(){\n \n countClik ++;\n var number= this.getAttribute('data-role');\n totalCount += parseInt(number);\n uitvoeren();\n}","function ceClicked(){\n\t$display.val('');\n\tneedNewNum = true;\n\tnumEntered = false;\n}","function choiceClick(counter) {\n $('#picture .slick-next').trigger('click');\n $('.img-overlay').find('.click-overlay').parent().next().find('.overlay').addClass('click-overlay');\n $('#picture-array .slick-next').trigger('click');\n $('.image_number').html(counter + 1 + ' of 46');\n}","function input_digit(n) {\n if (equals_just_used) {\n AC();\n }\n equals_just_used = false;\n operator_click_num = 0;\n digit_click_num++;\n update_variables('digit', n);\n update_display();\n}","function buttonClickHandler(el) {\n removeLeadingZero(el)\n lastValue = el.value\n\n let basicOperator = evalBasicOperator(el)\n if (calculatePower(el)) {\n\n }\n else if (basicOperator != null) {\n display += basicOperator\n evaluationString += basicOperator\n if(basicOperator == \"-\" || basicOperator ==\"+\"){\n lastDigitClicked += basicOperator\n }\n } else if (!evalComplexOperator(el)) {\n if(!isNaN(el.value)){\n if(!isNaN(lastValue)){\n lastDigitClicked += el.value\n }else{\n lastDigitClicked = el.value\n }\n }\n display += el.value\n evaluationString += el.value\n }\n document.getElementById(\"output\").value = display\n}","function digitsListener(item, i){\n item.addEventListener('click', function(){\n if(digits[i].textContent==='.'){\n if(!sign && firstNumber.indexOf('.')>-1) return;\n if(sign && secondNumber.indexOf('.')>-1) return;\n }\n if((!firstNumber && digits[i].textContent==='.') ||\n (sign && !secondNumber && digits[i].textContent==='.')) {\n inputPanel.innerHTML+=\"0\";\n }\n inputPanel.innerHTML+=digits[i].textContent;\n if(sign===\"\"){\n firstNumber+=digits[i].textContent;\n }\n else {\n secondNumber+=digits[i].textContent;\n }\n })\n}","function prixamelioclick(){\n return Math.round(500 * (nbMultiplicateurAmelioAutoclick * 0.5));\n}","function keyboardListener(key) {\n switch (key) {\n case 13:\n $(\"#equals\").trigger(\"click\");\n break;\n case 42:\n $(\"#multiply\").trigger(\"click\");\n break;\n case 43:\n $(\"#add\").trigger(\"click\");\n break;\n case 45:\n $(\"#subtract\").trigger(\"click\");\n break;\n case 46:\n $(\"#decimal\").trigger(\"click\");\n break;\n case 47:\n $(\"#divide\").trigger(\"click\");\n break;\n case 48:\n $(\"#zero\").trigger(\"click\");\n break;\n case 49:\n $(\"#one\").trigger(\"click\");\n break;\n case 50:\n $(\"#two\").trigger(\"click\");\n break;\n case 51:\n $(\"#three\").trigger(\"click\");\n break;\n case 52:\n $(\"#four\").trigger(\"click\");\n break;\n case 53:\n $(\"#five\").trigger(\"click\");\n break;\n case 54:\n $(\"#six\").trigger(\"click\");\n break;\n case 55:\n $(\"#seven\").trigger(\"click\");\n break;\n case 56:\n $(\"#eight\").trigger(\"click\");\n break;\n case 57:\n $(\"#nine\").trigger(\"click\");\n break;\n }\n}","function clickCube(){\r\n\tlet cube = parseInt(document.querySelector(\"#cube\").value);\r\n\tconsole.log(cube * cube * cube);\r\n}","function clickedOn() {\n if (this.id === 'C' || this.id === '/' || this.id === 'X' || this.id === '-' || this.id === '+' || this.id === '=' || this.id === '.') {\n symPress(this.id);\n } else {\n numPress(this.id);\n }\n // If NaN (for example, from 0/0) clears the calc and displays a message)\n if (displayWindow.innerHTML === 'NaN') {\n clear();\n displayWindow.innerHTML = '-Undefined-';\n }\n // Debugging Logs:\n console.log(`Equation: ${num1} ${operand} ${num2}`);\n console.log(`Equal temp num: ${equalTemp}; eqPress: ${eqPress}`)\n console.log('---------------');\n}","function inputNum(evt){\n //have one event on the parent that listens to all the children. The if statement stops the even firing if the parent element is clicked. \n num += evt.target.id;\n screen.value = num;\n}","function ClickCounter() {}","function getNumber(e) {\n 'use strict';\n\n // if the actions array has a number\n // and no operator then reset the array\n if (actions.length === 1) {\n num = '';\n results = [];\n actions = [];\n }\n\n keyPress = e.currentTarget.id;\n // console.log(keyPress);\n\n // make sure only one decimal\n if (keyPress === 'dot' || keyPress === '.') {\n // console.log(result.indexOf('.'));\n if (results.indexOf('.') === -1) {\n keyPress = '.';\n results.push(keyPress);\n }\n } else {\n results.push(keyPress);\n }\n // console.log(results);\n\n // make the number from the array\n num = results.join('');\n // strip off leading zero's\n // console.log(/^0+[1-9]+/.test(num));\n if (/^0+[1-9]+/.test(num)) {\n // console.log(\"zeros with a number\");\n num = num.replace(/^0+/, '');\n } else if (/^0+\\./.test(num)) {\n // console.log(\"zeros with a dot\");\n num = num.replace(/^0+\\./, '0.');\n } else if (/^0+/.test(num)) {\n // zero\n // console.log(\"all zeros\");\n num = 0;\n }\n // console.log('results: ' + num);\n if (isNaN(num) === false) {\n showNum(num);\n return;\n } else {\n return;\n }\n }","function getNumbers() {\n let numbers = document.getElementsByClassName('number');\n for(i=0; i {\n let eventData = event;\n numberClicked(eventData);\n });\n }\n \n}","function celulaClick() {\n let loc = this.id.split(\"_\");\n let row = Number(loc[0]);\n let col = Number(loc[1]);\n\n if (this.className==='vivo'){\n this.setAttribute('class', 'muerto');\n aGen[row][col] = 0;\n \n }else{\n this.setAttribute('class', 'vivo');\n aGen[row][col]=1;\n }\n}","click() { }","function operator(x) {\n decimal_clicked = false;\n equals_just_used = false;\n digit_click_num = 0;\n if (x != \"%\") {\n operator_click_num++;\n }\n update_variables('operator', x);\n update_display();\n}","function clickNumber(event) {\r\n console.log(event.target.value);\r\n \r\n if(operation.innerHTML == \"\")\r\n\tfirstNumber.innerHTML += event.target.value;\r\n else if(operation.innerHTML != \"\")\r\n\tsecondNumber.innerHTML += event.target.value;\r\n}","function dondeClick(event) {\n if (event.target.className == \"asiento\") {\n event.target.classList.add(\"seleccionado\");\n document.getElementById(\"numero\").innerHTML++;\n calcularPrecio();\n almacenar();\n } else if (event.target.className == \"asiento seleccionado\") {\n event.target.classList.remove(\"seleccionado\");\n document.getElementById(\"numero\").innerHTML--;\n calcularPrecio();\n almacenar();\n }\n}","function dailNumberFunc(e){ \n let clickBtn=e.target.textContent; \n showHideDisplays('none','none','block')\n let dailNumber=['1','2','3','4','5','6','7','8','9','0','*','#']; \n let addingNumber=dailNumber.find(elem=>{\n return clickBtn===elem?elem:null; })\n if(addingNumber===undefined){\n return; \n } else{ \n if(textArea.textContent.length>=7){\n textArea.style.fontSize='1.5em'; \n }\n if(textArea.textContent.length>=20){\n textArea.style.fontSize='1em';\n }\n if(textArea.textContent.length>=30){\n return\n }\n textArea.textContent += addingNumber; \n } }","function ClickEvent(maso){\n var string_So_Luong=\"\";\n //lay string text box\n string_So_Luong=document.getElementById(maso.ToString()).value;\n //parse to int\n So_Luong = parseInt(string_So_Luong);\n \n\n }","function digitPressed(digit) {\n button = document.querySelector(`.number${digit}`);\n button.classList.add(\"clicked\");\n if (display.classList.contains(\"clear\")) {\n display.textContent = \"\"; // clear display\n display.classList.remove(\"clear\");\n }\n if(display.textContent.length > 10){\n return;\n }\n display.textContent += digit;\n}","function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}","function printDigit(e) {\n let obj=e.target;\n\n if (result.value==='0') {\n result.value=obj.textContent;\n } else {\n result.value +=obj.textContent;\n }\n}","function digit_input_one (value) {\n //conditional to allow number click\n if (buttonClick === null) {\n //get number value from html element\n var numberRetriever = $(value).children('h3').html();\n //differentiate between a decimal. If decimal has been clicked during forst operand then no other decimals will be allowed\n if(numberRetriever === '.' && decimalClick === null) {\n number = numberRetriever;\n //sets decimal conditional to be false\n decimalClick = false;\n }\n //conditional to allow all html elements besides decimals top be logged\n else if (numberRetriever != '.') {\n number = numberRetriever;\n }\n console.log('Subsequent Number is: ' + number);\n //Once the first number has been enetered the operators may be clicked\n operatorClick = true;\n }\n //empty operand value set to add on the the number value for every click\n operand += number;\n //reset the number value\n number = '';\n //show the operand value on the screen\n $('.output').html(operand);\n console.log(operand);\n //allow operator buttons to be clicked\n equateClick = true;\n}","function onClick () {\n\n // erhöhe den Wert der Variable 'clicks' um 1\n clicks++;\n\n var text = '';\n\n if (clicks === 1) {\n // beim ersten Klick\n text = 'Hallo!';\n } else if (clicks < 4) {\n // beim zweiten und dritten Klick\n text = 'Hmmm';\n } else {\n // bei allen folgenden Klicks\n text = 'Autsch!';\n }\n\n // setze den Inhalt des Elements mit der ID 'reaktion' auf den zuvor bestimmten Text\n reaktion.textContent = text;\n }","function toOctClicked(){colorTo(3); toOct = true, toDec = false; toBin = false, toHex = false;}","function numberClicked(event) {\n\n if (para.textContent.includes(\"=\")) {\n // do nothing\n } else if ((event.target.innerHTML == \".\") && (para.textContent.endsWith(\".\"))) {\n // do nothing\n } else {\n para.textContent += event.target.innerHTML;\n }\n}","function touches9() {\n\tif (num[9]==true){\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"9\";\n\t} else {\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"\";\n\t}\n}","function clicked(d,i) {\n\n}","function clicked(d,i) {\n\n}","function setupNumberButtons() {\n let buttons = document.querySelectorAll(\".button-operator, .button-number\");\n for (var i = 0; i < buttons.length; i++) {\n buttons[i].addEventListener('click', addToScreen, false);\n }\n}","function updateClickerDisplay(num) {\n clickerCounterDisplay.innerText = num;\n}","clickNumber(event) {\n\n // 'number' is set to the number clicked\n let NUMBER = event.target.innerText\n\n /* \n If the number 0 is clicked, we don't want 0 to simply be concating onto the existing operand\n lest we create a situation where we have '003080', so we separate zero and check whether it\n should be appended\n */\n\n if(NUMBER==ZERO) {\n this.handleZero()\n }\n\n /*\n If the value of the operand is default '0' then 'number' is not concated to it, but replaces\n the default value. This prevents readouts like '03' (if 3 is clicked.) Instead it will become '3'\n */\n else {\n if(this.state.operand==ZERO) {\n this.setState({operand: NUMBER});\n this.updateLowerDisplay(NUMBER);\n }\n else if(this.state.operand!=ZERO) {\n this.handleConcat(NUMBER);\n }\n }\n }","function onClickUno() {\n if (operandoType != 1) { opHiddenIndex++; }\n operandoType = 1;\n strDisplay += \"1\";\n\n insertOpHidden(\"1\");\n refreshDisplay();\n}","function listenForClick(number) {\n if (TEST_LIGHTS === game[TEST_MODE]) {\n setTimeout(function () {\n nextRound()\n }, 1000);\n }\n}","function autoclickprix(){\n return Math.round(200 * (nbMultiplicateurAmelioAutoclick * 0.40));\n}","function o(a){a.click(p).mousedown(ka)}","function crystalClick () {\n counter += parseInt($(this).attr(\"value\"));\n\t\t$(\".score-number\").html(counter);\n\t\tif (counter == targetNumber) {\n\t\t\twins++;\n\t\t\ttotalReset();\n\t\t}\n\t\telse if (counter > targetNumber) {\n\t\t\tlosses++;\n\t\t\ttotalReset();\n };\n console.log(\"clicks are working\")\n }","numBoxClicked(numBoxRow, numBoxCol, numBoxVal) {\n \tif (this.model.crossOutNum(numBoxRow, numBoxCol, numBoxVal) === true) {\n \t\tthis.view.strikeNum(numBoxRow, numBoxCol);\n \t\t\n \t\tif (this.model.crossOutLockBox(numBoxRow, numBoxCol) === true) {\n \t\t\tthis.view.strikeLockBox(numBoxRow);\n \t\t\tthis.view.disappearDie(numBoxRow);\n \t\t}\n \t\t\n \t\tthis.view.changeButtons(this.model.gamePhase);\n \t\tthis.gameOverCheck();\n \t}\n }","function btn1click(){\n //calling function with btn number\n if(start ==true){ selectImg(\"1\");}\n}","function runEventListener (i){\n clickSound.play()\n let currentButtonText = buttons[i].innerHTML\n if ((!isNaN(currentButtonText) || currentButtonText === '.') && temporaryValue.length < 10){\n clickNumberButton(currentButtonText)\n }\n else if (currentButtonText === 'AC'){\n clickAcButton ()\n }\n else if (currentButtonText === 'CE'){\n clickCeButton ()\n }\n else if (currentButtonText === '='){\n clickEqualButton ()\n }\n else if (isNaN(currentButtonText)){\n clickSymbolButton (currentButtonText)\n }\n}","function clickListener(num) {\n\treturn function() {\n\t\tself.port.emit(\"clicked-link\", num);\n\t};\n}","function printDigit(e) {\n let obj = e.target;\n \n if (result.value === '0') {\n result.value = obj.textContent;\n } else {\n result.value += obj.textContent;\n }\n}","function numero1(num){\n \n if(document.getElementById(\"Ctexto\").value==\"\" && op==false ){\n\t\tdocument.getElementById(\"Ctexto\").value=num;\n\t\top=true;\n\t\tcont++;\n\t\tdocument.getElementById(\"dados1\").style.visibility =\"hidden\";\n\t\t\n\t}else if(op==false){\n\t\t//$('#dados1,#dados2,#dados3,#dados4,#dados5').click(function (){$(this).hide()});\n\t\tdocument.getElementById(\"Ctexto\").value+=num;\n\t\top=true;\n\t\tcont++;\n\t\tdocument.getElementById(\"dados1\").style.visibility =\"hidden\";\n\t}\n\n}","function clickPageNumber(pagenumber){\n pageNumber = pagenumber;\n //chang display amount label and write page to next page\n changeDisplayAmount(displayType,pagenumber);\n}","function clickOperator(event) {\r\n console.log(event.target.value);\r\n \r\n if(secondNumber.innerHTML != \"\" || firstNumber.innerHTML == \"\")\r\n\treturn;\r\n operation.innerHTML = event.target.value;\r\n}","function touches1() {\n\tif (num[1]==true){\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"1\";\n\t} else {\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"\";\t\t\n\t}\n}","function operClicked(){\n\tif((chain === false)){\n\t\tfirstMemory = Number($display.val());\n\t} else if(numEntered){\n\t\tif(operator === \"+\"){\n\t\t\tfirstMemory = add(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"-\"){\n\t\t\tfirstMemory = substract(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"×\"){\n\t\t\tfirstMemory = multiply(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"÷\"){\n\t\t\tfirstMemory = divide(firstMemory, Number($display.val()));\t\n\t\t}\n\t} \n\n\toperator = $(this).text();\n\tconsole.log(operator);\n\tchain = true;\n\tneedNewNum = true;\n\tisThereDot = false;\n\tnumEntered = false;\n}","function operatorPressed(operator) {\n // if remaining minus, do nothing\n if (display.textContent === '-'){\n return;\n }\n const button = document.querySelector(`.${getOperatorName(operator)}`);\n button.classList.add(\"clicked\");\n display.dataset.numbers += \",\"+display.textContent; // save number\n display.dataset.operators += \",\"+operator; // save operator\n display.classList.add(\"clear\");\n}","function printNumber() {\n\n //Attribution du symbol du bouton cliqué (chiffre) à la variable nb\n let nb = this.getAttribute(\"data-symbol\");\n\n //Affiche le chiffre cliqué dans l'écran (screen)\n screen.textContent += nb;\n\n //On enlève tous les espaces du string (screen) et on met cela dans la variable screenContent\n let screenContent = screen.textContent.replace(/\\s/g, \"\");\n \n //On affiche le résultat de l'équation dans screenResult avec un arrondit à 2 chiffres après la virgule\n screenResult.textContent = `= ${Math.round(eval(screenContent)*100)/100}`;\n\n //On enlève la classe \"result\" au screenResult\n screenResult.classList.remove(\"result\");\n}","function buttonClick(value) {\n if (isNaN(parseInt(value))) {\n handleSymbol(value);\n } else {\n handleNumber(value);\n }\n rerender();\n}","function buttonClicked(value) {\n\tif (isNaN(parseInt(value))) {\n\t\thandleOperators(value);\n\t\tclear(value);\n\t} else {\n\t\tnumberManage(value);\n\t}\n\trerender();\n}","function acClicked(){\n\tfirstMemory = 0;\n\tsecondMemory = 0;\n\tshowOnDisplay('');\n\tneedNewNum = true;\n\tchain = false;\n\tnumEntered = false;\n}","function handler(){\n switchCounter++;\n if(switchCounter%2===1 && $values.innerText.length<8){\n $values.style.display=\"block\";\n for(j=0;j<=10;j++){\n $number[j].addEventListener(\"click\",numberSelect);\n }\n for(m=0;m<=3;m++){\n $operator[m].addEventListener(\"click\",operation);\n }\n $equals.addEventListener(\"click\",showAnswer);\n $mPositive.addEventListener(\"click\",storeToMemory);\n $mNegative.addEventListener(\"click\",removeFromMemory);\n $mrc.addEventListener(\"click\",storedMemory);\n }\n else{\n $values.style.display=\"none\";\n $values.innerText=0;\n numberIsClicked=false;\n operatorIsClicked=false;\n numberOfOperand=0;\n equalsToIsClicked=false;\n myoperator=\"\";\n }\n}","function addClicks (int1) {\n rockTotal += int1;\n }","clicked(x, y) {}","function change_by_one(value, direction){\n\n var number = value.replace(/[^-\\d\\.]/g, '');\n var unit = value.replace(number, '').trim();\n\n if(number == \"\") number = \"0\";\n if(unit == \"\") unit = \"px\"; \n\n var newvalue = \"\";\n\n if(direction == \"plus\")\n newvalue = Number(number) + 1; \n else newvalue = Number(number) - 1; \n\n console.log(newvalue + \"\" +unit);\n return newvalue+unit; \n\n alert(\"new value after click \"+ newvalue+unit);\n }","function getNum(n){\n let screen = document.getElementById(\"screen\");\n screen.value += n;\n}","function getNumber(count){\n\n\t var num = document.getElementById(\"btn\");\n alert(num.innerHTML);\n alert (count);\n}","function _click(d){\n \n }","function fromOctClicked(){colorFrom(3); fromOct = true, fromBin =false, fromDec = false, fromHex = false;}","function buttons(idbutton) {\n var value = idbutton.val();\n $(idbutton).click(() => {\n console.log(\"Puntos: \" + contpoint);\n if(entry == null) {\n entry.val(value);\n } else if(entry.val().length >= 12) {\n console.log(\"Esta full\");\n } else if(value == \".\" && contpoint == 0) {\n contpoint++;\n entry.val(entry.val() + value);\n } else if(value == \".\" && contpoint > 0) {\n console.log(\"Hay mas de un punto\");\n }\n else {\n entry.val(entry.val() + value);\n }\n $(idbutton).addClass(\"animated pulse\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', () => {\n $(idbutton).removeClass(\"animated pulse\");\n });\n });\n}","function addClick(ind){\n var elem = shapes[ind];\n elem.addEventListener(\"click\", function(){\n clicked += 1;\n checkOrder(ind);\n\n });\n }","function SomaClickState() {\n setState(stateValue = stateValue + 1); // Mesma coisa que isso state[1](stateValue);\n // Por setState ser uma funcao ele temq ue ser escrito seu nome e parenteses\n }","function handleNumber(number) {\n if (resultDisplay.innerText == '0' || operatorPressed) {\n changeDisplay('');\n operatorPressed = false;\n }\n resultDisplay.innerText += number;\n}","function clickToSum() {\n\tvar sum = 0;\n\tvar nums = document.getElementsByClassName(\"number\");\n\tvar bigButton = document.getElementsByClassName(\"info\")[0];\n\n\tfor (var i = 0; i < nums.length; i++) {\n\t\tsum += parseInt(nums[i].innerHTML);\n\t}\n\n\tbigButton.getElementsByTagName(\"h2\")[0].appendChild(document.createTextNode(sum));\n}"],"string":"[\n \"function buttonClicked(key) {\\r\\n numberButtons.forEach(number => {\\r\\n if(number.innerText === key) {\\r\\n number.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"handleNumClick(i, e) {\\n let numEvent = new CustomEvent('numPress', { 'detail': { 'number': i } });\\n let keypad = document.getElementById('keypad');\\n keypad.dispatchEvent(numEvent);\\n }\",\n \"function numberClickListener(evt) {\\n var button_id = this.id;\\n digit_response.push(button_id.split(\\\"_\\\")[1]);\\n click_history.push({\\n \\\"button\\\": button_id.split(\\\"_\\\")[1],\\n \\\"rt\\\": Math.round(performance.now() - trial_onset)\\n });\\n if (flag_debug) {\\n console.log(button_id, ' was clicked. ', digit_response, click_history);\\n }\\n }\",\n \"function clickedNum(num) {\\n if (state.result !== undefined) {\\n clear();\\n }\\n\\n if (state.operation === undefined) {\\n state.operandOne = state.operandOne === \\\"0\\\" ? num : (state.operandOne + num);\\n panel.textContent = state.operandOne;\\n } else {\\n state.operandTwo += num;\\n panel.textContent = state.operandTwo;\\n }\\n }\",\n \"function numClick(number) {\\n\\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\\\".\\\" == -1))) {\\n currentNum = number;\\n } else {\\n currentNum += number;\\n }\\n document.getElementById(\\\"result-display\\\").value = currentNum;\\n\\n }\",\n \"function handleNumberClick(i) {\\n function handleClick() {\\n if (i == 0){\\n if (!clickNonZero) {\\n currentNumber = '0';\\n } else {\\n currentNumber += '0';\\n }\\n added = false;\\n } else {\\n if (!clickNonZero){\\n currentNumber = '' + i;\\n clickNonZero = true; \\n } else {\\n currentNumber += i;\\n clickNonZero = true; \\n }\\n added = false; \\n }\\n // update the text\\n paragraph.textContent = pastInput + currentNumber; \\n }\\n return handleClick;\\n}\",\n \"function displayNumbers(nr) {\\n nr.addEventListener(\\\"click\\\", function () {\\n clicked.push(nr.value);\\n screen.innerText += nr.value;\\n })\\n\\n}\",\n \"function click(value) {\\n if (!Number.isNaN(parseInt(value))) {\\n number(value);\\n } else {\\n operation(value);\\n }\\n refresh();\\n}\",\n \"function clickButtonEl(key) {\\n numbersEl.forEach((button) => {\\n if (button.innerText === key) {\\n button.click();\\n }\\n });\\n}\",\n \"function numberClicked(eventData) {\\n let buttonInformation = eventData;\\n let numberClicked = buttonInformation.target.textContent;\\n insertDisplay(numberClicked);\\n}\",\n \"function onNumberClick($event, getNum) {\\n $event.preventDefault();\\n userAttempt = parseInt(getNum);\\n angular.element('.check-btns').css({'pointer-events': 'auto','cursor':'pointer'});\\n return false;\\n }\",\n \"function chitClicked() {\\n press(chitNumberOf(this));\\n}\",\n \"function clickMe (clicked) {\\n let num = clicked.value;\\n console.log(arr);\\n displayNumber (num);\\n}\",\n \"function addNum() {\\n // add number to display\\n\\n function numClick(number) {\\n\\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\\\".\\\" == -1))) {\\n currentNum = number;\\n } else {\\n currentNum += number;\\n }\\n document.getElementById(\\\"result-display\\\").value = currentNum;\\n\\n }\\n\\n\\n// event.target.id to get the number values from the button click\\n\\n// stackoverflow.com/a/35936912/313756\\n\\n\\n\\n $(\\\"#1\\\").click(function(){\\n numClick(\\\"1\\\");\\n });\\n // if ((eval(currentNum) == 0) && (currentNum.indexOf(\\\".\\\" == -1))) {\\n // currentNum = \\\"1\\\";\\n // } else {\\n // currentNum += \\\"1\\\";\\n // }\\n // document.getElementById(\\\"result-display\\\").value = currentNum;\\n // });\\n\\n $(\\\"#2\\\").click(function(){\\n numClick(\\\"2\\\");\\n });\\n\\n $(\\\"#3\\\").click(function(){\\n numClick(\\\"3\\\");\\n });\\n\\n $(\\\"#4\\\").click(function(){\\n numClick(\\\"4\\\");\\n });\\n\\n $(\\\"#5\\\").click(function(){\\n numClick(\\\"5\\\");\\n });\\n\\n $(\\\"#6\\\").click(function(){\\n numClick(\\\"6\\\");\\n });\\n\\n $(\\\"#7\\\").click(function(){\\n numClick(\\\"7\\\");\\n });\\n\\n $(\\\"#8\\\").click(function(){\\n numClick(\\\"8\\\");\\n });\\n\\n $(\\\"#9\\\").click(function(){\\n numClick(\\\"9\\\");\\n });\\n\\n $(\\\"#0\\\").click(function(){\\n numClick(\\\"0\\\");\\n });\\n\\n}\",\n \"function numberClick(event) {\\n\\tif (!ansPressed)\\n\\t{\\n var content = disp.textContent;\\n var btnNum = event.target.textContent.trim();\\n \\n if(content != \\\"0\\\"){\\n\\t //limit the display area to 12 characters\\n\\t if(content.length < 12)\\n content += btnNum;\\n } else {\\n content = btnNum;\\n }\\n \\ndisp.textContent = content;\\n\\t}\\n\\t\\n}\",\n \"function handleClick(number) {\\n console.log(`Button ${number} was clicked`);\\n }\",\n \"function fnNum(a){\\r\\n\\t\\tvar bClear = false;\\r\\n\\t\\toText.value = \\\"0\\\";\\r\\n\\t\\tfor(var i=0;i3) {\\n ;\\n } else {\\n if (string.charAt(string.indexOf(\\\"(\\\") + 1) != string.charAt(string.indexOf(\\\")\\\") - 1)) {\\n var substring1 = Number(string.charAt(string.indexOf(\\\"(\\\") + 1) + string.charAt(string.indexOf(\\\")\\\") - 1));\\n } else {\\n var substring1 = Number(string.charAt(string.indexOf(\\\"(\\\") + 1));\\n }\\n if (Number(val) < substring1) {\\n string += val;\\n checkLength(string);\\n displayBox.innerHTML = string;\\n } else {\\n displayBox.innerHTML = \\\"Invalid\\\";\\n $(\\\"button\\\").prop(\\\"disabled\\\", true);\\n $(\\\".calu-func\\\").attr(\\\"disabled\\\", false);\\n }\\n }\\n }\",\n \"function operandClicked(key) {\\r\\n operatorButtons.forEach(operator => {\\r\\n if(operator.innerText === key) {\\r\\n operator.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"function numberClick() {\\n lowerDisplayString += $(this).attr('id');\\n displayString += $(this).attr('id');\\n $('#display').text(displayString);\\n $('#lower-display').text(lowerDisplayString);\\n $(this).addClass('keyFrame');\\n keyFrame = $(this);\\n window.setTimeout(removeKeyframe, 250);\\n}\",\n \"function clickDigit(number) {\\n if (active==\\\"input\\\") {\\n\\n if ((decimalPoints + digitPoints) > 9) {\\n return;\\n }\\n\\n if (decimalActive) {\\n decimalPoints ++;\\n\\n if (input >= 0) {\\n input += number*Math.pow(10,(-1)*(decimalPoints));\\n }\\n\\n else {\\n input -= number*Math.pow(10,(-1)*(decimalPoints));\\n }\\n }\\n\\n else {\\n\\n if (input == 0 && number ==0) {\\n return\\n }\\n\\n else {\\n digitPoints ++;\\n\\n if (input >= 0) {\\n input = (input*10)+number;\\n }\\n\\n else {\\n input = (input*10)-number;\\n }\\n\\n }\\n\\n }\\n\\n setScreen(\\\"input\\\");\\n\\n }\\n\\n else if (active==\\\"calculation\\\") {\\n input = number;\\n digitPoints=1;\\n\\n setScreen(\\\"input\\\");\\n }\\n\\n else {\\n setScreen(\\\"ERROR\\\");\\n }\\n\\n}\",\n \"function buttonPress(clickId,displayId,number){\\n const clickBtn= document.getElementById(clickId);\\n clickBtn.addEventListener(\\\"click\\\", function(){\\n document.getElementById(displayId).value+=\\n number;\\n})\\n}\",\n \"function handleNum(e) {\\n\\n // There are two ways into this function: either clicking on the number or pressing said num in the keyboard\\n // This \\n let numberPressed;\\n (e instanceof Event) ? numberPressed = e.target.textContent : numberPressed = e;\\n\\n if (lastBtnPressed == 'operator' || mainDisplay.textContent == '0') {\\n mainDisplay.textContent = numberPressed;\\n } else {\\n mainDisplay.textContent += numberPressed;\\n\\n // If the width of the display is higher than the preset value, ignore last number (as to prevent visual overflow)\\n if(getComputedStyle(mainDisplay).width != '370px') {\\n let auxArr = Array.from(mainDisplay.textContent);\\n auxArr.pop();\\n mainDisplay.textContent = auxArr.join('');\\n }\\n }\\n\\n lastBtnPressed = 'number';\\n clearBtn.textContent = 'C';\\n}\",\n \"function amelioration(){\\n return nbMultiplicateurAmelioAutoclick +9;\\n}\",\n \"function clickPlusMinus() {\\n if (dispError()) return;\\n if (currentNumber===undefined) {\\n if (storedNumber === undefined) return;\\n currentNumber = -1 * storedNumber;\\n digitAfterPeriod = String(currentNumber).split('.')[1] === undefined ? 0 : String(currentNumber).split('.')[1].length + 1;\\n } else {\\n currentNumber *= -1;\\n }\\n displayStoredContent('');\\n displayCurrentNumber();\\n}\",\n \"function strum(){\\n let button;\\n for(let i = 6; i >= 1; i--){\\n button = document.getElementById(i);\\n button.click();\\n }\\n}\",\n \"function panierIncrement0(){\\n boutonPanier[0] = document.querySelector('#bouton-panier-0');\\n boutonPanier[0].addEventListener('click', () =>{\\n i++;\\n nbrPanier.innerHTML = i;\\n prixPanier0();\\n }); \\n}\",\n \"handleClick(e, number) {\\n console.log(\\\"clicke\\\" + e.target);\\n this.counter += number;\\n }\",\n \"function putNumber(num){ // for buttons\\n line.value = line.value + num.toString();\\n}\",\n \"function clickDigit(digit) {\\n if (operator === null) {\\n if (firstOperand.includes('.') && digit === '.') {\\n // Do Nothing\\n } else {\\n setFirstOperand(`${firstOperand}${digit}`)\\n setDisplay(`${firstOperand}${digit}`)\\n }\\n } else {\\n if (secondOperand.includes('.') && digit === '.') {\\n // Do Nothing\\n } else {\\n setSecondOperand(`${secondOperand}${digit}`)\\n setDisplay(`${secondOperand}${digit}`)\\n }\\n }\\n }\",\n \"function reiniciar() {\\n $(\\\"#num1\\\").text(\\\"\\\");\\n $(\\\"#num2\\\").text(\\\"\\\");\\n $(\\\"#num3\\\").text(\\\"\\\");\\n $(\\\"#num4\\\").text(\\\"\\\");\\n $(\\\"#num5\\\").text(\\\"\\\");\\n $(\\\"#num6\\\").text(\\\"\\\");\\n $(\\\"#num7\\\").text(\\\"\\\");\\n $(\\\"#num8\\\").text(\\\"\\\");\\n $(\\\"#num9\\\").text(\\\"\\\");\\n $(\\\".celda\\\").click(jugada);\\n numero=0;\\n // cualquiera de los dos se puede \\n //$(document).on(\\\"click\\\", \\\".celda\\\", jugada);\\n}\",\n \"function numberClicked(number) {\\r\\n status = document.getElementById(\\\"hidden_status\\\").value ;\\r\\n \\r\\n if (status == 'eq') {\\r\\n number_new = number;\\r\\n document.getElementById(\\\"hidden_text\\\").value ='';\\r\\n document.getElementById(\\\"hidden_status\\\").value ='ok';\\r\\n }\\r\\n else if (status == 'operator') {\\r\\n number_new = number;\\r\\n document.getElementById(\\\"hidden_status\\\").value ='ok';\\r\\n } \\r\\n else{\\r\\n number_prev = document.getElementById(\\\"display\\\").value;\\r\\n number_new = number_prev + number; \\r\\n }\\r\\n \\r\\n\\r\\n document.getElementById(\\\"display\\\").value = number_new;\\r\\n\\r\\n addText(number);\\r\\n\\r\\n // decimal point can be only once\\r\\n if (number == '.') {\\r\\n disableDecimalPoint(true);\\r\\n }\\r\\n\\r\\n}\",\n \"function doeClick(){\\n \\n countClik ++;\\n var number= this.getAttribute('data-role');\\n totalCount += parseInt(number);\\n uitvoeren();\\n}\",\n \"function ceClicked(){\\n\\t$display.val('');\\n\\tneedNewNum = true;\\n\\tnumEntered = false;\\n}\",\n \"function choiceClick(counter) {\\n $('#picture .slick-next').trigger('click');\\n $('.img-overlay').find('.click-overlay').parent().next().find('.overlay').addClass('click-overlay');\\n $('#picture-array .slick-next').trigger('click');\\n $('.image_number').html(counter + 1 + ' of 46');\\n}\",\n \"function input_digit(n) {\\n if (equals_just_used) {\\n AC();\\n }\\n equals_just_used = false;\\n operator_click_num = 0;\\n digit_click_num++;\\n update_variables('digit', n);\\n update_display();\\n}\",\n \"function buttonClickHandler(el) {\\n removeLeadingZero(el)\\n lastValue = el.value\\n\\n let basicOperator = evalBasicOperator(el)\\n if (calculatePower(el)) {\\n\\n }\\n else if (basicOperator != null) {\\n display += basicOperator\\n evaluationString += basicOperator\\n if(basicOperator == \\\"-\\\" || basicOperator ==\\\"+\\\"){\\n lastDigitClicked += basicOperator\\n }\\n } else if (!evalComplexOperator(el)) {\\n if(!isNaN(el.value)){\\n if(!isNaN(lastValue)){\\n lastDigitClicked += el.value\\n }else{\\n lastDigitClicked = el.value\\n }\\n }\\n display += el.value\\n evaluationString += el.value\\n }\\n document.getElementById(\\\"output\\\").value = display\\n}\",\n \"function digitsListener(item, i){\\n item.addEventListener('click', function(){\\n if(digits[i].textContent==='.'){\\n if(!sign && firstNumber.indexOf('.')>-1) return;\\n if(sign && secondNumber.indexOf('.')>-1) return;\\n }\\n if((!firstNumber && digits[i].textContent==='.') ||\\n (sign && !secondNumber && digits[i].textContent==='.')) {\\n inputPanel.innerHTML+=\\\"0\\\";\\n }\\n inputPanel.innerHTML+=digits[i].textContent;\\n if(sign===\\\"\\\"){\\n firstNumber+=digits[i].textContent;\\n }\\n else {\\n secondNumber+=digits[i].textContent;\\n }\\n })\\n}\",\n \"function prixamelioclick(){\\n return Math.round(500 * (nbMultiplicateurAmelioAutoclick * 0.5));\\n}\",\n \"function keyboardListener(key) {\\n switch (key) {\\n case 13:\\n $(\\\"#equals\\\").trigger(\\\"click\\\");\\n break;\\n case 42:\\n $(\\\"#multiply\\\").trigger(\\\"click\\\");\\n break;\\n case 43:\\n $(\\\"#add\\\").trigger(\\\"click\\\");\\n break;\\n case 45:\\n $(\\\"#subtract\\\").trigger(\\\"click\\\");\\n break;\\n case 46:\\n $(\\\"#decimal\\\").trigger(\\\"click\\\");\\n break;\\n case 47:\\n $(\\\"#divide\\\").trigger(\\\"click\\\");\\n break;\\n case 48:\\n $(\\\"#zero\\\").trigger(\\\"click\\\");\\n break;\\n case 49:\\n $(\\\"#one\\\").trigger(\\\"click\\\");\\n break;\\n case 50:\\n $(\\\"#two\\\").trigger(\\\"click\\\");\\n break;\\n case 51:\\n $(\\\"#three\\\").trigger(\\\"click\\\");\\n break;\\n case 52:\\n $(\\\"#four\\\").trigger(\\\"click\\\");\\n break;\\n case 53:\\n $(\\\"#five\\\").trigger(\\\"click\\\");\\n break;\\n case 54:\\n $(\\\"#six\\\").trigger(\\\"click\\\");\\n break;\\n case 55:\\n $(\\\"#seven\\\").trigger(\\\"click\\\");\\n break;\\n case 56:\\n $(\\\"#eight\\\").trigger(\\\"click\\\");\\n break;\\n case 57:\\n $(\\\"#nine\\\").trigger(\\\"click\\\");\\n break;\\n }\\n}\",\n \"function clickCube(){\\r\\n\\tlet cube = parseInt(document.querySelector(\\\"#cube\\\").value);\\r\\n\\tconsole.log(cube * cube * cube);\\r\\n}\",\n \"function clickedOn() {\\n if (this.id === 'C' || this.id === '/' || this.id === 'X' || this.id === '-' || this.id === '+' || this.id === '=' || this.id === '.') {\\n symPress(this.id);\\n } else {\\n numPress(this.id);\\n }\\n // If NaN (for example, from 0/0) clears the calc and displays a message)\\n if (displayWindow.innerHTML === 'NaN') {\\n clear();\\n displayWindow.innerHTML = '-Undefined-';\\n }\\n // Debugging Logs:\\n console.log(`Equation: ${num1} ${operand} ${num2}`);\\n console.log(`Equal temp num: ${equalTemp}; eqPress: ${eqPress}`)\\n console.log('---------------');\\n}\",\n \"function inputNum(evt){\\n //have one event on the parent that listens to all the children. The if statement stops the even firing if the parent element is clicked. \\n num += evt.target.id;\\n screen.value = num;\\n}\",\n \"function ClickCounter() {}\",\n \"function getNumber(e) {\\n 'use strict';\\n\\n // if the actions array has a number\\n // and no operator then reset the array\\n if (actions.length === 1) {\\n num = '';\\n results = [];\\n actions = [];\\n }\\n\\n keyPress = e.currentTarget.id;\\n // console.log(keyPress);\\n\\n // make sure only one decimal\\n if (keyPress === 'dot' || keyPress === '.') {\\n // console.log(result.indexOf('.'));\\n if (results.indexOf('.') === -1) {\\n keyPress = '.';\\n results.push(keyPress);\\n }\\n } else {\\n results.push(keyPress);\\n }\\n // console.log(results);\\n\\n // make the number from the array\\n num = results.join('');\\n // strip off leading zero's\\n // console.log(/^0+[1-9]+/.test(num));\\n if (/^0+[1-9]+/.test(num)) {\\n // console.log(\\\"zeros with a number\\\");\\n num = num.replace(/^0+/, '');\\n } else if (/^0+\\\\./.test(num)) {\\n // console.log(\\\"zeros with a dot\\\");\\n num = num.replace(/^0+\\\\./, '0.');\\n } else if (/^0+/.test(num)) {\\n // zero\\n // console.log(\\\"all zeros\\\");\\n num = 0;\\n }\\n // console.log('results: ' + num);\\n if (isNaN(num) === false) {\\n showNum(num);\\n return;\\n } else {\\n return;\\n }\\n }\",\n \"function getNumbers() {\\n let numbers = document.getElementsByClassName('number');\\n for(i=0; i {\\n let eventData = event;\\n numberClicked(eventData);\\n });\\n }\\n \\n}\",\n \"function celulaClick() {\\n let loc = this.id.split(\\\"_\\\");\\n let row = Number(loc[0]);\\n let col = Number(loc[1]);\\n\\n if (this.className==='vivo'){\\n this.setAttribute('class', 'muerto');\\n aGen[row][col] = 0;\\n \\n }else{\\n this.setAttribute('class', 'vivo');\\n aGen[row][col]=1;\\n }\\n}\",\n \"click() { }\",\n \"function operator(x) {\\n decimal_clicked = false;\\n equals_just_used = false;\\n digit_click_num = 0;\\n if (x != \\\"%\\\") {\\n operator_click_num++;\\n }\\n update_variables('operator', x);\\n update_display();\\n}\",\n \"function clickNumber(event) {\\r\\n console.log(event.target.value);\\r\\n \\r\\n if(operation.innerHTML == \\\"\\\")\\r\\n\\tfirstNumber.innerHTML += event.target.value;\\r\\n else if(operation.innerHTML != \\\"\\\")\\r\\n\\tsecondNumber.innerHTML += event.target.value;\\r\\n}\",\n \"function dondeClick(event) {\\n if (event.target.className == \\\"asiento\\\") {\\n event.target.classList.add(\\\"seleccionado\\\");\\n document.getElementById(\\\"numero\\\").innerHTML++;\\n calcularPrecio();\\n almacenar();\\n } else if (event.target.className == \\\"asiento seleccionado\\\") {\\n event.target.classList.remove(\\\"seleccionado\\\");\\n document.getElementById(\\\"numero\\\").innerHTML--;\\n calcularPrecio();\\n almacenar();\\n }\\n}\",\n \"function dailNumberFunc(e){ \\n let clickBtn=e.target.textContent; \\n showHideDisplays('none','none','block')\\n let dailNumber=['1','2','3','4','5','6','7','8','9','0','*','#']; \\n let addingNumber=dailNumber.find(elem=>{\\n return clickBtn===elem?elem:null; })\\n if(addingNumber===undefined){\\n return; \\n } else{ \\n if(textArea.textContent.length>=7){\\n textArea.style.fontSize='1.5em'; \\n }\\n if(textArea.textContent.length>=20){\\n textArea.style.fontSize='1em';\\n }\\n if(textArea.textContent.length>=30){\\n return\\n }\\n textArea.textContent += addingNumber; \\n } }\",\n \"function ClickEvent(maso){\\n var string_So_Luong=\\\"\\\";\\n //lay string text box\\n string_So_Luong=document.getElementById(maso.ToString()).value;\\n //parse to int\\n So_Luong = parseInt(string_So_Luong);\\n \\n\\n }\",\n \"function digitPressed(digit) {\\n button = document.querySelector(`.number${digit}`);\\n button.classList.add(\\\"clicked\\\");\\n if (display.classList.contains(\\\"clear\\\")) {\\n display.textContent = \\\"\\\"; // clear display\\n display.classList.remove(\\\"clear\\\");\\n }\\n if(display.textContent.length > 10){\\n return;\\n }\\n display.textContent += digit;\\n}\",\n \"function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}\",\n \"function printDigit(e) {\\n let obj=e.target;\\n\\n if (result.value==='0') {\\n result.value=obj.textContent;\\n } else {\\n result.value +=obj.textContent;\\n }\\n}\",\n \"function digit_input_one (value) {\\n //conditional to allow number click\\n if (buttonClick === null) {\\n //get number value from html element\\n var numberRetriever = $(value).children('h3').html();\\n //differentiate between a decimal. If decimal has been clicked during forst operand then no other decimals will be allowed\\n if(numberRetriever === '.' && decimalClick === null) {\\n number = numberRetriever;\\n //sets decimal conditional to be false\\n decimalClick = false;\\n }\\n //conditional to allow all html elements besides decimals top be logged\\n else if (numberRetriever != '.') {\\n number = numberRetriever;\\n }\\n console.log('Subsequent Number is: ' + number);\\n //Once the first number has been enetered the operators may be clicked\\n operatorClick = true;\\n }\\n //empty operand value set to add on the the number value for every click\\n operand += number;\\n //reset the number value\\n number = '';\\n //show the operand value on the screen\\n $('.output').html(operand);\\n console.log(operand);\\n //allow operator buttons to be clicked\\n equateClick = true;\\n}\",\n \"function onClick () {\\n\\n // erhöhe den Wert der Variable 'clicks' um 1\\n clicks++;\\n\\n var text = '';\\n\\n if (clicks === 1) {\\n // beim ersten Klick\\n text = 'Hallo!';\\n } else if (clicks < 4) {\\n // beim zweiten und dritten Klick\\n text = 'Hmmm';\\n } else {\\n // bei allen folgenden Klicks\\n text = 'Autsch!';\\n }\\n\\n // setze den Inhalt des Elements mit der ID 'reaktion' auf den zuvor bestimmten Text\\n reaktion.textContent = text;\\n }\",\n \"function toOctClicked(){colorTo(3); toOct = true, toDec = false; toBin = false, toHex = false;}\",\n \"function numberClicked(event) {\\n\\n if (para.textContent.includes(\\\"=\\\")) {\\n // do nothing\\n } else if ((event.target.innerHTML == \\\".\\\") && (para.textContent.endsWith(\\\".\\\"))) {\\n // do nothing\\n } else {\\n para.textContent += event.target.innerHTML;\\n }\\n}\",\n \"function touches9() {\\n\\tif (num[9]==true){\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"9\\\";\\n\\t} else {\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"\\\";\\n\\t}\\n}\",\n \"function clicked(d,i) {\\n\\n}\",\n \"function clicked(d,i) {\\n\\n}\",\n \"function setupNumberButtons() {\\n let buttons = document.querySelectorAll(\\\".button-operator, .button-number\\\");\\n for (var i = 0; i < buttons.length; i++) {\\n buttons[i].addEventListener('click', addToScreen, false);\\n }\\n}\",\n \"function updateClickerDisplay(num) {\\n clickerCounterDisplay.innerText = num;\\n}\",\n \"clickNumber(event) {\\n\\n // 'number' is set to the number clicked\\n let NUMBER = event.target.innerText\\n\\n /* \\n If the number 0 is clicked, we don't want 0 to simply be concating onto the existing operand\\n lest we create a situation where we have '003080', so we separate zero and check whether it\\n should be appended\\n */\\n\\n if(NUMBER==ZERO) {\\n this.handleZero()\\n }\\n\\n /*\\n If the value of the operand is default '0' then 'number' is not concated to it, but replaces\\n the default value. This prevents readouts like '03' (if 3 is clicked.) Instead it will become '3'\\n */\\n else {\\n if(this.state.operand==ZERO) {\\n this.setState({operand: NUMBER});\\n this.updateLowerDisplay(NUMBER);\\n }\\n else if(this.state.operand!=ZERO) {\\n this.handleConcat(NUMBER);\\n }\\n }\\n }\",\n \"function onClickUno() {\\n if (operandoType != 1) { opHiddenIndex++; }\\n operandoType = 1;\\n strDisplay += \\\"1\\\";\\n\\n insertOpHidden(\\\"1\\\");\\n refreshDisplay();\\n}\",\n \"function listenForClick(number) {\\n if (TEST_LIGHTS === game[TEST_MODE]) {\\n setTimeout(function () {\\n nextRound()\\n }, 1000);\\n }\\n}\",\n \"function autoclickprix(){\\n return Math.round(200 * (nbMultiplicateurAmelioAutoclick * 0.40));\\n}\",\n \"function o(a){a.click(p).mousedown(ka)}\",\n \"function crystalClick () {\\n counter += parseInt($(this).attr(\\\"value\\\"));\\n\\t\\t$(\\\".score-number\\\").html(counter);\\n\\t\\tif (counter == targetNumber) {\\n\\t\\t\\twins++;\\n\\t\\t\\ttotalReset();\\n\\t\\t}\\n\\t\\telse if (counter > targetNumber) {\\n\\t\\t\\tlosses++;\\n\\t\\t\\ttotalReset();\\n };\\n console.log(\\\"clicks are working\\\")\\n }\",\n \"numBoxClicked(numBoxRow, numBoxCol, numBoxVal) {\\n \\tif (this.model.crossOutNum(numBoxRow, numBoxCol, numBoxVal) === true) {\\n \\t\\tthis.view.strikeNum(numBoxRow, numBoxCol);\\n \\t\\t\\n \\t\\tif (this.model.crossOutLockBox(numBoxRow, numBoxCol) === true) {\\n \\t\\t\\tthis.view.strikeLockBox(numBoxRow);\\n \\t\\t\\tthis.view.disappearDie(numBoxRow);\\n \\t\\t}\\n \\t\\t\\n \\t\\tthis.view.changeButtons(this.model.gamePhase);\\n \\t\\tthis.gameOverCheck();\\n \\t}\\n }\",\n \"function btn1click(){\\n //calling function with btn number\\n if(start ==true){ selectImg(\\\"1\\\");}\\n}\",\n \"function runEventListener (i){\\n clickSound.play()\\n let currentButtonText = buttons[i].innerHTML\\n if ((!isNaN(currentButtonText) || currentButtonText === '.') && temporaryValue.length < 10){\\n clickNumberButton(currentButtonText)\\n }\\n else if (currentButtonText === 'AC'){\\n clickAcButton ()\\n }\\n else if (currentButtonText === 'CE'){\\n clickCeButton ()\\n }\\n else if (currentButtonText === '='){\\n clickEqualButton ()\\n }\\n else if (isNaN(currentButtonText)){\\n clickSymbolButton (currentButtonText)\\n }\\n}\",\n \"function clickListener(num) {\\n\\treturn function() {\\n\\t\\tself.port.emit(\\\"clicked-link\\\", num);\\n\\t};\\n}\",\n \"function printDigit(e) {\\n let obj = e.target;\\n \\n if (result.value === '0') {\\n result.value = obj.textContent;\\n } else {\\n result.value += obj.textContent;\\n }\\n}\",\n \"function numero1(num){\\n \\n if(document.getElementById(\\\"Ctexto\\\").value==\\\"\\\" && op==false ){\\n\\t\\tdocument.getElementById(\\\"Ctexto\\\").value=num;\\n\\t\\top=true;\\n\\t\\tcont++;\\n\\t\\tdocument.getElementById(\\\"dados1\\\").style.visibility =\\\"hidden\\\";\\n\\t\\t\\n\\t}else if(op==false){\\n\\t\\t//$('#dados1,#dados2,#dados3,#dados4,#dados5').click(function (){$(this).hide()});\\n\\t\\tdocument.getElementById(\\\"Ctexto\\\").value+=num;\\n\\t\\top=true;\\n\\t\\tcont++;\\n\\t\\tdocument.getElementById(\\\"dados1\\\").style.visibility =\\\"hidden\\\";\\n\\t}\\n\\n}\",\n \"function clickPageNumber(pagenumber){\\n pageNumber = pagenumber;\\n //chang display amount label and write page to next page\\n changeDisplayAmount(displayType,pagenumber);\\n}\",\n \"function clickOperator(event) {\\r\\n console.log(event.target.value);\\r\\n \\r\\n if(secondNumber.innerHTML != \\\"\\\" || firstNumber.innerHTML == \\\"\\\")\\r\\n\\treturn;\\r\\n operation.innerHTML = event.target.value;\\r\\n}\",\n \"function touches1() {\\n\\tif (num[1]==true){\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"1\\\";\\n\\t} else {\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"\\\";\\t\\t\\n\\t}\\n}\",\n \"function operClicked(){\\n\\tif((chain === false)){\\n\\t\\tfirstMemory = Number($display.val());\\n\\t} else if(numEntered){\\n\\t\\tif(operator === \\\"+\\\"){\\n\\t\\t\\tfirstMemory = add(firstMemory, Number($display.val()));\\n\\t\\t} else if(operator === \\\"-\\\"){\\n\\t\\t\\tfirstMemory = substract(firstMemory, Number($display.val()));\\n\\t\\t} else if(operator === \\\"×\\\"){\\n\\t\\t\\tfirstMemory = multiply(firstMemory, Number($display.val()));\\n\\t\\t} else if(operator === \\\"÷\\\"){\\n\\t\\t\\tfirstMemory = divide(firstMemory, Number($display.val()));\\t\\n\\t\\t}\\n\\t} \\n\\n\\toperator = $(this).text();\\n\\tconsole.log(operator);\\n\\tchain = true;\\n\\tneedNewNum = true;\\n\\tisThereDot = false;\\n\\tnumEntered = false;\\n}\",\n \"function operatorPressed(operator) {\\n // if remaining minus, do nothing\\n if (display.textContent === '-'){\\n return;\\n }\\n const button = document.querySelector(`.${getOperatorName(operator)}`);\\n button.classList.add(\\\"clicked\\\");\\n display.dataset.numbers += \\\",\\\"+display.textContent; // save number\\n display.dataset.operators += \\\",\\\"+operator; // save operator\\n display.classList.add(\\\"clear\\\");\\n}\",\n \"function printNumber() {\\n\\n //Attribution du symbol du bouton cliqué (chiffre) à la variable nb\\n let nb = this.getAttribute(\\\"data-symbol\\\");\\n\\n //Affiche le chiffre cliqué dans l'écran (screen)\\n screen.textContent += nb;\\n\\n //On enlève tous les espaces du string (screen) et on met cela dans la variable screenContent\\n let screenContent = screen.textContent.replace(/\\\\s/g, \\\"\\\");\\n \\n //On affiche le résultat de l'équation dans screenResult avec un arrondit à 2 chiffres après la virgule\\n screenResult.textContent = `= ${Math.round(eval(screenContent)*100)/100}`;\\n\\n //On enlève la classe \\\"result\\\" au screenResult\\n screenResult.classList.remove(\\\"result\\\");\\n}\",\n \"function buttonClick(value) {\\n if (isNaN(parseInt(value))) {\\n handleSymbol(value);\\n } else {\\n handleNumber(value);\\n }\\n rerender();\\n}\",\n \"function buttonClicked(value) {\\n\\tif (isNaN(parseInt(value))) {\\n\\t\\thandleOperators(value);\\n\\t\\tclear(value);\\n\\t} else {\\n\\t\\tnumberManage(value);\\n\\t}\\n\\trerender();\\n}\",\n \"function acClicked(){\\n\\tfirstMemory = 0;\\n\\tsecondMemory = 0;\\n\\tshowOnDisplay('');\\n\\tneedNewNum = true;\\n\\tchain = false;\\n\\tnumEntered = false;\\n}\",\n \"function handler(){\\n switchCounter++;\\n if(switchCounter%2===1 && $values.innerText.length<8){\\n $values.style.display=\\\"block\\\";\\n for(j=0;j<=10;j++){\\n $number[j].addEventListener(\\\"click\\\",numberSelect);\\n }\\n for(m=0;m<=3;m++){\\n $operator[m].addEventListener(\\\"click\\\",operation);\\n }\\n $equals.addEventListener(\\\"click\\\",showAnswer);\\n $mPositive.addEventListener(\\\"click\\\",storeToMemory);\\n $mNegative.addEventListener(\\\"click\\\",removeFromMemory);\\n $mrc.addEventListener(\\\"click\\\",storedMemory);\\n }\\n else{\\n $values.style.display=\\\"none\\\";\\n $values.innerText=0;\\n numberIsClicked=false;\\n operatorIsClicked=false;\\n numberOfOperand=0;\\n equalsToIsClicked=false;\\n myoperator=\\\"\\\";\\n }\\n}\",\n \"function addClicks (int1) {\\n rockTotal += int1;\\n }\",\n \"clicked(x, y) {}\",\n \"function change_by_one(value, direction){\\n\\n var number = value.replace(/[^-\\\\d\\\\.]/g, '');\\n var unit = value.replace(number, '').trim();\\n\\n if(number == \\\"\\\") number = \\\"0\\\";\\n if(unit == \\\"\\\") unit = \\\"px\\\"; \\n\\n var newvalue = \\\"\\\";\\n\\n if(direction == \\\"plus\\\")\\n newvalue = Number(number) + 1; \\n else newvalue = Number(number) - 1; \\n\\n console.log(newvalue + \\\"\\\" +unit);\\n return newvalue+unit; \\n\\n alert(\\\"new value after click \\\"+ newvalue+unit);\\n }\",\n \"function getNum(n){\\n let screen = document.getElementById(\\\"screen\\\");\\n screen.value += n;\\n}\",\n \"function getNumber(count){\\n\\n\\t var num = document.getElementById(\\\"btn\\\");\\n alert(num.innerHTML);\\n alert (count);\\n}\",\n \"function _click(d){\\n \\n }\",\n \"function fromOctClicked(){colorFrom(3); fromOct = true, fromBin =false, fromDec = false, fromHex = false;}\",\n \"function buttons(idbutton) {\\n var value = idbutton.val();\\n $(idbutton).click(() => {\\n console.log(\\\"Puntos: \\\" + contpoint);\\n if(entry == null) {\\n entry.val(value);\\n } else if(entry.val().length >= 12) {\\n console.log(\\\"Esta full\\\");\\n } else if(value == \\\".\\\" && contpoint == 0) {\\n contpoint++;\\n entry.val(entry.val() + value);\\n } else if(value == \\\".\\\" && contpoint > 0) {\\n console.log(\\\"Hay mas de un punto\\\");\\n }\\n else {\\n entry.val(entry.val() + value);\\n }\\n $(idbutton).addClass(\\\"animated pulse\\\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', () => {\\n $(idbutton).removeClass(\\\"animated pulse\\\");\\n });\\n });\\n}\",\n \"function addClick(ind){\\n var elem = shapes[ind];\\n elem.addEventListener(\\\"click\\\", function(){\\n clicked += 1;\\n checkOrder(ind);\\n\\n });\\n }\",\n \"function SomaClickState() {\\n setState(stateValue = stateValue + 1); // Mesma coisa que isso state[1](stateValue);\\n // Por setState ser uma funcao ele temq ue ser escrito seu nome e parenteses\\n }\",\n \"function handleNumber(number) {\\n if (resultDisplay.innerText == '0' || operatorPressed) {\\n changeDisplay('');\\n operatorPressed = false;\\n }\\n resultDisplay.innerText += number;\\n}\",\n \"function clickToSum() {\\n\\tvar sum = 0;\\n\\tvar nums = document.getElementsByClassName(\\\"number\\\");\\n\\tvar bigButton = document.getElementsByClassName(\\\"info\\\")[0];\\n\\n\\tfor (var i = 0; i < nums.length; i++) {\\n\\t\\tsum += parseInt(nums[i].innerHTML);\\n\\t}\\n\\n\\tbigButton.getElementsByTagName(\\\"h2\\\")[0].appendChild(document.createTextNode(sum));\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7131207","0.7007308","0.6951292","0.6844245","0.68236154","0.6785539","0.6764145","0.67068475","0.66902304","0.66212386","0.65701467","0.6565539","0.6507141","0.6483116","0.6441663","0.63847923","0.6383678","0.63509285","0.6316498","0.6312572","0.63093907","0.62617254","0.6249654","0.6219076","0.61256856","0.6119096","0.61123574","0.60940564","0.603111","0.60231227","0.6001712","0.59867424","0.5984633","0.5984572","0.5983966","0.59804595","0.59698683","0.5966743","0.5951503","0.59353095","0.5932322","0.5928852","0.59286857","0.5928476","0.59198296","0.5915391","0.5915377","0.5905284","0.58984935","0.5893946","0.5889284","0.58698094","0.5863869","0.5860097","0.58464664","0.58461916","0.58415407","0.5839543","0.5820957","0.58150446","0.58066446","0.58011943","0.57853895","0.5777331","0.5777331","0.57765007","0.5774835","0.57676953","0.57670313","0.5761483","0.57516265","0.57507247","0.5748041","0.5741868","0.5732195","0.5731344","0.5728761","0.57133913","0.5710279","0.5706748","0.5702245","0.57019645","0.5693243","0.5692313","0.5690719","0.56894517","0.5684643","0.56791306","0.56778723","0.5671207","0.5668744","0.5663496","0.566273","0.5658428","0.5656604","0.56556857","0.56429654","0.5638859","0.5636795","0.56322515","0.5628458"],"string":"[\n \"0.7131207\",\n \"0.7007308\",\n \"0.6951292\",\n \"0.6844245\",\n \"0.68236154\",\n \"0.6785539\",\n \"0.6764145\",\n \"0.67068475\",\n \"0.66902304\",\n \"0.66212386\",\n \"0.65701467\",\n \"0.6565539\",\n \"0.6507141\",\n \"0.6483116\",\n \"0.6441663\",\n \"0.63847923\",\n \"0.6383678\",\n \"0.63509285\",\n \"0.6316498\",\n \"0.6312572\",\n \"0.63093907\",\n \"0.62617254\",\n \"0.6249654\",\n \"0.6219076\",\n \"0.61256856\",\n \"0.6119096\",\n \"0.61123574\",\n \"0.60940564\",\n \"0.603111\",\n \"0.60231227\",\n \"0.6001712\",\n \"0.59867424\",\n \"0.5984633\",\n \"0.5984572\",\n \"0.5983966\",\n \"0.59804595\",\n \"0.59698683\",\n \"0.5966743\",\n \"0.5951503\",\n \"0.59353095\",\n \"0.5932322\",\n \"0.5928852\",\n \"0.59286857\",\n \"0.5928476\",\n \"0.59198296\",\n \"0.5915391\",\n \"0.5915377\",\n \"0.5905284\",\n \"0.58984935\",\n \"0.5893946\",\n \"0.5889284\",\n \"0.58698094\",\n \"0.5863869\",\n \"0.5860097\",\n \"0.58464664\",\n \"0.58461916\",\n \"0.58415407\",\n \"0.5839543\",\n \"0.5820957\",\n \"0.58150446\",\n \"0.58066446\",\n \"0.58011943\",\n \"0.57853895\",\n \"0.5777331\",\n \"0.5777331\",\n \"0.57765007\",\n \"0.5774835\",\n \"0.57676953\",\n \"0.57670313\",\n \"0.5761483\",\n \"0.57516265\",\n \"0.57507247\",\n \"0.5748041\",\n \"0.5741868\",\n \"0.5732195\",\n \"0.5731344\",\n \"0.5728761\",\n \"0.57133913\",\n \"0.5710279\",\n \"0.5706748\",\n \"0.5702245\",\n \"0.57019645\",\n \"0.5693243\",\n \"0.5692313\",\n \"0.5690719\",\n \"0.56894517\",\n \"0.5684643\",\n \"0.56791306\",\n \"0.56778723\",\n \"0.5671207\",\n \"0.5668744\",\n \"0.5663496\",\n \"0.566273\",\n \"0.5658428\",\n \"0.5656604\",\n \"0.56556857\",\n \"0.56429654\",\n \"0.5638859\",\n \"0.5636795\",\n \"0.56322515\",\n \"0.5628458\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":38,"cells":{"query":{"kind":"string","value":"click al signo (+,/,,)"},"document":{"kind":"string","value":"function Sign(s){\r\nG_Numero1=document.getElementById(\"result\").value;\r\nG_Signo=s;\r\ndocument.getElementById(\"result\").value=\"\";\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["clickSignInLnk() {\n return this.SignInLnk.click();\n }","function signupLinkClick() {\n closeSigninClick();\n signupClick();\n}","clickOnSignInLink(){\n let signInLink = utils.byLocator(jobsPageLocator.jobsPage.SignInLink);\n utils.clickOn(signInLink);\n }","async clickSignIn() {\n await this.driver.findElement(By.css(SELECTORS.signIn)).click();\n }","function onClick () {\n navCur && navCur.click();\n }","@api\n click() {\n const anchor = this.emailAnchor;\n if (anchor && anchor.click) {\n anchor.click();\n }\n }","clickFacebook(){\n window.location.href=\"http://facebook.com\";\n }","click_extra() {\r\n }","function click(){\n document.getElementById(\"defaultOpen\").click();\n}","function emailIconClick() {\n\tlocation.href = \"mailto:mjdargen@gmail.com\";\n}","function twitKisminaTikla(){\n let nelerOluor = document.getElementsByClassName(\"public-DraftEditorPlaceholder-inner\");\n nelerOluor[0].click();\n\n}","function equalsClicked(key) {\r\n equalButton.click();\r\n}","click() { }","async clickSignUp() {\n await this.driver.findElement(By.css(SELECTORS.signUpButton)).click();\n }","function ClickGerarElite() {\n GeraElite();\n AtualizaGeral();\n}","function handleClick(event){\n console.log(\"Signing in\")\n}","function ClickGerarComum() {\n GeraComum();\n AtualizaGeral();\n}","function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}","function operandClicked(key) {\r\n operatorButtons.forEach(operator => {\r\n if(operator.innerText === key) {\r\n operator.click();\r\n }\r\n })\r\n}","function signatureBoxFun() {\r\n if (!this.classList.contains('loading')) {\r\n const input = this.querySelector('#sign-upload');\r\n input.click();\r\n }\r\n}","function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}","function q(a){a.click(u).mousedown(Ta)}","goToSignupPage() {\n Linking.openURL('https://signup.sbaustralia.com');\n //Actions.signup();\n }","function trackSignupClick (e) {\n var buttonId = e.currentTarget.getAttribute('id');\n var pageId = document.querySelector('body').getAttribute('id');\n return window.client.trackExternalLink(e, 'signup_click', {id: buttonId, page: pageId});\n}","clickAddToCart() {\n return this\n .waitForElementVisible('@addToCartBtn')\n // .moveToElement('@addToCartBtn', 10, 10)\n .click('@addToCartBtn');\n }","function click(x, y)\n{\n //Do Nothing, prompt only command.\n}","function q(a){a.click(u).mousedown(V)}","function ativeBonusRound() {\n document.getElementsByClassName(\"start-button\")[0].click();\n }","function ClickAdicionarEscudo() {\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}","function accediLinkPop(){\n\tif (checkCustomLoginComUrl(LOGIN_COM_URL_TYPE.REG_URL))\n\t\treturn false;\n\talreadyRcsUser = false;\n\twaitingToLoad = false;\n\tBotAccetto = false;\n\tBotConcludi = false;\n\n\tcallOmnitureTracing('event2','COR/Accesso Network Corriere.it','Corriere');\n\tsocial_selected = null;\n\topenFBbox(context_ssi+\"boxes/community/login/accedi.shtml?\"+corriereDevice);\n}","function buyGym(){\n\t\t\tbuyClick(\"localgym\");\n\t\t}","async clickOnButton(string) {\n if (string == \"Work out how much I could borrow\") xpath = '[id=\"btnBorrowCalculater\"]';\n else if (string == \"Start over\") xpath = '[aria-label=\"Start over\"]';\n // click\n await this.page.click(xpath);\n }","function ClickGerarAleatorioComum() {\n GeraAleatorioComum();\n AtualizaGeral();\n}","function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}","function goto_social(element) {\n// var selected = element.id.replace('_goto_btn_', '');\n// var selected = element.id.substring(0, element.id.indexOf(\"_goto_btn_\"));\n// console.log(selected);\n var parent_grp_btn_id = element.id.replace('_goto_btn_', '_btn_group_');\n var sel_med_url = $('#' + parent_grp_btn_id).attr('url_value');\n if (sel_med_url.indexOf('google-plus') > -1) {\n sel_med_url = sel_med_url.replace('google-plus', 'googleplus');\n }\n window.open(sel_med_url, '_newtab');\n}","function buttonClicked(key) {\r\n numberButtons.forEach(number => {\r\n if(number.innerText === key) {\r\n number.click();\r\n }\r\n })\r\n}","function clickAssess() {\n\t$.trigger(\"clickAssess\");\n}","function ClickMe(e) {\n if (userjwt) {\n if (e.target.getAttribute('src') === 'https://img.icons8.com/android/24/ffffff/star.png') {\n e.target.setAttribute('src', 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png');\n } else if (e.target.getAttribute('src') === 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png') {\n e.target.setAttribute('src', 'https://img.icons8.com/android/24/ffffff/star.png');\n }\n }\n }","function clickme(){\n\n\t\talert('Hey, you clicked me!');\n\t}","function clickGithub() {\n\t$.ajax({\n\t\turl: '\\/login\\/github',\n\t\tmethod: 'GET'\n\t}).done(function(jsondata) {\n\t\tif (jsondata.redirect) {\n\t\t\twindow.location.href = jsondata.redirect;\n\t\t}\n\t});\n}","function openSign(evt, signName) {\n // Declare the variables\n var i, tabcontent, tablinks;\n\n // Retrieves and hides those elements with class \"tabcontent\"\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Retrieves those elements with class=\"tablinks\" and removes the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // Shows current tab, and gives button which opened that tab the class \"active\"\n document.getElementById(signName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n}","function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}","function clickme(){\r\n\t\t// this function includes an alert, or a pop-up box with the following text when the function is called.\r\n\t\talert('Hey, you clicked me!');\r\n\t}","register() {\n this.jquery(\"#register\").on(\"click\", function (event) {\n event.preventDefault();\n navigateTo(\"/sign\");\n });\n }","function cbox_key(e) {\n\t\tif (e.keyCode === 37) {\n\t\t\te.preventDefault();\n\t\t\t$prev.click();\n\t\t} else if (e.keyCode === 39) {\n\t\t\te.preventDefault();\n\t\t\t$next.click();\n\t\t}\n\t}","function clickElement(el) {\r\n\t/*var clickMouse = document.createEvent(\"MouseEvents\");\r\n\tclickMouse.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\tplaybutton.dispatchEvent(clickMouse);*/\r\n\tvar clickUI = document.createEvent(\"UIEvents\");\r\n\tclickUI.initUIEvent(\"click\", true, true, window, 1);\r\n\tel.dispatchEvent(clickUI);\r\n}","function loginCmd( proj ) {\n\tvar user = document.getElementById( 'loginUser' ).value; \n\tvar pass = document.getElementById( 'loginPass' ).value; \n\twindow.location.href=\"plus.php?action=2&user=\" + user + \n\t\"&pass=\"+ pass + \"&project=\" + proj ;\n}","function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}","function o(a){a.click(p).mousedown(ka)}","function interaction1() {\n window.location.href = `https://amdevito.github.io/211/interact/index.html`;\n}","function clickme(){\n //the message in the pop up\n\t\talert('Hey, you clicked me!');\n\t}","function onCancelClick() {\n $.trigger('promptSignature:cancel_signature');\n}","function loginUgyldig() {\r\n Aliases.linkAuthorizationLogin.Click();\r\n\r\n let brukernavn = func.random(15) + \"@\" + func.random(7) + \".com\"\r\n let passord = func.random(8)\r\n loggInn(brukernavn, passord);\r\n\r\n //Sjekk om feilmelding kommer frem: \r\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \"Visible\", cmpEqual, true);\r\n Aliases.linkHttpsTestOptimeraNo.Click();\r\n}","function lcom_RegOKCompleta(){\n\topenFBbox(context_ssi+\"boxes/community/login/verifica_ok_nomail.shtml\");\n}","function click_sanc()\r\n{\r\ndocument.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0].click();\r\n//click(document.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0]);\r\n}","function click1()\n{\n\tagreeLink1_valid = true;\n}","handleClick(){\n var urlBuilder = [];\n urlBuilder.push('response_type=code', `client_id=${config.google_client_id}`, `redirect_uri=${window.location.origin}/login/callback`, 'scope=profile email');\n const url = \"https://accounts.google.com/o/oauth2/v2/auth?\" + urlBuilder.join('&');\n // Open the popup window\n window.location.href = url;\n }","function handleClick() {\n\t\tpaymentsClient.loadPaymentData(getRequest()).then(function(paymentData){\n\t\t\tconst $data = paymentData.paymentMethodData.tokenizationData.token\n\t\t\tgpaytoken($data);\n\n\t\t}).catch(function(err){\n\t\t\tself.hide(err);\n\t\t});\n\n\t}","function asignarEventos() {\n _.click(function() {\n\n });\n}","function toSigns() {\n document.getElementById('keyboardMinus').style.display = \"none\";\n document.getElementById('keyboardMayus').style.display = \"none\";\n document.getElementById('keyboardNum').style.display = \"none\";\n document.getElementById('keyboardSymb').style.display = \"block\";\n document.getElementById('keyboardGif').style.display = \"none\";\n}","function bwClick(itemId) {\n $(itemId).click();\n}","handleJDotterClick() {}","function prim_click(e) {\n var user = document.querySelector('#select_value').value;\n browser.runtime.sendMessage({ 'name': 'set_change_card_for_site', 'user': user }, function (response) { });\n window.close();\n}","async click() {\n await t.click(selector);\n }","verCartelera(){\n browser.click('.btn.btnEnviar.btnVerCartelera')\n }","function trackShatnerBoxClick(result) {\n var s = s_gi(s_account);\n var txt = 'ShatnerBoxClick_' + result;\n s.trackExternalLinks = false;\n s.linkTrackVars = 'prop6,eVar6';\n s.tl(this, 'o', txt);\n}","function onClickFollow(){\n if(compname === \"\"){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operation Success',\n description:\n `${compname} has been added to the following list. `,\n });\n }\n }","function ClickAdicionarArmadura() {\n gEntradas.armaduras.push({ chave: 'nenhuma', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}","clickMyProfileLink() {\n return this.myProfileLink.click();\n }","click(x, y, _isLeftButton) {}","goToGithub() {\n window.location.href = \"https://github.com/kandrupr\"\n }","static addClickListenerOnPublisherSignInButton_() {\n self.document\n .getElementById(PUBLISHER_SIGN_IN_BUTTON_ID)\n .addEventListener('click', (e) => {\n e.preventDefault();\n\n callSwg((swg) => swg.triggerLoginRequest({linkRequested: false}));\n });\n }","function goTo(menuKey) {\n\t\t\tvar template = SUGGGET_ADPAYMENT;\n\t\t\tsetArParams(menuKey);\n\t\t\tsetIdCheckbox(menuKey);\n\t\t\tsetApParams(menuKey);\n\t\t\tpostal.publish({\n\t\t\t\tchannel: \"Tab\",\n\t\t\t\ttopic: \"open\",\n\t\t\t\tdata: template\n\t\t\t});\n\t\t}","function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }","function logClick() {\n ReactGA.event({\n category: 'Registration',\n action: 'Clicked Register Today',\n label: 'Challenge Text link',\n });\n}","function simulateclick(){\n\tdocument.getElementById('imagefiles').click();\n}","function openSignUp() {\n\tif (validateEmail()) {\n\t\tvar url = '/' + channel + '/Content.ice?page=Sign-Up-For-Fashion-News&pgForward=popup' + '&email=' + document.getElementById('email').value;\n open(url,'SignupForFashionNews','width=700,height=500');\n var tmp = open(url,'SignupForFashionNews','width=700,height=500');\n\t\ttmp.focus();\n\t}\n\treturn false;\n}","click() { // add click event\n app.quit();\n }","function handleAuthClick() {\n\tgapi.auth2.getAuthInstance().signIn().catch((ignore) => {});\n}","function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }","clickLoginButton() {\n this.loginButton.click();\n }","function clicksubmitskill(e) {\n if (e.keyCode == 13) {\n document.getElementById(\"submitskill\").click();\n return false;\n }\n return true;\n }","function click2()\n{\n\tagreeLink2_valid = true;\n}","function TakeLoginAction(e) {\n\n var enterkeyPressed = IsEnterKeyPressed(e);\n\n if (enterkeyPressed) {\n\n if (window.event) {\n event.returnValue = false;\n event.cancel = true;\n }\n else {\n e.returnValue = false;\n e.cancel = true;\n }\n\n var actionButton = GetActionButton(\"logonButton\");\n\n if (actionButton != null) {\n actionButton.click();\n }\n }\n}","function ClickGerarResumo() {\n AtualizaGeral(); // garante o preenchimento do personagem com tudo que ta na planilha.\n var input = Dom(\"resumo-personagem-2\");\n input.value = GeraResumo();\n input.focus();\n input.select();\n}","function click(el) {\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true /* bubble */, true /* cancelable */,\n window, null,\n 0, 0, 0, 0, /* coordinates */\n false, false, false, false, /* modifier keys */\n 0 /*left*/, null\n );\n el.dispatchEvent(ev);\n }","function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}","function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}","clickCheckOutGreenTea() {\n this.clickElem(this.btnCheckOutGreenTea);\n }","function keywordsMsg(e)\n{\n var event = e || window.event;\n if(event.keyCode == 13)\n {\n $('#send').click(); \n }\n}","async cookieClicker() {\n let isPresent = await this.cookieButtonElement.isPresent();\n if (isPresent) {\n await this.cookieButtonElement.click();\n }\n }","function click(el){\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true, true,\n window, null,\n 0, 0, 0, 0,\n false, false, false, false,\n 0, null\n );\n el.dispatchEvent(ev);\n}","function done(){\n iframes[0].querySelector(\"#InlineEditDialog_buttons > input:nth-child(1)\").click()\n }","function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}","function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}","function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n}","function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n}","function clickButtonEl(key) {\n numbersEl.forEach((button) => {\n if (button.innerText === key) {\n button.click();\n }\n });\n}","function signCon() {\n\t$(\"#sps\").click( function() {\n\t\t$(\"#signup\").slideToggle();\n\t})\n\t$(\"#spc\").click( function() {\n\t\t$(\"#settingsBox\").slideToggle();\n\t})\n\t$(\"#contactMeButton\").click( function() {\n\t\t$(\"#contactme\").slideToggle();\n\t})\n}","function onCallForwardingAutoPopupOkBtnClick() {\r\n callForwardingAutoToggleSwitch.click();\r\n }"],"string":"[\n \"clickSignInLnk() {\\n return this.SignInLnk.click();\\n }\",\n \"function signupLinkClick() {\\n closeSigninClick();\\n signupClick();\\n}\",\n \"clickOnSignInLink(){\\n let signInLink = utils.byLocator(jobsPageLocator.jobsPage.SignInLink);\\n utils.clickOn(signInLink);\\n }\",\n \"async clickSignIn() {\\n await this.driver.findElement(By.css(SELECTORS.signIn)).click();\\n }\",\n \"function onClick () {\\n navCur && navCur.click();\\n }\",\n \"@api\\n click() {\\n const anchor = this.emailAnchor;\\n if (anchor && anchor.click) {\\n anchor.click();\\n }\\n }\",\n \"clickFacebook(){\\n window.location.href=\\\"http://facebook.com\\\";\\n }\",\n \"click_extra() {\\r\\n }\",\n \"function click(){\\n document.getElementById(\\\"defaultOpen\\\").click();\\n}\",\n \"function emailIconClick() {\\n\\tlocation.href = \\\"mailto:mjdargen@gmail.com\\\";\\n}\",\n \"function twitKisminaTikla(){\\n let nelerOluor = document.getElementsByClassName(\\\"public-DraftEditorPlaceholder-inner\\\");\\n nelerOluor[0].click();\\n\\n}\",\n \"function equalsClicked(key) {\\r\\n equalButton.click();\\r\\n}\",\n \"click() { }\",\n \"async clickSignUp() {\\n await this.driver.findElement(By.css(SELECTORS.signUpButton)).click();\\n }\",\n \"function ClickGerarElite() {\\n GeraElite();\\n AtualizaGeral();\\n}\",\n \"function handleClick(event){\\n console.log(\\\"Signing in\\\")\\n}\",\n \"function ClickGerarComum() {\\n GeraComum();\\n AtualizaGeral();\\n}\",\n \"function InventoryItemMouth2CupholderGagClick() {\\n\\tInventoryItemMouthCupholderGagClick();\\n}\",\n \"function operandClicked(key) {\\r\\n operatorButtons.forEach(operator => {\\r\\n if(operator.innerText === key) {\\r\\n operator.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"function signatureBoxFun() {\\r\\n if (!this.classList.contains('loading')) {\\r\\n const input = this.querySelector('#sign-upload');\\r\\n input.click();\\r\\n }\\r\\n}\",\n \"function ClickGerarAleatorioElite() {\\n GeraAleatorioElite();\\n AtualizaGeral();\\n}\",\n \"function q(a){a.click(u).mousedown(Ta)}\",\n \"goToSignupPage() {\\n Linking.openURL('https://signup.sbaustralia.com');\\n //Actions.signup();\\n }\",\n \"function trackSignupClick (e) {\\n var buttonId = e.currentTarget.getAttribute('id');\\n var pageId = document.querySelector('body').getAttribute('id');\\n return window.client.trackExternalLink(e, 'signup_click', {id: buttonId, page: pageId});\\n}\",\n \"clickAddToCart() {\\n return this\\n .waitForElementVisible('@addToCartBtn')\\n // .moveToElement('@addToCartBtn', 10, 10)\\n .click('@addToCartBtn');\\n }\",\n \"function click(x, y)\\n{\\n //Do Nothing, prompt only command.\\n}\",\n \"function q(a){a.click(u).mousedown(V)}\",\n \"function ativeBonusRound() {\\n document.getElementsByClassName(\\\"start-button\\\")[0].click();\\n }\",\n \"function ClickAdicionarEscudo() {\\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\\n AtualizaGeralSemLerEntradas();\\n}\",\n \"function accediLinkPop(){\\n\\tif (checkCustomLoginComUrl(LOGIN_COM_URL_TYPE.REG_URL))\\n\\t\\treturn false;\\n\\talreadyRcsUser = false;\\n\\twaitingToLoad = false;\\n\\tBotAccetto = false;\\n\\tBotConcludi = false;\\n\\n\\tcallOmnitureTracing('event2','COR/Accesso Network Corriere.it','Corriere');\\n\\tsocial_selected = null;\\n\\topenFBbox(context_ssi+\\\"boxes/community/login/accedi.shtml?\\\"+corriereDevice);\\n}\",\n \"function buyGym(){\\n\\t\\t\\tbuyClick(\\\"localgym\\\");\\n\\t\\t}\",\n \"async clickOnButton(string) {\\n if (string == \\\"Work out how much I could borrow\\\") xpath = '[id=\\\"btnBorrowCalculater\\\"]';\\n else if (string == \\\"Start over\\\") xpath = '[aria-label=\\\"Start over\\\"]';\\n // click\\n await this.page.click(xpath);\\n }\",\n \"function ClickGerarAleatorioComum() {\\n GeraAleatorioComum();\\n AtualizaGeral();\\n}\",\n \"function select() {\\n getElements()[selection].getElementsByTagName('a')[0].click();\\n\\n}\",\n \"function goto_social(element) {\\n// var selected = element.id.replace('_goto_btn_', '');\\n// var selected = element.id.substring(0, element.id.indexOf(\\\"_goto_btn_\\\"));\\n// console.log(selected);\\n var parent_grp_btn_id = element.id.replace('_goto_btn_', '_btn_group_');\\n var sel_med_url = $('#' + parent_grp_btn_id).attr('url_value');\\n if (sel_med_url.indexOf('google-plus') > -1) {\\n sel_med_url = sel_med_url.replace('google-plus', 'googleplus');\\n }\\n window.open(sel_med_url, '_newtab');\\n}\",\n \"function buttonClicked(key) {\\r\\n numberButtons.forEach(number => {\\r\\n if(number.innerText === key) {\\r\\n number.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"function clickAssess() {\\n\\t$.trigger(\\\"clickAssess\\\");\\n}\",\n \"function ClickMe(e) {\\n if (userjwt) {\\n if (e.target.getAttribute('src') === 'https://img.icons8.com/android/24/ffffff/star.png') {\\n e.target.setAttribute('src', 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png');\\n } else if (e.target.getAttribute('src') === 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png') {\\n e.target.setAttribute('src', 'https://img.icons8.com/android/24/ffffff/star.png');\\n }\\n }\\n }\",\n \"function clickme(){\\n\\n\\t\\talert('Hey, you clicked me!');\\n\\t}\",\n \"function clickGithub() {\\n\\t$.ajax({\\n\\t\\turl: '\\\\/login\\\\/github',\\n\\t\\tmethod: 'GET'\\n\\t}).done(function(jsondata) {\\n\\t\\tif (jsondata.redirect) {\\n\\t\\t\\twindow.location.href = jsondata.redirect;\\n\\t\\t}\\n\\t});\\n}\",\n \"function openSign(evt, signName) {\\n // Declare the variables\\n var i, tabcontent, tablinks;\\n\\n // Retrieves and hides those elements with class \\\"tabcontent\\\"\\n tabcontent = document.getElementsByClassName(\\\"tabcontent\\\");\\n for (i = 0; i < tabcontent.length; i++) {\\n tabcontent[i].style.display = \\\"none\\\";\\n }\\n\\n // Retrieves those elements with class=\\\"tablinks\\\" and removes the class \\\"active\\\"\\n tablinks = document.getElementsByClassName(\\\"tablinks\\\");\\n for (i = 0; i < tablinks.length; i++) {\\n tablinks[i].className = tablinks[i].className.replace(\\\" active\\\", \\\"\\\");\\n }\\n\\n // Shows current tab, and gives button which opened that tab the class \\\"active\\\"\\n document.getElementById(signName).style.display = \\\"block\\\";\\n evt.currentTarget.className += \\\" active\\\";\\n\\n}\",\n \"function scribblePoser() {\\n\\tvar $elt = $(\\\"#poser_chooser\\\");\\n\\t$elt.click();\\n}\",\n \"function clickme(){\\r\\n\\t\\t// this function includes an alert, or a pop-up box with the following text when the function is called.\\r\\n\\t\\talert('Hey, you clicked me!');\\r\\n\\t}\",\n \"register() {\\n this.jquery(\\\"#register\\\").on(\\\"click\\\", function (event) {\\n event.preventDefault();\\n navigateTo(\\\"/sign\\\");\\n });\\n }\",\n \"function cbox_key(e) {\\n\\t\\tif (e.keyCode === 37) {\\n\\t\\t\\te.preventDefault();\\n\\t\\t\\t$prev.click();\\n\\t\\t} else if (e.keyCode === 39) {\\n\\t\\t\\te.preventDefault();\\n\\t\\t\\t$next.click();\\n\\t\\t}\\n\\t}\",\n \"function clickElement(el) {\\r\\n\\t/*var clickMouse = document.createEvent(\\\"MouseEvents\\\");\\r\\n\\tclickMouse.initMouseEvent(\\\"click\\\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\\r\\n\\tplaybutton.dispatchEvent(clickMouse);*/\\r\\n\\tvar clickUI = document.createEvent(\\\"UIEvents\\\");\\r\\n\\tclickUI.initUIEvent(\\\"click\\\", true, true, window, 1);\\r\\n\\tel.dispatchEvent(clickUI);\\r\\n}\",\n \"function loginCmd( proj ) {\\n\\tvar user = document.getElementById( 'loginUser' ).value; \\n\\tvar pass = document.getElementById( 'loginPass' ).value; \\n\\twindow.location.href=\\\"plus.php?action=2&user=\\\" + user + \\n\\t\\\"&pass=\\\"+ pass + \\\"&project=\\\" + proj ;\\n}\",\n \"function ClickHabilidadeEspecial() {\\n // TODO da pra melhorar.\\n AtualizaGeral();\\n}\",\n \"function o(a){a.click(p).mousedown(ka)}\",\n \"function interaction1() {\\n window.location.href = `https://amdevito.github.io/211/interact/index.html`;\\n}\",\n \"function clickme(){\\n //the message in the pop up\\n\\t\\talert('Hey, you clicked me!');\\n\\t}\",\n \"function onCancelClick() {\\n $.trigger('promptSignature:cancel_signature');\\n}\",\n \"function loginUgyldig() {\\r\\n Aliases.linkAuthorizationLogin.Click();\\r\\n\\r\\n let brukernavn = func.random(15) + \\\"@\\\" + func.random(7) + \\\".com\\\"\\r\\n let passord = func.random(8)\\r\\n loggInn(brukernavn, passord);\\r\\n\\r\\n //Sjekk om feilmelding kommer frem: \\r\\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \\\"Visible\\\", cmpEqual, true);\\r\\n Aliases.linkHttpsTestOptimeraNo.Click();\\r\\n}\",\n \"function lcom_RegOKCompleta(){\\n\\topenFBbox(context_ssi+\\\"boxes/community/login/verifica_ok_nomail.shtml\\\");\\n}\",\n \"function click_sanc()\\r\\n{\\r\\ndocument.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0].click();\\r\\n//click(document.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0]);\\r\\n}\",\n \"function click1()\\n{\\n\\tagreeLink1_valid = true;\\n}\",\n \"handleClick(){\\n var urlBuilder = [];\\n urlBuilder.push('response_type=code', `client_id=${config.google_client_id}`, `redirect_uri=${window.location.origin}/login/callback`, 'scope=profile email');\\n const url = \\\"https://accounts.google.com/o/oauth2/v2/auth?\\\" + urlBuilder.join('&');\\n // Open the popup window\\n window.location.href = url;\\n }\",\n \"function handleClick() {\\n\\t\\tpaymentsClient.loadPaymentData(getRequest()).then(function(paymentData){\\n\\t\\t\\tconst $data = paymentData.paymentMethodData.tokenizationData.token\\n\\t\\t\\tgpaytoken($data);\\n\\n\\t\\t}).catch(function(err){\\n\\t\\t\\tself.hide(err);\\n\\t\\t});\\n\\n\\t}\",\n \"function asignarEventos() {\\n _.click(function() {\\n\\n });\\n}\",\n \"function toSigns() {\\n document.getElementById('keyboardMinus').style.display = \\\"none\\\";\\n document.getElementById('keyboardMayus').style.display = \\\"none\\\";\\n document.getElementById('keyboardNum').style.display = \\\"none\\\";\\n document.getElementById('keyboardSymb').style.display = \\\"block\\\";\\n document.getElementById('keyboardGif').style.display = \\\"none\\\";\\n}\",\n \"function bwClick(itemId) {\\n $(itemId).click();\\n}\",\n \"handleJDotterClick() {}\",\n \"function prim_click(e) {\\n var user = document.querySelector('#select_value').value;\\n browser.runtime.sendMessage({ 'name': 'set_change_card_for_site', 'user': user }, function (response) { });\\n window.close();\\n}\",\n \"async click() {\\n await t.click(selector);\\n }\",\n \"verCartelera(){\\n browser.click('.btn.btnEnviar.btnVerCartelera')\\n }\",\n \"function trackShatnerBoxClick(result) {\\n var s = s_gi(s_account);\\n var txt = 'ShatnerBoxClick_' + result;\\n s.trackExternalLinks = false;\\n s.linkTrackVars = 'prop6,eVar6';\\n s.tl(this, 'o', txt);\\n}\",\n \"function onClickFollow(){\\n if(compname === \\\"\\\"){\\n notification['warning']({\\n message: 'Function Error',\\n description:\\n 'There is no company selected.',\\n });\\n }else{\\n notification['success']({\\n message: 'Operation Success',\\n description:\\n `${compname} has been added to the following list. `,\\n });\\n }\\n }\",\n \"function ClickAdicionarArmadura() {\\n gEntradas.armaduras.push({ chave: 'nenhuma', obra_prima: false, bonus: 0 });\\n AtualizaGeralSemLerEntradas();\\n}\",\n \"clickMyProfileLink() {\\n return this.myProfileLink.click();\\n }\",\n \"click(x, y, _isLeftButton) {}\",\n \"goToGithub() {\\n window.location.href = \\\"https://github.com/kandrupr\\\"\\n }\",\n \"static addClickListenerOnPublisherSignInButton_() {\\n self.document\\n .getElementById(PUBLISHER_SIGN_IN_BUTTON_ID)\\n .addEventListener('click', (e) => {\\n e.preventDefault();\\n\\n callSwg((swg) => swg.triggerLoginRequest({linkRequested: false}));\\n });\\n }\",\n \"function goTo(menuKey) {\\n\\t\\t\\tvar template = SUGGGET_ADPAYMENT;\\n\\t\\t\\tsetArParams(menuKey);\\n\\t\\t\\tsetIdCheckbox(menuKey);\\n\\t\\t\\tsetApParams(menuKey);\\n\\t\\t\\tpostal.publish({\\n\\t\\t\\t\\tchannel: \\\"Tab\\\",\\n\\t\\t\\t\\ttopic: \\\"open\\\",\\n\\t\\t\\t\\tdata: template\\n\\t\\t\\t});\\n\\t\\t}\",\n \"function clickHandler(e) {\\n // Nur bei Linksklick\\n if (e.button !== 0) return;\\n clickAt(e.offsetX, e.offsetY);\\n }\",\n \"function logClick() {\\n ReactGA.event({\\n category: 'Registration',\\n action: 'Clicked Register Today',\\n label: 'Challenge Text link',\\n });\\n}\",\n \"function simulateclick(){\\n\\tdocument.getElementById('imagefiles').click();\\n}\",\n \"function openSignUp() {\\n\\tif (validateEmail()) {\\n\\t\\tvar url = '/' + channel + '/Content.ice?page=Sign-Up-For-Fashion-News&pgForward=popup' + '&email=' + document.getElementById('email').value;\\n open(url,'SignupForFashionNews','width=700,height=500');\\n var tmp = open(url,'SignupForFashionNews','width=700,height=500');\\n\\t\\ttmp.focus();\\n\\t}\\n\\treturn false;\\n}\",\n \"click() { // add click event\\n app.quit();\\n }\",\n \"function handleAuthClick() {\\n\\tgapi.auth2.getAuthInstance().signIn().catch((ignore) => {});\\n}\",\n \"function handleAuthClick(event) {\\n gapi.auth2.getAuthInstance().signIn();\\n }\",\n \"clickLoginButton() {\\n this.loginButton.click();\\n }\",\n \"function clicksubmitskill(e) {\\n if (e.keyCode == 13) {\\n document.getElementById(\\\"submitskill\\\").click();\\n return false;\\n }\\n return true;\\n }\",\n \"function click2()\\n{\\n\\tagreeLink2_valid = true;\\n}\",\n \"function TakeLoginAction(e) {\\n\\n var enterkeyPressed = IsEnterKeyPressed(e);\\n\\n if (enterkeyPressed) {\\n\\n if (window.event) {\\n event.returnValue = false;\\n event.cancel = true;\\n }\\n else {\\n e.returnValue = false;\\n e.cancel = true;\\n }\\n\\n var actionButton = GetActionButton(\\\"logonButton\\\");\\n\\n if (actionButton != null) {\\n actionButton.click();\\n }\\n }\\n}\",\n \"function ClickGerarResumo() {\\n AtualizaGeral(); // garante o preenchimento do personagem com tudo que ta na planilha.\\n var input = Dom(\\\"resumo-personagem-2\\\");\\n input.value = GeraResumo();\\n input.focus();\\n input.select();\\n}\",\n \"function click(el) {\\n var ev = document.createEvent('MouseEvent');\\n ev.initMouseEvent(\\n 'click',\\n true /* bubble */, true /* cancelable */,\\n window, null,\\n 0, 0, 0, 0, /* coordinates */\\n false, false, false, false, /* modifier keys */\\n 0 /*left*/, null\\n );\\n el.dispatchEvent(ev);\\n }\",\n \"function handleAuthClick(event) {\\r\\n gapi.auth2.getAuthInstance().signIn();\\r\\n}\",\n \"function handleAuthClick(event) {\\r\\n gapi.auth2.getAuthInstance().signIn();\\r\\n}\",\n \"clickCheckOutGreenTea() {\\n this.clickElem(this.btnCheckOutGreenTea);\\n }\",\n \"function keywordsMsg(e)\\n{\\n var event = e || window.event;\\n if(event.keyCode == 13)\\n {\\n $('#send').click(); \\n }\\n}\",\n \"async cookieClicker() {\\n let isPresent = await this.cookieButtonElement.isPresent();\\n if (isPresent) {\\n await this.cookieButtonElement.click();\\n }\\n }\",\n \"function click(el){\\n var ev = document.createEvent('MouseEvent');\\n ev.initMouseEvent(\\n 'click',\\n true, true,\\n window, null,\\n 0, 0, 0, 0,\\n false, false, false, false,\\n 0, null\\n );\\n el.dispatchEvent(ev);\\n}\",\n \"function done(){\\n iframes[0].querySelector(\\\"#InlineEditDialog_buttons > input:nth-child(1)\\\").click()\\n }\",\n \"function click(e) {\\r\\n\\t\\tif(!e && typeof e=='string') e=document.getElementById(e);\\r\\n\\t\\tif(!e) return;\\r\\n\\t\\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\\r\\n\\t\\tevObj.initMouseEvent(\\\"click\\\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\\r\\n\\t\\te.dispatchEvent(evObj);\\r\\n\\t}\",\n \"function click(e) {\\r\\n\\t\\tif(!e && typeof e=='string') e=document.getElementById(e);\\r\\n\\t\\tif(!e) return;\\r\\n\\t\\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\\r\\n\\t\\tevObj.initMouseEvent(\\\"click\\\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\\r\\n\\t\\te.dispatchEvent(evObj);\\r\\n\\t}\",\n \"function handleAuthClick(event) {\\n\\tgapi.auth2.getAuthInstance().signIn();\\n}\",\n \"function handleAuthClick(event) {\\n\\tgapi.auth2.getAuthInstance().signIn();\\n}\",\n \"function clickButtonEl(key) {\\n numbersEl.forEach((button) => {\\n if (button.innerText === key) {\\n button.click();\\n }\\n });\\n}\",\n \"function signCon() {\\n\\t$(\\\"#sps\\\").click( function() {\\n\\t\\t$(\\\"#signup\\\").slideToggle();\\n\\t})\\n\\t$(\\\"#spc\\\").click( function() {\\n\\t\\t$(\\\"#settingsBox\\\").slideToggle();\\n\\t})\\n\\t$(\\\"#contactMeButton\\\").click( function() {\\n\\t\\t$(\\\"#contactme\\\").slideToggle();\\n\\t})\\n}\",\n \"function onCallForwardingAutoPopupOkBtnClick() {\\r\\n callForwardingAutoToggleSwitch.click();\\r\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.63308024","0.6325274","0.59800106","0.5818107","0.5774368","0.5710783","0.57096374","0.5677159","0.567587","0.5666399","0.5660508","0.56503785","0.56413054","0.5638463","0.55988306","0.5586199","0.55725545","0.5566793","0.553986","0.55269295","0.5509403","0.55068874","0.54900956","0.5474483","0.54682106","0.5459994","0.54569554","0.54367834","0.54134107","0.5409913","0.5408414","0.5406675","0.54039973","0.5396695","0.5395361","0.53876543","0.53832656","0.5379943","0.53703994","0.53687024","0.5359421","0.5353413","0.5348026","0.53460854","0.5339658","0.5333531","0.53269124","0.5323306","0.53179044","0.53137565","0.53117764","0.53113395","0.5308042","0.53022575","0.52863246","0.5285958","0.5284779","0.5279279","0.527756","0.52730554","0.5266057","0.5256763","0.5249958","0.52480716","0.5247977","0.5241694","0.5240843","0.52374166","0.5236948","0.5236922","0.5234914","0.522757","0.52225536","0.5220033","0.5220012","0.52151877","0.52144265","0.5200432","0.51979256","0.51945335","0.5193316","0.5190369","0.518967","0.51881045","0.51875114","0.51820844","0.5181772","0.5180902","0.5175787","0.51753527","0.5174047","0.51733947","0.51687264","0.5166905","0.5166905","0.5166553","0.5166553","0.5165698","0.51600856","0.515703"],"string":"[\n \"0.63308024\",\n \"0.6325274\",\n \"0.59800106\",\n \"0.5818107\",\n \"0.5774368\",\n \"0.5710783\",\n \"0.57096374\",\n \"0.5677159\",\n \"0.567587\",\n \"0.5666399\",\n \"0.5660508\",\n \"0.56503785\",\n \"0.56413054\",\n \"0.5638463\",\n \"0.55988306\",\n \"0.5586199\",\n \"0.55725545\",\n \"0.5566793\",\n \"0.553986\",\n \"0.55269295\",\n \"0.5509403\",\n \"0.55068874\",\n \"0.54900956\",\n \"0.5474483\",\n \"0.54682106\",\n \"0.5459994\",\n \"0.54569554\",\n \"0.54367834\",\n \"0.54134107\",\n \"0.5409913\",\n \"0.5408414\",\n \"0.5406675\",\n \"0.54039973\",\n \"0.5396695\",\n \"0.5395361\",\n \"0.53876543\",\n \"0.53832656\",\n \"0.5379943\",\n \"0.53703994\",\n \"0.53687024\",\n \"0.5359421\",\n \"0.5353413\",\n \"0.5348026\",\n \"0.53460854\",\n \"0.5339658\",\n \"0.5333531\",\n \"0.53269124\",\n \"0.5323306\",\n \"0.53179044\",\n \"0.53137565\",\n \"0.53117764\",\n \"0.53113395\",\n \"0.5308042\",\n \"0.53022575\",\n \"0.52863246\",\n \"0.5285958\",\n \"0.5284779\",\n \"0.5279279\",\n \"0.527756\",\n \"0.52730554\",\n \"0.5266057\",\n \"0.5256763\",\n \"0.5249958\",\n \"0.52480716\",\n \"0.5247977\",\n \"0.5241694\",\n \"0.5240843\",\n \"0.52374166\",\n \"0.5236948\",\n \"0.5236922\",\n \"0.5234914\",\n \"0.522757\",\n \"0.52225536\",\n \"0.5220033\",\n \"0.5220012\",\n \"0.52151877\",\n \"0.52144265\",\n \"0.5200432\",\n \"0.51979256\",\n \"0.51945335\",\n \"0.5193316\",\n \"0.5190369\",\n \"0.518967\",\n \"0.51881045\",\n \"0.51875114\",\n \"0.51820844\",\n \"0.5181772\",\n \"0.5180902\",\n \"0.5175787\",\n \"0.51753527\",\n \"0.5174047\",\n \"0.51733947\",\n \"0.51687264\",\n \"0.5166905\",\n \"0.5166905\",\n \"0.5166553\",\n \"0.5166553\",\n \"0.5165698\",\n \"0.51600856\",\n \"0.515703\"\n]"},"document_score":{"kind":"string","value":"0.534272"},"document_rank":{"kind":"string","value":"44"}}},{"rowIdx":39,"cells":{"query":{"kind":"string","value":"=============================================>>>>> = MEDIA QUERIES = ===============================================>>>>>"},"document":{"kind":"string","value":"function handleWidthChange(mqlVal) {\n\t\t\tif (mqlVal.matches) {\n\n\t\t\t\t$navLinks.off('click');\n\t\t\t\t$('.btn-section').off('click');\n\n\t\t\t\t$navLinks.on('click', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar target = $(this).attr('href'),\n\t\t\t\t\t\ttargetOffset = $(target).offset();\n\t\t\t\t\t$(this).parent().addClass('active').siblings().removeClass('active');\n\t\t\t\t\t$('html,body').animate({scrollTop: (targetOffset.top)}, 500);\n\t\t\t\t\t$('.nav-main').removeClass('active');\n\t\t\t\t\t$('.hamburger').removeClass('is-active');\n\t\t\t\t});\n\n\t\t\t\t/*=============================================>>>>>\n\t\t\t\t= REMOVE CUSTOM SCROLLBAR =\n\t\t\t\t===============================================>>>>>*/\n\t\t\t\t$('.section-block-content').mCustomScrollbar('destroy');\n\n\t\t\t} else {\n\n\t\t\t\t$navLinks.off('click');\n\n\t\t\t\tcheckUrlHash();\n\n $('.section-main-block, .section-secondary-block').addClass('animated');\n\n\t\t\t\t$('.section-secondary-block-right').on(animationEnd, function(e) {\n\t\t\t\t\tif ($(e.target).parent().hasClass('section-out') && $(e.target).hasClass('section-secondary-block-right')) {\n\t\t\t\t\t\tconsole.log('Section \"' + $(e.target).parent().attr('id') + '\" out.' );\n\t\t\t\t\t\t$(e.target).parents('.section').removeClass('section-out');\n\t\t\t\t\t\t$(e.target).removeClass(sectionOutAnimation).siblings('.section-secondary-b').removeClass(sectionOutAnimation);\n\t\t\t\t\t} else if ($(e.target).parent().hasClass('section-in') && $(e.target).hasClass('section-secondary-block-right')) {\n\t\t\t\t\t\tconsole.log('Section \"' + $(e.target).parent().attr('id') + '\" in.' );\n\t\t\t\t\t\tisAnimating = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$navLinks.on('click', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tchangeSections(e);\n\t\t\t\t});\n\t\t\t\t$('.btn-section').on('click', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tchangeSections(e);\n\t\t\t\t});\n\n\t\t\t\t/*=============================================>>>>>\n\t\t\t\t= INIT CUSTOM SCROLLBAR =\n\t\t\t\t===============================================>>>>>*/\n\t\t\t\t$('.section-block-content').mCustomScrollbar({\n\t\t\t\t\ttheme: 'flipcard',\n\t\t\t\t\tscrollInertia: 100\n\t\t\t\t});\n\n\t\t\t}\n\t\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":["async getMediaItems(albumID){\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n \"pageSize\":\"100\",\n \"albumId\": albumID\n })\n }\n response = await this.APIHandler.sendRequest(data);\n return response.mediaItems\n }","function MediaByTag() {\r\n\tvar caption;\r\n\tvar link;\r\n\tvar tags;\r\n\tvar comments;\r\n\tvar likes;\r\n\tvar imageUrls;\r\n\tvar userInfo;\r\n}","function getMediaByIds(ids) {\n return $.post('/api/media/ids', { media: { ids } });\n }","function queryPictures(req) {\n\n let query = Picture.find();\n\n if (typeof (req.query.src) == 'string') {\n query = query.where('src').equals(req.query.src);\n }\n\n if (typeof (req.query.description) == 'string') {\n query = query.where('description').equals(req.query.description);\n }\n\n return query;\n}","async function getMedia() {\n if (!username) return;\n const resp = await fetch(`https://www.instagram.com/${username}/?__a=1`);\n const { graphql } = await resp.json();\n setImages(\n graphql.user.edge_owner_to_timeline_media.edges.map(\n ({ node }) => node.thumbnail_resources\n )\n );\n }","async function FindMediaItems(options = [], button) {\n\t\tif(!(options.length && button))\n\t\t\treturn;\n\n\t\t/* Get rid of repeats */\n\t\tlet uuids = [];\n\n\t\toptions = options.map((v, i, a) => {\n\t\t\tlet { type, title } = v,\n\t\t\t\tuuid = UUID.from({ type, title });\n\n\t\t\tif(!!~uuids.indexOf(uuid))\n\t\t\t\treturn options.splice(i, 1), null;\n\t\t\tuuids.push(uuid);\n\n\t\t\treturn v;\n\t\t})\n\t\t.filter(v => v);\n\n\t\tlet results = [],\n\t\t\tlength = options.length,\n\t\t\tqueries = (FindMediaItems.queries = FindMediaItems.queries || {});\n\n\t\tFindMediaItems.OPTIONS = options;\n\n\t\tlet query = JSON.stringify(options);\n\n\t\tquery = (queries[query] = queries[query] || {});\n\n\t\tif(query.running === true)\n\t\t\treturn;\n\t\telse if(query.results) {\n\t\t\tlet { results, multiple, items } = query;\n\n\t\t\tnew Notification('update', `Welcome back. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\n\n\t\t\tif(multiple)\n\t\t\t\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\n\n\t\t\treturn;\n\t\t}\n\n\t\tquery.running = true;\n\n\t\tnew Notification('info', `Processing ${ length } item${ 's'[+(length === 1)] || '' }...`);\n\n\t\tfor(let index = 0, option, opt; index < length; index++) {\n\t\t\tlet { IMDbID, TMDbID, TVDbID } = (option = await options[index]);\n\n\t\t\topt = { name: option.title, title: option.title, year: option.year, image: options.image, type: option.type, imdb: IMDbID, IMDbID, tmdb: TMDbID, TMDbID, tvdb: TVDbID, TVDbID };\n\n\t\t\ttry {\n\t\t\t\tawait Request_Plex(option)\n\t\t\t\t\t.then(async({ found, key }) => {\n\t\t\t\t\t\tlet { imdb, tmdb, tvdb } = opt,\n\t\t\t\t\t\t\t{ type, title, year } = opt,\n\t\t\t\t\t\t\tuuid = UUID.from({ type, title });\n\n\t\t\t\t\t\tif(found) {\n\t\t\t\t\t\t\t// ignore found items, we only want new items\n\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toption.field = 'original_title';\n\n\t\t\t\t\t\t\treturn await Request_Plex(option)\n\t\t\t\t\t\t\t\t.then(({ found, key }) => {\n\t\t\t\t\t\t\t\t\tif(found) {\n\t\t\t\t\t\t\t\t\t\t// ignore found items, we only want new items\n\t\t\t\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\n\t\t\t\t\t\t\t\t\t} else if(CAUGHT.has({ imdb, tmdb, tvdb })) {\n\t\t\t\t\t\t\t\t\t\t// ignore items already being watched\n\t\t\t\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'queued')\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlet available = (__CONFIG__.usingOmbi || __CONFIG__.usingWatcher || __CONFIG__.usingRadarr || __CONFIG__.usingSonarr || __CONFIG__.usingMedusa || __CONFIG__.usingSickBeard || __CONFIG__.usingCouchPotato),\n\t\t\t\t\t\t\t\t\t\t\taction = (available? 'download': 'notfound'),\n\t\t\t\t\t\t\t\t\t\t\ttitle = available?\n\t\t\t\t\t\t\t\t\t\t\t\t'Not on Plex (download available)':\n\t\t\t\t\t\t\t\t\t\t\t'Not on Plex (download not available)';\n\n\t\t\t\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, (available? 'download': 'not-found'));\n\t\t\t\t\t\t\t\t\t\tresults.push({ ...opt, found: false, status: action });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => { throw error });\n\t\t\t} catch(error) {\n\t\t\t\tUTILS_TERMINAL.error('Request to Plex failed: ' + String(error));\n\t\t\t\t// new Notification('error', 'Failed to query item #' + (index + 1));\n\t\t\t}\n\t\t}\n\n\t\tresults = results.filter(v => v.status == 'download');\n\n\t\tlet img = furnish('img#plexit-add', { title: 'Add to Plex It!', onmouseup: event => {let frame = document.querySelector('#plexit-bookmarklet-frame'); frame.src = frame.src.replace(/(#plexit:.*)?$/, '#plexit:' + event.target.parentElement.getAttribute('data'))} }),\n\t\t\tpo, pi = furnish('li#plexit.list-item', { data: encode(JSON.stringify(results)) }, img),\n\t\t\top = document.querySelector('#wtp-plexit');\n\n\t\tif(po = button.querySelector('#plexit'))\n\t\t\tpo.remove();\n\t\ttry {\n\t\t\tbutton.querySelector('ul').insertBefore(pi, op);\n\t\t} catch(e) { /* Don't do anything */ }\n\n\t\tlet multiple = results.length,\n\t\t\titems = multiple == 1? 'item': 'items';\n\n\t\tnew Notification('update', `Done. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\n\n\t\tquery.running = false;\n\t\tquery.results = results;\n\t\tquery.multiple = multiple;\n\t\tquery.items = items;\n\n\t\tif(multiple)\n\t\t\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\n\t}","function uploadMusic() {\n //returns array of music available for ringtone after reading from file, is used for \"tones\" array\n}","function mediaQueryListDispatcher() {\n\t\tthis.mqls = [];\n\t}","function myMedia(req, res) {\n return _media2.default.find({ 'uid': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\n}","async function _loadMedia() {\n\n var data = await fetch('/content/media.json');\n var json = await data.json();\n\n json.forEach((file) => {\n media.push(file);\n });\n\n _buildTable();\n tableUIUpdate();\n\n }","processUploadImages(uploadData){\n mediaItems = []\n for (i = 0; i < uploadData.length; i ++){\n mediaItems.push({\n \"description\": uploadData[i].description,\n \"simpleMediaItem\": {\n \"uploadToken\": uploadData[i].uploadToken\n }\n })\n }\n return mediaItems\n }","function deduplicteMediaItems() {\n\n}","function getMedia(user) {\n userId = user || \"\";\n if (userId) {\n userId = \"/?userId=\" + userId;\n }\n $.get(\"/api/posts\" + authorId, function(data) {\n console.log(\"Posts\", data);\n saved = data;\n if (!posts || !posts.length) {\n displayEmpty(user);\n }\n else {\n initializeRows();\n }\n });\n }","function searchMusic(name){\n if(!name){\n name = \"The sigin\";\n }\n spotify.search({ type: 'track', query: name }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n for (var i = 0; i < 5; i++) {\n console.log(\"Artist Name: \"+data.tracks.items[i].artist[0].name); \n console.log(\"Song name: \"+data.tracks.items[i].name);\n console.log(\"Link: \"+data.tracks.items[i].album.name);\n console.log(\"Album\"+data.tracks.items[i].preview_url);\n console.log(\"-------------------------------------\");\n }\n });\n}","function loadMedia(location, queries, manage, final) {\n\n // Recursive function\n function nextMedia(i) {\n\n // From queries object to array, in order to use $.when()\n var indices = []; // Keeps track of which number corresponds with which key\n var queriesArr = []; // Array of the queries\n var j = 0; // Index\n for(var q in queries) {\n indices.push(q);\n // Make a shallow copy of queries[q], so it's unaffected for next iteration\n queriesArr.push($.extend({}, queries[q]));\n // Important! Add the absolute path of the file to the query as a prefix!\n queriesArr[j].url = location + i.toString() + '/' + queriesArr[j].url;\n // Replace query data by actual jqXHR object\n queriesArr[j] = $.ajax(queriesArr[j]);\n j++;\n }\n\n // When all the queries are completed...\n $.when(...queriesArr).done(function(...resultsArr) {\n\n // Back from array to object\n var results = {};\n for(var j = 0; j < resultsArr.length; j++) {\n results[indices[j]] = resultsArr[j];\n }\n\n // Call to manager function with processed data\n manage(location, results, i);\n\n nextMedia(i + 1); // Keep going\n\n }).fail(final); // Call after everything is done\n\n } // nextMedia(i)\n\n nextMedia(0); // Initial call\n\n}","function execute() {\n return gapi.client.photoslibrary.mediaItems.list({}).then(\n function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n },\n function(err) {\n console.error(\"Execute error\", err);\n }\n );\n}","function mediaLocStorage() {\n // assign media object to a variable\n var mediaObj = memory.media,\n // create an empty object\n mediaLinks = {};\n // loop through media object\n for (var i = 0; i < mediaObj.length; i++) {\n\n if (mediaLinks[mediaObj[i].post] == mediaObj.post) {\n // assign object keys and values\n // \"the key will be the post id, and the value will be the image link\"\n mediaLinks[mediaObj[i].post] = mediaObj[i].source_url;\n }\n }\n // save the object in local storage\n storage.write('postImg', mediaLinks);\n }","images() {\n // console.log('thumbnails helper');\n return Images.find({\n thumbnail: { $exists: 1 },\n // subscriptionId: ThumbnailsHandle.subscriptionId,\n }, {\n limit: ImagesPerPage,\n sort: { created: -1 }\n });\n }","function list( url, requestArguments ) {\n\t\t\tvar getter = {},\n\t\t\t\taction = {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\ttransformResponse: function( data ) {\n\t\t\t\t\t\treturn convertJsonToObj( data );\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t// Setup API $resource\n\t\t\tgetter.api = apiService.request( url, { 'get': action } );\n\n\t\t\t// Add Wistia authentication to the request arguments\n\t\t\tangular.merge( requestArguments, apiKey );\n\n\t\t\t// Make request to list media\n\t\t\tgetter.request = getter.api.get( requestArguments ).$promise.then(\n\n\t\t\t\t// SUCCESS\n\t\t\t\tfunction( response ) {\n\t\t\t\t\tvar eventArgs = {\n\t\t\t\t\t\tuploads: {}\n\t\t\t\t\t};\n\n\t\t\t\t\t// Received list successfully (account for $promise and $resolved objects)\n\t\t\t\t\tif ( response && Object.keys( response ).length > 2 ) {\n\t\t\t\t\t\tconsole.log( 'Successfully received the list of media' );\n\n\t\t\t\t\t\teventArgs.uploads = response;\n\t\t\t\t\t\tdelete eventArgs.uploads.$promise;\n\t\t\t\t\t\tdelete eventArgs.uploads.$resolved;\n\n\t\t\t\t\t\t$rootScope.$emit( 'videoListReturned', eventArgs );\n\n\t\t\t\t\t// Could not receive list\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn( 'Could not receive list.', response );\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// FAILURE\n\t\t\t\tfunction( error ) {\n\t\t\t\t\tconsole.error( error.data );\n\t\t\t\t}\n\t\t\t);\n\t\t}","function getNodeMediaItems(title, commonLocation, eventId, eventHtml) {\n var url = 'http://localhost:8001/search/combined/';\n url += encodeURIComponent(title + ' ' + commonLocation);\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n requestReceived();\n if (xhr.status == 200) {\n var data = JSON.parse(xhr.responseText);\n retrieveNodeMediaItemsResults(data, eventId, eventHtml);\n } else {\n console.log('Error: Getting media items for the query failed.');\n }\n }\n }\n xhr.open('GET', url, true);\n xhr.send();\n requestSent();\n}","function mediaList(req,res,template,block,next) { \n \n // Render the item via the template provided above\n calipso.theme.renderItem(req,res,template,block,{}); \n next();\n \n}","function populateStorages(storageModels) {\n var queues = [],\n response = $q.defer(),\n results = _.where(storageModels, {type: 'areaimage'});\n\n // $scope.AreaImages = _.where(storageModels, {type: 'areaimage'});\n\n _.each(results, function(image){\n //populateImage(image);\n queues.push(Storage.GetFileImageString(image.id));\n });\n\n $q.all(queues)\n .then(function(images){\n _.each(results, function(image, i){\n image.data = images[i];\n });\n return response.resolve(results);\n\n },\n function(error){\n return response.reject(error);\n });\n return response.promise;\n /*\n $scope.Signature = _.where(storageModels, {type: 'signature'})[0];\n\n if ($scope.Signature && $scope.Signature.id.length === 36) {\n populateImage($scope.Signature);\n }*/\n\n }","function getMediasFiles(path, cb) {\n var medias = {};\n glob(path, function (err, files) {\n files.forEach(function (filename) {\n var infos = pathinfo(filename);\n medias[infos.basename.toUpperCase()] = {\n filename: filename,\n products: []\n };\n });\n cb(medias);\n })\n }","function queryMediaInfo(paramData) {\n let url = jjkgalleryRoot + \"getMediaInfo.php\"\n fetch(url, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(paramData)\n })\n .then(response => response.json())\n .then(responseMediaInfo => {\n // Save media information in a variable in a module (that can be imported into other modules)\n loadMediaInfo(responseMediaInfo)\n\n getMenu = paramData.getMenu\n if (getMenu) {\n // Save the menu lists\n setMenuList(mediaInfo.menuList)\n categoryList = mediaInfo.categoryList\n menuFilter = mediaInfo.menuFilter\n setAlbumList(mediaInfo.albumList)\n peopleList = mediaInfo.peopleList\n }\n\n // Save the parameters from the laste query\n queryCategory = paramData.MediaFilterCategory\n querySearchStr = \"\"\n if (paramData.MediaFilterSearchStr != null && paramData.MediaFilterSearchStr != \"\") {\n querySearchStr = paramData.MediaFilterSearchStr\n }\n queryMenuItem = \"\"\n if (paramData.MediaFilterMenuItem != null & paramData.MediaFilterMenuItem != \"\") {\n queryMenuItem = paramData.MediaFilterMenuItem\n }\n\n createMediaPage()\n });\n }","function paintMedias(){\n $.couch.urlPrefix = \"https://socpa.cloudant.com\";\n $.couch.login({\n name: \"socpa\",\n password: \"asdargonnijao\",\n success: function(data) {\n console.log(data);\n\n },\n error: function(status) {\n console.log(status);\n }\n });\n\n $.couch.db(\"media\").view(\"media/media\", {\n startkey: [canvas_id],\n endkey: [canvas_id,{}],\n reduce: false,\n success: function(data) {\n setMedia(data.rows,0)\n },\n error: function(status) {\n console.log(status);\n }\n\n });\n}","function AppMeasurement_Module_Media(q) {\n var b = this;\n b.s = q;\n q = window;\n q.s_c_in || (q.s_c_il = [], q.s_c_in = 0);\n b._il = q.s_c_il;\n b._in = q.s_c_in;\n b._il[b._in] = b;\n q.s_c_in++;\n b._c = \"s_m\";\n b.list = [];\n b.open = function (d, c, e, k) {\n var f = {},\n a = new Date,\n l = \"\",\n g;\n c || (c = -1);\n if (d && e) {\n b.list || (b.list = {});\n b.list[d] && b.close(d);\n k && k.id && (l = k.id);\n if (l)\n for (g in b.list) !Object.prototype[g] && b.list[g] && b.list[g].R == l && b.close(b.list[g].name);\n f.name = d;\n f.length = c;\n f.offset = 0;\n f.e = 0;\n f.playerName = b.playerName ? b.playerName : e;\n f.R = l;\n f.C = 0;\n f.a = 0;\n f.timestamp =\n Math.floor(a.getTime() / 1E3);\n f.k = 0;\n f.u = f.timestamp;\n f.c = -1;\n f.n = \"\";\n f.g = -1;\n f.D = 0;\n f.I = {};\n f.G = 0;\n f.m = 0;\n f.f = \"\";\n f.B = 0;\n f.L = 0;\n f.A = 0;\n f.F = 0;\n f.l = !1;\n f.v = \"\";\n f.J = \"\";\n f.K = 0;\n f.r = !1;\n f.H = \"\";\n f.complete = 0;\n f.Q = 0;\n f.p = 0;\n f.q = 0;\n b.list[d] = f;\n }\n };\n b.openAd = function (d, c, e, k, f, a, l, g) {\n var h = {};\n b.open(d, c, e, g);\n if (h = b.list[d]) h.l = !0, h.v = k, h.J = f, h.K = a, h.H = l;\n };\n b.M = function (d) {\n var c = b.list[d];\n b.list[d] = 0;\n c && c.monitor && clearTimeout(c.monitor.interval);\n };\n b.close = function (d) {\n b.i(d, 0, -1);\n };\n b.play = function (d, c, e, k) {\n var f = b.i(d, 1, c, e, k);\n f && !f.monitor &&\n (f.monitor = {}, f.monitor.update = function () {\n 1 == f.k && b.i(f.name, 3, -1);\n f.monitor.interval = setTimeout(f.monitor.update, 1E3);\n }, f.monitor.update());\n };\n b.click = function (d, c) {\n b.i(d, 7, c);\n };\n b.complete = function (d, c) {\n b.i(d, 5, c);\n };\n b.stop = function (d, c) {\n b.i(d, 2, c);\n };\n b.track = function (d) {\n b.i(d, 4, -1);\n };\n b.P = function (d, c) {\n var e = \"a.media.\",\n k = d.linkTrackVars,\n f = d.linkTrackEvents,\n a = \"m_i\",\n l, g = d.contextData,\n h;\n c.l && (e += \"ad.\", c.v && (g[\"a.media.name\"] = c.v, g[e + \"pod\"] = c.J, g[e + \"podPosition\"] = c.K), c.G || (g[e + \"CPM\"] = c.H));\n c.r && (g[e + \"clicked\"] = !0, c.r = !1);\n g[\"a.contentType\"] = \"video\" + (c.l ? \"Ad\" : \"\");\n g[\"a.media.channel\"] = b.channel;\n g[e + \"name\"] = c.name;\n g[e + \"playerName\"] = c.playerName;\n 0 < c.length && (g[e + \"length\"] = c.length);\n g[e + \"timePlayed\"] = Math.floor(c.a);\n 0 < Math.floor(c.a) && (g[e + \"timePlayed\"] = Math.floor(c.a));\n c.G || (g[e + \"view\"] = !0, a = \"m_s\", b.Heartbeat && b.Heartbeat.enabled && (a = c.l ? b.__primetime ? \"mspa_s\" : \"msa_s\" : b.__primetime ? \"msp_s\" : \"ms_s\"), c.G = 1);\n c.f && (g[e + \"segmentNum\"] = c.m, g[e + \"segment\"] = c.f, 0 < c.B && (g[e + \"segmentLength\"] = c.B), c.A && 0 < c.a && (g[e + \"segmentView\"] = !0));\n !c.Q && c.complete && (g[e + \"complete\"] = !0, c.S = 1);\n 0 < c.p && (g[e + \"milestone\"] = c.p);\n 0 < c.q && (g[e + \"offsetMilestone\"] = c.q);\n if (k)\n for (h in g) Object.prototype[h] || (k += \",contextData.\" + h);\n l = g[\"a.contentType\"];\n d.pe = a;\n d.pev3 = l;\n var q, s;\n if (b.contextDataMapping)\n for (h in d.events2 || (d.events2 = \"\"), k && (k += \",events\"), b.contextDataMapping)\n if (!Object.prototype[h]) {\n a = h.length > e.length && h.substring(0, e.length) == e ? h.substring(e.length) : \"\";\n l = b.contextDataMapping[h];\n if (\"string\" == typeof l)\n for (q = l.split(\",\"), s = 0; s < q.length; s++) l =\n q[s], \"a.contentType\" == h ? (k && (k += \",\" + l), d[l] = g[h]) : \"view\" == a || \"segmentView\" == a || \"clicked\" == a || \"complete\" == a || \"timePlayed\" == a || \"CPM\" == a ? (f && (f += \",\" + l), \"timePlayed\" == a || \"CPM\" == a ? g[h] && (d.events2 += (d.events2 ? \",\" : \"\") + l + \"=\" + g[h]) : g[h] && (d.events2 += (d.events2 ? \",\" : \"\") + l)) : \"segment\" == a && g[h + \"Num\"] ? (k && (k += \",\" + l), d[l] = g[h + \"Num\"] + \":\" + g[h]) : (k && (k += \",\" + l), d[l] = g[h]);\n else if (\"milestones\" == a || \"offsetMilestones\" == a) h = h.substring(0, h.length - 1), g[h] && b.contextDataMapping[h + \"s\"][g[h]] && (f && (f += \",\" + b.contextDataMapping[h +\n \"s\"][g[h]]), d.events2 += (d.events2 ? \",\" : \"\") + b.contextDataMapping[h + \"s\"][g[h]]);\n g[h] && (g[h] = 0);\n \"segment\" == a && g[h + \"Num\"] && (g[h + \"Num\"] = 0);\n }\n d.linkTrackVars = k;\n d.linkTrackEvents = f;\n };\n b.i = function (d, c, e, k, f) {\n var a = {},\n l = (new Date).getTime() / 1E3,\n g, h, q = b.trackVars,\n s = b.trackEvents,\n t = b.trackSeconds,\n u = b.trackMilestones,\n v = b.trackOffsetMilestones,\n w = b.segmentByMilestones,\n x = b.segmentByOffsetMilestones,\n p, n, r = 1,\n m = {},\n y;\n b.channel || (b.channel = b.s.w.location.hostname);\n if (a = d && b.list && b.list[d] ? b.list[d] : 0)\n if (a.l && (t = b.adTrackSeconds,\n u = b.adTrackMilestones, v = b.adTrackOffsetMilestones, w = b.adSegmentByMilestones, x = b.adSegmentByOffsetMilestones), 0 > e && (e = 1 == a.k && 0 < a.u ? l - a.u + a.c : a.c), 0 < a.length && (e = e < a.length ? e : a.length), 0 > e && (e = 0), a.offset = e, 0 < a.length && (a.e = a.offset / a.length * 100, a.e = 100 < a.e ? 100 : a.e), 0 > a.c && (a.c = e), y = a.D, m.name = d, m.ad = a.l, m.length = a.length, m.openTime = new Date, m.openTime.setTime(1E3 * a.timestamp), m.offset = a.offset, m.percent = a.e, m.playerName = a.playerName, m.mediaEvent = 0 > a.g ? \"OPEN\" : 1 == c ? \"PLAY\" : 2 == c ? \"STOP\" : 3 == c ? \"MONITOR\" :\n 4 == c ? \"TRACK\" : 5 == c ? \"COMPLETE\" : 7 == c ? \"CLICK\" : \"CLOSE\", 2 < c || c != a.k && (2 != c || 1 == a.k)) {\n f || (k = a.m, f = a.f);\n if (c) {\n 1 == c && (a.c = e);\n if ((3 >= c || 5 <= c) && 0 <= a.g && (r = !1, q = s = \"None\", a.g != e)) {\n h = a.g;\n h > e && (h = a.c, h > e && (h = e));\n p = u ? u.split(\",\") : 0;\n if (0 < a.length && p && e >= h)\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\"\" + p[n]) : 0) && h / a.length * 100 < g && a.e >= g && (r = !0, n = p.length, m.mediaEvent = \"MILESTONE\", a.p = m.milestone = g);\n if ((p = v ? v.split(\",\") : 0) && e >= h)\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\"\" + p[n]) : 0) && h < g && e >= g && (r = !0, n = p.length, m.mediaEvent =\n \"OFFSET_MILESTONE\", a.q = m.offsetMilestone = g);\n }\n if (a.L || !f) {\n if (w && u && 0 < a.length) {\n if (p = u.split(\",\"))\n for (p.push(\"100\"), n = h = 0; n < p.length; n++)\n if (g = p[n] ? parseFloat(\"\" + p[n]) : 0) a.e < g && (k = n + 1, f = \"M:\" + h + \"-\" + g, n = p.length), h = g;\n } else if (x && v && (p = v.split(\",\")))\n for (p.push(\"\" + (0 < a.length ? a.length : \"E\")), n = h = 0; n < p.length; n++)\n if ((g = p[n] ? parseFloat(\"\" + p[n]) : 0) || \"E\" == p[n]) {\n if (e < g || \"E\" == p[n]) k = n + 1, f = \"O:\" + h + \"-\" + g, n = p.length;\n h = g;\n }\n f && (a.L = !0);\n } (f || a.f) && f != a.f && (a.F = !0, a.f || (a.m = k, a.f = f), 0 <= a.g && (r = !0));\n (2 <= c || 100 <= a.e) && a.c < e &&\n (a.C += e - a.c, a.a += e - a.c);\n if (2 >= c || 3 == c && !a.k) a.n += (1 == c || 3 == c ? \"S\" : \"E\") + Math.floor(e), a.k = 3 == c ? 1 : c;\n !r && 0 <= a.g && 3 >= c && (t = t ? t : 0) && a.a >= t && (r = !0, m.mediaEvent = \"SECONDS\");\n a.u = l;\n a.c = e;\n }\n if (!c || 3 >= c && 100 <= a.e) 2 != a.k && (a.n += \"E\" + Math.floor(e)), c = 0, q = s = \"None\", m.mediaEvent = \"CLOSE\";\n 7 == c && (r = m.clicked = a.r = !0);\n if (5 == c || b.completeByCloseOffset && (!c || 100 <= a.e) && 0 < a.length && e >= a.length - b.completeCloseOffsetThreshold) r = m.complete = a.complete = !0;\n l = m.mediaEvent;\n \"MILESTONE\" == l ? l += \"_\" + m.milestone : \"OFFSET_MILESTONE\" == l && (l +=\n \"_\" + m.offsetMilestone);\n a.I[l] ? m.eventFirstTime = !1 : (m.eventFirstTime = !0, a.I[l] = 1);\n m.event = m.mediaEvent;\n m.timePlayed = a.C;\n m.segmentNum = a.m;\n m.segment = a.f;\n m.segmentLength = a.B;\n b.monitor && 4 != c && b.monitor(b.s, m);\n b.Heartbeat && b.Heartbeat.enabled && 0 <= a.g && (r = !1);\n 0 == c && b.M(d);\n r && a.D == y && (d = {\n contextData: {}\n }, d.linkTrackVars = q, d.linkTrackEvents = s, d.linkTrackVars || (d.linkTrackVars = \"\"), d.linkTrackEvents || (d.linkTrackEvents = \"\"), b.P(d, a), d.linkTrackVars || (d[\"!linkTrackVars\"] = 1), d.linkTrackEvents || (d[\"!linkTrackEvents\"] =\n 1), b.s.track(d), a.F ? (a.m = k, a.f = f, a.A = !0, a.F = !1) : 0 < a.a && (a.A = !1), a.n = \"\", a.p = a.q = 0, a.a -= Math.floor(a.a), a.g = e, a.D++);\n }\n return a;\n };\n b.O = function (d, c, e, k, f) {\n var a = 0;\n if (d && (!b.autoTrackMediaLengthRequired || c && 0 < c)) {\n if (b.list && b.list[d]) a = 1;\n else if (1 == e || 3 == e) b.open(d, c, \"HTML5 Video\", f), a = 1;\n a && b.i(d, e, k, -1, 0);\n }\n };\n b.attach = function (d) {\n var c, e, k;\n d && d.tagName && \"VIDEO\" == d.tagName.toUpperCase() && (b.o || (b.o = function (c, a, d) {\n var e, h;\n b.autoTrack && (e = c.currentSrc, (h = c.duration) || (h = -1), 0 > d && (d = c.currentTime), b.O(e, h, a,\n d, c));\n }), c = function () {\n b.o(d, 1, -1);\n }, e = function () {\n b.o(d, 1, -1);\n }, b.j(d, \"play\", c), b.j(d, \"pause\", e), b.j(d, \"seeking\", e), b.j(d, \"seeked\", c), b.j(d, \"ended\", function () {\n b.o(d, 0, -1);\n }), b.j(d, \"timeupdate\", c), k = function () {\n d.paused || d.ended || d.seeking || b.o(d, 3, -1);\n setTimeout(k, 1E3);\n }, k());\n };\n b.j = function (b, c, e) {\n b.attachEvent ? b.attachEvent(\"on\" + c, e) : b.addEventListener && b.addEventListener(c, e, !1);\n };\n void 0 == b.completeByCloseOffset && (b.completeByCloseOffset = 1);\n void 0 == b.completeCloseOffsetThreshold && (b.completeCloseOffsetThreshold =\n 1);\n b.Heartbeat = {};\n b.N = function () {\n var d, c;\n if (b.autoTrack && (d = b.s.d.getElementsByTagName(\"VIDEO\")))\n for (c = 0; c < d.length; c++) b.attach(d[c]);\n };\n b.j(q, \"load\", b.N);\n }","function handleMediaManagerSelect(fileData){\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\n}","async findSoundtrack(ctx, payload) {\n let music = [];\n if(payload.title != '' && payload.artist != '') {\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\n } else if(payload.title == '' && payload.artist != '') {\n music = await axios.get('https://api.discogs.com/database/search?genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\n } else if(payload.title != '' && payload.artist == '') {\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&token='+token.token)\n }\n let list = music.data.results.slice(music.data.results[0]);\n ctx.commit('setSoundtrackSearchResult', list);\n }","function getAllImages(){\n var contents = Contents_Live.find({ \"code\": Session.get(\"UserLogged\").code });\n var imagesArray = [];\n contents.forEach(function(doc){\n var res = doc.contentType.split(\"/\");\n if(res[0] == \"image\"){\n var obj = {\n '_id': doc._id,\n 'imageName': doc.contentName\n };\n imagesArray.push(obj);\n }\n });\n if(imagesArray.length > 0){\n return imagesArray;\n }else{\n return null;\n }\n}","static getMedium(id){\n return fetch(`${BASE_URL}media/${id}`)\n .then(res => res.json())\n }","function getSongs(callback) {\n\n}","function getMediaItems(title, commonLocation, lat, long, eventId, eventHtml) {\n getNodeMediaItems(title, commonLocation, eventId, eventHtml);\n // getTeleportdMediaItems(title, lat, long, eventId, eventHtml); // ficken\n}","function retrieveNodeMediaItemsResults(data, eventId, eventHtml) {\n var socialNetworks = Object.keys(data);\n // check if we have media at all, a bit ugly, but works\n var mediaExist = false;\n for (var i = 0, len = socialNetworks.length; i < len; i++) {\n var media = data[socialNetworks[i]];\n if (media.length) {\n mediaExist = true;\n break;\n }\n }\n if (mediaExist) {\n var html = '';\n socialNetworks.forEach(function(socialNetwork) {\n var media = data[socialNetwork];\n media.forEach(function(mediaItem) {\n if (mediaItem.type === 'photo') {\n if ((!eventMediaItems[eventId][mediaItem.mediaurl]) &&\n // TODO: very lame way to remove spammy messages with just too\n // much characters\n (mediaItem.micropost.plainText.length <= 500)) {\n html += htmlFactory.media(\n mediaItem.mediaUrl,\n mediaItem.micropost.plainText,\n mediaItem.micropostUrl);\n eventMediaItems[eventId][mediaItem.mediaUrl] = true;\n addBackgroundImage(eventPages[eventId], mediaItem.mediaUrl);\n }\n }\n });\n });\n addPageContent(eventPages[eventId], html);\n }\n // no media exist\n else {\n // ugly hack: getMediaItems gets called two times,\n // so only delete the second time we get no media\n var page = eventPages[eventId];\n var times = page.data('noMediaExistTimes') || 0;\n times++;\n page.data('noMediaExistTimes', times);\n\n // remove the page from the flipbook\n if (times == 2) {\n // find the right pagenumber by looping through all pages (sigh…)\n var pages = $('#flipbook').data('pageObjs');\n for (var pageNumber in pages) {\n if (pages[pageNumber][0] === page[0]) {\n $('#flipbook').turn('removePage', pageNumber);\n break;\n }\n }\n }\n }\n}","function getMedia() {\n\tvar results = [];\n\n\tif (extensions && extensions.hasOwnProperty('media')) {\n\t\tvar sourceArray = extensions.media;\n\n\t\tfor (index = 0; index < sourceArray.length; ++index) {\n\t\t results.push(sourceArray[index]);\n\t\t}\n\t}\n\n\treturn results;\n}","function getMediaInfos() {\n var mediaInfos = adapter.getAllMediaInfoForType(streamInfo, constants.VIDEO);\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.AUDIO));\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.TEXT)); // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.MUXED));\n // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.IMAGE));\n\n eventBus.trigger(events.OFFLINE_RECORD_LOADEDMETADATA, {\n id: manifestId,\n mediaInfos: mediaInfos\n });\n }","function getProductMedia(id, media_type) {\n var deferred = $q.defer();\n var query = \"SELECT * FROM product_media WHERE product_id = ? AND product_media_type = ?\";\n mysql.query(query, [id, media_type], function (err, rows) {\n if (err) deferred.reject(err);\n deferred.resolve(rows);\n });\n return deferred.promise;\n }","function getMediaQueryString(refreshToken) {\n let csrfToken = getCookie('csrf-token')\n\tlet mediaToken = refreshToken ? md5(refreshToken) : '';\n return '_csrf='+csrfToken+'&_media='+mediaToken\n}","function deleteMedias(){\n imagesToRemove = []\n console.log(\"BORRANDO\")\n $.couch.urlPrefix = \"https://socpa.cloudant.com\";\n $.couch.login({\n name: \"socpa\",\n password: \"asdargonnijao\"\n });\n\n return $.couch.db(\"media\").view(\"todelete/todelete\", {\n key: canvas_id,\n reduce: false,\n success: function(data) {\n\n },\n error: function(status) {\n console.log(status);\n }\n\n })\n}","function getSongs() {\n\n var spotify = new Spotify(keys.spotify);\n\n var songName = process.argv[3];\n\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(data.tracks.items[0].artists[0].name);\n console.log(data.tracks.items[0].album.name);\n console.log(data.tracks.items[0].name);\n console.log(data.tracks.items[0].external_urls.spotify);\n });\n\n\n}","getAllSongs() {\n Utils.get('/allSongs')\n .then((response) => {\n return response.json();\n })\n .then((json) => {\n Dispatcher.dispatch({\n type: ActionType.RECEIVE_ALL_SONGS,\n songs: json\n })\n })\n .catch((err) => {\n console.error('failed: ', err)\n })\n }","function addMedia(type,media){\n //assumption ki tabhi chlega jb dbAccess hoga\n let tx = dbAccess.transaction(\"gallery\",\"readwrite\");\n let galleryObjectStore = tx.objectStore(\"gallery\");\n let data={\n mId : Date.now(),\n type,\n media,\n };\n galleryObjectStore.add(data);\n}","function getMedia() {\n\tvar results = [];\n\n\tif (config.hasOwnProperty('extensions') && config.extensions.hasOwnProperty('media')) {\n\t\tvar sourceArray = config.extensions.media;\n\n\t\tfor (index = 0; index < sourceArray.length; ++index) {\n\t\t results.push(sourceArray[index]);\n\t\t}\n\t}\n\n\treturn results;\n}","function addAlbum(albumID) {\n var query = \" SELECT concat('file://','/', u.rpath)\";\n query += \" FROM tracks t, urls u\";\n query += \" where t.album=\"+albumID;\n query += \" and t.url=u.id\";\n query += \" order by t.discnumber, t.tracknumber\";\n var result = sql(query);\n for (var i=0; i < result.length; i++) {\n Amarok.Playlist.addMedia(new QUrl(result[i]));\n }\n}","function mediaHandler ( info, tab ) {\n sendItem( { 'imageUrl': info.srcUrl } );\n}","async function getMedia() {\n let results = res.map(post => { \n // return fetchMediaWithUrl(post[\"_links\"][\"wp:featuredmedia\"][0].href).then(images => {\n // const thumb = images[\"media_details\"].sizes.thumbnail.source_url;\n const title = post.title.rendered;\n const postId = post.id;\n const thumb = post.featured_media_src_url;\n // console.log(post.featured_media_src_url);\n // console.log(thumb);\n return { title: title, thumb: thumb, id: postId };\n //});\n });\n //return Promise.all(results);\n return results;\n}","function pubMedia(req, res) {\n return _media2.default.find({ 'pub': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\n}","function filter (type,id_carousel){\n $(id_carousel + \" ol\").empty();\n $(id_carousel + \" .carousel-inner\").empty();\n var url;\n if (type !== \"all\"){\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&album_type='+type+'&limit=40';\n }else{\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&limit=40';\n }\n \n request(url,\"load_albums\",id_carousel);\n}","static addSongs() {\n fetch(\"https://itunes.apple.com/us/rss/topalbums/limit=100/json\")\n .then(resp => resp.json())\n .then(data => {\n let i = 1;\n data.feed.entry.forEach(album => {\n let newCard = new Album(i, album[\"im:image\"][0].label, album[\"im:name\"].label, album[\"im:artist\"].label, album[\"id\"].label, album[\"im:price\"].label, album[\"im:releaseDate\"].label)\n i++;\n Album.all.push(newCard);\n });\n })\n }","function allAccessSearch() {\n var deferred = Q.defer();\n\n that.pm.search(query, 25, function(err, data) {\n if (err) { deferred.reject(err); return; }\n\n var songs = (data.entries || []).map(function(res) {\n var ret = {};\n\n ret.score = res.score;\n\n if (res.type == \"1\") {\n ret.type = \"track\";\n ret.track = that._parseTrackObject(res.track);\n }\n else if (res.type == \"2\") {\n ret.type = \"artist\";\n ret.artist = res.artist;\n }\n else if (res.type == \"3\") {\n ret.type = \"album\";\n ret.album = res.album;\n }\n\n return ret;\n });\n\n deferred.resolve(songs);\n });\n\n return deferred.promise;\n }","function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j0?a.length:\"E\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j0?a.length:\"E\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b photo[\"@size\"] === \"pn\");\n }\n\n return { photos };\n }","function similarItems(media_type, id){\n tmdb_url = `https://api.themoviedb.org/3/${media_type}/${id}/similar?api_key=${api_key}&language=en-US&page=1`;\n try{\n const promise = axios.get(tmdb_url);\n const pm_data = promise.then(response => processSmallCarousel(response.data, media_type));\n return pm_data;\n } catch(error) {\n console.error(error);\n }\n}","static listMusic() {\n let music = new Array();\n\n music.push('sounds/music/incompetech/delightful_d.ogg');\n music.push('sounds/music/incompetech/twisting.ogg'); // Moody, good for cave.\n music.push('sounds/music/incompetech/pookatori_and_friends.ogg');\n music.push('sounds/music/incompetech/getting_it_done.ogg');\n music.push('sounds/music/incompetech/robobozo.ogg');\n music.push('sounds/music/incompetech/balloon_game.ogg');\n music.push('sounds/music/incompetech/cold_sober.ogg');\n music.push('sounds/music/incompetech/salty_ditty.ogg');\n music.push('sounds/music/incompetech/townie_loop.ogg'); // Very peaceful, flute.\n music.push('sounds/music/incompetech/mega_hyper_ultrastorm.ogg'); // Super energetic. Maybe for special.\n // Legacy\n music.push('sounds/music/music_peaceful_contemplative_starling.ogg');\n music.push('sounds/music/twinmusicom_8_bit_march.ogg');\n music.push('sounds/music/twinmusicom_nes_overworld.ogg');\n music.push('sounds/music/music_juhanijunkala_chiptune_01.ogg');\n\n return music;\n }","function mediaqueryresponse(mql){\n\t\t\t\tif (mql.matches) { // if media query matches\n\t\t\t\t\t\n\t\t\t\t} else if (!mql.matches) {\n\t\t\t\t\tsetupServices();\n\t\t\t\t}\n\t\t\t}","get media () {\n\n\t\tif (typeof this.elements === 'undefined') {\n\t\t\tthrow Error('Cannot access media until publication is loaded');\n\t\t}\n\n\t\treturn this.elements.filter(({ type }) => {\n\t\t\treturn type === 'media';\n\t\t}).map(({ data }) => {\n\t\t\treturn new Media(data);\n\t\t});\n\t}","function findSong(savedArrayOfChoices) {\n // declaring all vars according to savedArrayOfChoices \n var pickCountry = savedArrayOfChoices[0];\n var pickArtist = savedArrayOfChoices[1];\n var pickRelatedArtist = savedArrayOfChoices[2];\n var pickAlbum = savedArrayOfChoices[3];\n var pickSong = savedArrayOfChoices[4];\n\n // pushing country into chartQuery, returns artist\n var chartQuery = `chart.artists.get?page=1&page_size=4&country=${pickCountry}`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n\n // declaring artistId and artistname\n var artistId = music.message.body.artist_list[pickArtist].artist.artist_id;\n var artistName = music.message.body.artist_list[pickArtist].artist.artist_name;\n\n // pushing artistid, returns related artist\n var chartQuery = `artist.related.get?artist_id=${artistId}&page_size=4&page=1`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n\n // declaring related artist id and name\n var relatedArtistId;\n var relatedArtistName;\n\n // if no related artists, just use artist\n if (music.message.body.artist_list.length === 0) {\n relatedArtistId = artistId;\n relatedArtistName = artistName;\n }\n // otherwise use the related artist\n else {\n relatedArtistId = music.message.body.artist_list[pickRelatedArtist].artist.artist_id;\n relatedArtistName = music.message.body.artist_list[pickRelatedArtist].artist.artist_name;\n\n }\n\n // pushing relatedArtistId, returns album\n var chartQuery = `artist.albums.get?artist_id=${relatedArtistId}&s_release_date=desc&page_size=4`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n\n // declaring album id\n var albumId\n\n // if statements for if the artist doesn't have 4 albums\n if (music.message.body.album_list.length === pickSong) {\n albumId = music.message.body.album_list[pickAlbum].album.album_id;\n }\n else if (music.message.body.album_list.length === 3) {\n albumId = music.message.body.album_list[2].album.album_id;\n\n }\n else if (music.message.body.album_list.length === 2) {\n albumId = music.message.body.album_list[1].album.album_id;\n }\n else {\n albumId = music.message.body.album_list[0].album.album_id;\n\n }\n\n // pushing albumID, returns song\n var chartQuery = `album.tracks.get?album_id=${albumId}&page=1&page_size=4`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n // declaring song name\n var songName;\n\n // if statements for if the album doesn't have 4 songs\n if (music.message.body.track_list.length === pickSong) {\n songName = music.message.body.track_list[pickSong].track.track_name;\n\n }\n else if (music.message.body.track_list.length === 3) {\n songName = music.message.body.track_list[2].track.track_name;\n\n }\n else if (music.message.body.track_list.length === 2) {\n songName = music.message.body.track_list[1].track.track_name;\n\n }\n else {\n songName = music.message.body.track_list[0].track.track_name;\n\n }\n // finds video with youtube api\n getVideo(`${songName} ${relatedArtistName}`);\n\n // sets the text of final-artist-song to the song and artist that is found\n $(\"#final-artist-song\").text(`${songName} by ${relatedArtistName}`);\n });\n });\n });\n });\n}","function getEmbededMedia(item, cb) {\n\tvar oembed,\n\t\tu = '',\n\t\thost = url.parse(item.url).host,\n\t\t\to = {\n\t\t\t\turl: item.url,\n\t\t\t\tmaxwidth: item.maxwidth//435,\n\t\t\t\t//maxheight: 244\n\t\t\t};\n\t\n\tif (host.match(/vimeo.com/ig)) {\n\t\tu = config.vimeo.oembed_url + '?' + qs.stringify(o);\n\t} else if (host.match(/youtube.com|youtu.be/ig)) {\n\t\to.format = 'json';\n\t\tu = config.youtube.oembed_url + '?' + qs.stringify(o);\n\t} else if (host.match(/instagr.am|instagram/)) {\n\t\tu = config.instagram.oembed_url + '?' + qs.stringify(o);\n\t}\n\telse return cb(null, {});\n\t\n\tr.get({url: u, json: true}, function(err, resp, body) {\n\t\tif (!err && resp.statusCode === 200) {\n\t\t\treturn cb(null, body);\n\t\t} else {\n\t\t\tif (err) return cb(err);\n\t\t\telse if (err instanceof Error) return cb(new Error(err));\n\t\t\telse return cb(new Error(body.errors[0].message));\n\t\t}\n\t});\n}","function getRecentMediaByTag(tag) {\r\n\tvar url = \"https://api.instagram.com/v1/tags/\"\r\n\t\t\t+ tag\r\n\t\t\t+ \"/media/recent\"\r\n\t\t\t+ \"?callback=?&access_token=539668504.2c39d74.5b6021beec4048f0bdba845c38919103&client_id=97bf64bca67344afbbe8ea64caa8e617\";\r\n\r\n\t$.getJSON(url, cacheData);\r\n}","function findAll(done) {\n _connect(function(err, db) {\n if (err) return done(err);\n db.collection('mediaentries').find({}, done);\n });\n }","function getMediaElements(where) {\n return getElementsByTagName(\"media:content\", where).map((elem) => {\n const { attribs } = elem;\n const media = {\n medium: attribs[\"medium\"],\n isDefault: !!attribs[\"isDefault\"],\n };\n for (const attrib of MEDIA_KEYS_STRING) {\n if (attribs[attrib]) {\n media[attrib] = attribs[attrib];\n }\n }\n for (const attrib of MEDIA_KEYS_INT) {\n if (attribs[attrib]) {\n media[attrib] = parseInt(attribs[attrib], 10);\n }\n }\n if (attribs[\"expression\"]) {\n media.expression = attribs[\"expression\"];\n }\n return media;\n });\n}","medias() {\n\t\treturn this.recentlyAddedMedias.concat(this.initialMedias)\n\t}","function getMedia(event) {\n event.preventDefault();\n\n let url = `/media/${this.getAttribute('href')}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n showMedia(data);\n })\n .catch((err) => console.log(err));\n\n\n for (let i = 0; i < navLink.length; i++) {\n navLink[i].classList.remove('navSelected'); // Removes selected class from all nav links\n }\n this.classList.add('navSelected'); // Adds selected class to chosen nav link\n }","function html5media() {\n scanElementsByTagName(\"video\");\n scanElementsByTagName(\"audio\");\n }","function getItems(lat, lng, miles, imagelist) {\n //console.log(\"search service\", imagelist);\n var distance=\"false\";\n if (miles) {\n distance=\"true\";\n }\n // return items.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\"asc\"});\n return Image.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\"asc\"});\n\n }","function cmd(a,b,c){var d=\"\";if(b.mode==\"user\"){d=\"https://api.instagram.com/v1/users/\"+c+\"/media/recent/?callback=?\"}else{d=\"https://api.instagram.com/v1/media/popular?callback=?\"}$.getJSON(d,a,function(a){onPhotoLoaded(a,b)})}","function html5media() {\r\n scanElementsByTagName(\"video\");\r\n scanElementsByTagName(\"audio\");\r\n }","async list(queryObj) {\n const result = await this.doRequest({\n path: \"/files\",\n method: \"GET\",\n params: {\n path: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.path) || \"/\",\n pagination_token: queryObj === null || queryObj === void 0 ? void 0 : queryObj.paginationToken,\n qty: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.quantity) || 300,\n },\n });\n return result;\n }","function mediaMgmt()\r\n{\r\n this.ucatMediaClass();\r\n this.setupMedia = function (containerElement, options)\r\n {\r\n //AUDIO OR VIDEO\r\n $(containerElement).find(\"audio, video\").each(function ()\r\n {\r\n var tag = $(this);\r\n //Only convert media if not already converted;\r\n if(!$(this).hasClass(\"ucatMEdiaTag\")){\r\n $(this).addClass(\"ucatMEdiaTag\");\r\n var mediaType = tag.prop(\"tagName\").toLowerCase();//Audio or video\r\n var argumentOptions = mediaType == 'audio' ? options.audio : options.video;\r\n var transcriptHighlights = options.transcriptHighlights;\r\n var defaultOptions = mediaType == 'audio' ? defaultUcatAudioOptions : defaultUcatVideoOptions\r\n reconcileGlobalVariable(argumentOptions, defaultOptions);\r\n var tagOptions = copyGlobalVariable(argumentOptions);\r\n $.each(tag[0].dataset, function (key, value)\r\n {\r\n var valueType = typeof (defaultOptions[key]);\r\n switch (valueType)\r\n {\r\n case \"boolean\":\r\n value = parseBoolean(value);\r\n break;\r\n case \"number\":\r\n value = parseInt(value);\r\n break;\r\n default:\r\n value = String(value);\r\n break;\r\n }\r\n tagOptions[key] = value;\r\n });\r\n //The media browser plug-in passes the videosizetitle as a data-attribute;\r\n //legacy media should use standard playersize as fallback\r\n tagOptions.videosize = tagOptions.videosizetitle ? window[tagOptions.videosizetitle] : standardVideoPlayer;\r\n tagOptions.transcriptHighlights = transcriptHighlights;\r\n for (var th = 0; th < tagOptions.transcriptHighlights.length; th++)\r\n {\r\n tagOptions.transcriptHighlights[th].visible = true;\r\n }\r\n //Addded to force complete download of media\r\n // tag.attr(\"preload\",\"auto\");\r\n\r\n //simply means that the browser has loaded enough meta-data to know the media’s .duration\r\n tag.on('loadedmetadata', { o: tagOptions }, function (e)\r\n {\r\n ucatAudioVideo(containerElement, this, e.data.o)\r\n });\r\n }\r\n });\r\n\r\n //Other file types\r\n $(containerElement).find(\".doc, .xls, .ppt, .pdf, .file\").each(function ()\r\n {\r\n setupDocumentLink($(this));\r\n });\r\n }\r\n\r\n return this;\r\n}","function getAll(){\n\tvar pictures = document.getElementById(\"picture\");\n\taudio.src = SingleList[i].audio;\n\tpictures.src = SingleList[i].picture;\n\t$('#nowplay').html(SingleList[i].artistSong());\n\t\n\taudio.play();\n\n}","function getTracks(searchTerm, limit, tracksDiv, ids, playlistID) {\n\n if(!ids) {\n var filter = {\n q : searchTerm,\n limit : limit\n }\n } else {\n var filter = {\n ids : ids\n }\n }\n\n SC.get('/tracks/', filter, function(tracks, error) {\n if(tracks) {\n tracksDiv.html('');\n\n $.each(tracks, function(key, track){\n\n var pictureUrl;\n var genre;\n var wrapper;\n\n if(track.artwork_url == null)\n pictureUrl = 'includes/imgs/no-image.jpg';\n else\n pictureUrl = track.artwork_url;\n\n if(track.genre == null)\n genre = \"Undefined\";\n else\n genre = track.genre.trunc(15);\n\n var title = $(''+track.title.trunc(40)+'');\n var stats = $('
'+track.playback_count+' '+track.comment_count+' '+track.favoritings_count+' '+genre+'
');\n var player = $('
');\n var clear = $('
');\n var wrapper = $('
  • \"'+track.title+'\"
  • ');\n \n wrapper.append(title).append(player).append(stats).append(clear);\n if(playlistID) {\n var remove = $('
    ');\n wrapper.append(remove);\n }\n tracksDiv.append(wrapper);\n\n player.scPlayer({\n links: [{url: track.permalink_url, title: track.title}]\n });\n\n wrapper.draggable({\n stack: '#tracks li',\n revert: true,\n cursor: 'move',\n containment: '#content'\n });\n });\n\n if(error)\n tracksDiv.html('

    No tracks found.

    ');\n\n } else {\n console.log(\"The get statement must be wrong.\");\n //triggerNotification(error);\n }\n\n });\n}","function processMulti(response){\n response = response.results;\n results_list = [];\n var i = 0;\n while(results_list.length < 7 && i < response.length){\n if(response[i].media_type === 'movie' || response[i].media_type === 'tv'){\n\n if(response[i].backdrop_path !== undefined && response[i].backdrop_path !== null\n\t && response[i].poster_path !== undefined && response[i].poster_path !== null){\n m_item = {}\n m_item['id'] = response[i].id;\n m_item['backdrop_path'] = \"https://image.tmdb.org/t/p/w500\" + response[i].backdrop_path\n m_item['media_type'] = response[i].media_type;\n\n field_name = \"title\";\n if(response[i].media_type === \"tv\"){\n field_name = \"name\";\n }\n if(response[i][field_name] !== undefined && response[i][field_name] !== null){\n m_item['name'] = response[i][field_name];\n }\n results_list.push(m_item);\n }\n }\n i++;\n }\n\n\n query_results = {'data': results_list};\n return query_results;\n}","function readAlbumsFromDb() {\n musicDb.allDocs({\n include_docs: true,\n startkey: 'album_',\n endkey: 'album_\\uffff'\n }).then(function (resultFromDb) {\n processInfoFromDb(resultFromDb)\n }).catch(function (err) {\n console.log(err)\n })\n }","async fetchYourSoundtracks(ctx) {\n let docRef = await db.collection(auth.currentUser.uid).doc(ctx.getters.getSoundtracksId);\n let data = []\n await docRef.get().then(e => {\n data.push(e.data())\n });\n delete data[0].soundtracks;\n let resultArray = Object.keys(data[0]).map(function(key) {\n return [Number(key), data[0][key]];\n });\n resultArray.sort((a, b) => (a[1].soundtrackTitle > b[1].soundtrackTitle) ? 1 : -1)\n ctx.commit('setSoundtrackList', resultArray);\n localStorage.setItem('userSoundtracks', JSON.stringify(resultArray));\n }","get mediaListView() {\n return this._mediaListView;\n }","function media(){\n qtd_args = arguments.length;\n soma = 0;\n console.log('total args: '+qtd_args);\n for (i=0;i {\n if (data.length) {\n this.setItems(data);\n }\n }\n );\n }","static getAllArtists(){\n try{\n\n const data = connection.query(`select distinct artist from music`);\n\n return {status: 0, message: 'Ok', results: data};\n } catch (error){\n return{ status: 1, message: 'Error: ' + error, error}\n }\n }","function addTrack(ID) {\n var query = \" SELECT concat('file://','/', u.rpath)\";\n query += \" FROM tracks t, urls u\";\n query += \" where t.id=\"+ID;\n query += \" and t.url=u.id\";\n var result = sql(query);\n Amarok.Playlist.addMedia(new QUrl(result[0]));\n}","function spotifysong(song) {\n\n spotify.search({ type: 'track', query: song, limit: 20 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + error);\n }\n for (var i = 0; i < data.tracks.items.length; i++) {\n console.log(i);\n console.log(\"artist(s) : \" + data.tracks.items[i].album.artists[0].name);\n console.log(\"song name : \" + data.tracks.items[i].name);\n console.log(\"preview song : \" + data.tracks.items[i].preview_url)\n console.log(\"album : \" + data.tracks.items[i].album.name)\n console.log(\"----------------------------------------------\")\n }\n // console.log(data.tracks.items)\n\n });\n\n}","async function __prepareFiles() {\n const files = albumDetails.pictures,\n preparedFiles = [];\n\n for (let url of preSignedUrls) {\n let obj = files.find((file) => file.name === url.fileName)\n preparedFiles.push({ rawFile: obj.file, uploadUrl: url.url })\n }\n\n return preparedFiles;\n }","_loadSongs(selectContainer) {\n const PATH='https://fullstackccu.github.io/homeworks/hw4/songs.json';\n const onJsonReady=(json)=>{\n this.songList=json;\n this._createSongs(selectContainer);\n };\n\n fetch(PATH)\n .then(response => response.json())\n .then(onJsonReady);\n }","media(key, path) {\n console.log('[Media]', 'cache', `${key} (${path})`);\n\n this.game.cache.addSound(key, '', {\n path,\n }, false, false);\n\n return this;\n }","function getSong(track) {\n // If there is no track listed display the default of \"The Sign, by Ace of Base\"\n if (track === \"\" || track === undefined || track === null) {\n var defaultTrack = \"The Sign\";\n spotify.search({ type: \"track\", query: defaultTrack, limit: 10 }, function (err, response) {\n if (err) {\n return console.log('It seems you have an error:: ' + err);\n }\n //the default was displaying The Sign by Ty Dolla Sign so I just hard coded the default\n console.log('---------------------------------------------\\nArtist: \"' + \"Ace of Base\" +\n '\"\\nTrack: \"' + \"The Sign\" +\n '\"\\nAlbum: \"' + \"The Sign (US Album) [Remastered]\" +\n '\"\\nLink: \"' + \"https://p.scdn.co/mp3-preview/4c463359f67dd3546db7294d236dd0ae991882ff?cid=731f3e4c779047e89b0f836152cd61cc\" + '\"\\n');\n });\n }\n else {\n //run if a track is listed\n spotify.search({ type: \"track\", query: track, limit: 3 }, function (err, response) {\n if (err) {\n return console.log('It seems you have an error:: ' + err);\n }\n for (i = 0; i < response.tracks.items.length; i+=1) {\n // if there is no preview default a link\n if (response.tracks.items[i].preview_url === null) {\n console.log('---------------------------------------------\\nArtist: \"' + response.tracks.items[i].album.artists[0].name +\n '\"\\nTrack: \"' + response.tracks.items[i].name +\n '\"\\nAlbum: \"' + response.tracks.items[i].album.name +\n '\"\\nLink: \"' + response.tracks.items[i].album.external_urls.spotify + '');\n }\n else {\n console.log('---------------------------------------------\\nArtist: \"' + response.tracks.items[i].album.artists[0].name +\n '\"\\nTrack: \"' + response.tracks.items[i].name +\n '\"\\nAlbum: \"' + response.tracks.items[i].album.name +\n '\"\\nLink: \"' + response.tracks.items[i].preview_url + '\"');\n }\n }\n });\n }\n}","async getSharedAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }","function spotifyThisSong() {\n let song = \"The Sign Ace of Base\";\n if (searchTerm) {\n song = searchTerm;\n }\n spotify.request('https://api.spotify.com/v1/search?q=track:' + song + '&type=track&limit=10', function (error, response) {\n for (i = 0; i < 3; i++) {\n if (error) {\n return console.log(error);\n }\n console.log(\"\\nArtist: \" + response.tracks.items[i].artists[0].name + \"\\nSong: \" + response.tracks.items[i].name + \"\\nPreview: \" + response.tracks.items[i].preview_url + \"\\nAlbum: \" + response.tracks.items[i].album.name);\n };\n });\n}","function spotifySearch(){\n spotify.search({ type: 'track', query: songToSearch}, function(error, data){\n if(!error){\n for(var i = 0; i < data.tracks.items.length; i++){\n var song = data.tracks.items[i];\n console.log(\"Artist: \" + song.artists[0].name);\n console.log(\"Song: \" + song.name);\n console.log(\"Preview: \" + song.preview_url);\n console.log(\"Album: \" + song.album.name);\n console.log(\"-----------------------\");\n }\n } else{\n console.log('Error occurred.');\n }\n });\n }","async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }","read({ sponsor, user }, res) {\n const where = {sponsorId: sponsor.id}\n Promise.all([\n SponsorLike.findOne({where:{...where,\n userId: user.id,\n }}),\n SponsorLink.findAll({where}),\n SponsorMedia.findAll({where}),\n ])\n .then(([like, links, mediaObjs])=>{\n let s = resolveUploadSrc(sponsor.toJSON(), ['logo']);\n if (like) {\n s.like = true;\n }\n links = links.map( ({name, url}) => ({name, url}) );\n const media = mediaObjs.map( ({url}) => url);\n\n res.json({...s, links, media, mediaObjs});\n })\n }","function getAudio(device_id) {\n $.ajax({\n url: \"https://api.spotify.com/v1/me/player/play?device_id=\" + device_id,\n type: \"PUT\",\n data: '{\"uris\": [\"spotify:track:' + track + '\"]}',\n beforeSend: function (xhr) {\n xhr.setRequestHeader('Authorization', 'Bearer ' + _token)\n },\n success: function (data) {\n /*console.log(data)*/\n }\n })\n }","function callAPI(query) {\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\n\t\t{'q': query,\n\t\t'limit': '20'},\n\t\tfunction(data) {\n\n\t\t\tresetTable('searchBody')\n\t\t\t$.each(data, function(i, v) {\n\t\t\t\tvar artwork = '_css/artwork.jpg'\n\t\t\t\tif (v.artwork_url != null){\n\t\t\t\t\tartwork = v.artwork_url;\n\t\t\t\t} \n\t\t\t\tvar title = v.title;\n\t\t\t\tvar artist = v.artist;\n\t\t\t\tvar artist = v.user.username;\n\t\t\t\tvar url = v.permalink_url;\n\t\t\t\taddSong(artwork, title, url, artist);\n\t\t\t\t// console.log(data);\n\t\t\t});\n\t\t},'json'\n\t);\n}","componentDidMount() {\n client.photos.search({ query: 'cats', locale: 'en-US', per_page: 24 }).then(res => {\n this.setState({\n catPics: res.photos\n });\n })\n .catch(error => {\n console.log('Error fetching and parsing data', error);\n });\n\n client.photos.search({ query: 'dogs', locale: 'en-US', per_page: 24 }).then(res => {\n this.setState({\n dogPics: res.photos\n });\n })\n .catch(error => {\n console.log('Error fetching and parsing data', error);\n });\n\n client.photos.search({ query: 'computers', locale: 'en-US', per_page: 24 }).then(res => {\n this.setState({\n computerPics: res.photos\n });\n })\n .catch(error => {\n console.log('Error fetching and parsing data', error);\n });\n }","function parseImage(items) {\n var curr_data = [];\n items.forEach(function (element, index, array) {\n console.log(element.media_key.S);\n getImage(element.media_key.S).then((img) => {\n curr_data.push(img);\n if (curr_data.length == items.length) {\n displayImages(curr_data);\n }\n })\n })\n }","async cleanUpMusic() {\n const docs = await this.db.getDocuments('music');\n const hashes = {};\n \n for(let i = 0; i < docs.length; i++) {\n const doc = docs[i];\n \n if(\n !doc.fileHash || \n typeof doc.fileHash != 'string' ||\n (\n !this.isFileAdding(doc.fileHash) && \n !await this.hasFile(doc.fileHash) &&\n await this.db.getMusicByFileHash(doc.fileHash)\n )\n ) {\n await this.db.deleteDocument(doc);\n continue;\n }\n\n hashes[doc.fileHash] = true;\n }\n\n await this.iterateFiles(async filePath => {\n try {\n const hash = path.basename(filePath);\n\n if(!hashes[hash] && !this.isFileAdding(hash) && !await this.db.getMusicByFileHash(hash)) {\n await this.removeFileFromStorage(hash);\n }\n }\n catch(err) {\n this.logger.warn(err.stack);\n }\n });\n }","static getFilmsFromStorage()\n {\n let films;\n if(localStorage.getItem('films') === null)\n {\n films = [];\n }else{\n films = JSON.parse(localStorage.getItem('films'));\n }\n return films;\n }","function getMusic(songName) {\n\n // If no song name, defaults The Sign by Ace\n if (!songName) {\n var songName = \"The Sign Ace\";\n }\n\n spotify.search({ type: 'track', query: songName }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n var trackObj = data.tracks.items[0];\n\n // Artist(s)\n console.log(`Artist: ${trackObj.artists[0].name}`);\n\n // The song's name\n console.log(`Song Name: ${trackObj.name}`);\n\n // A preview link of the song from Spotify\n console.log(`Preview Link: ${trackObj.external_urls.spotify}`);\n\n // The album that the song is from\n console.log(`Album Name: ${trackObj.album.name}`);\n });\n}","getInitialData() {\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\n if (error) {\n console.log(error);\n } else if (item == null) {\n // Gallery not found.\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\n } else {\n this.setState({ gallery: item,\n editGallery : {\n name: item.name,\n description: item.description\n }});\n\n // Get medias\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ images: [...items] });\n }\n });\n }\n });\n }","function s3ListObjects(token, collection = []) {\n return listObjects({\n Bucket: bucket,\n Prefix: 'sound-sync/',\n ContinuationToken: token,\n }).then(({ IsTruncated, Contents, NextContinuationToken }) => {\n const contents = collection.concat(Contents);\n return IsTruncated\n ? s3ListObjects(NextContinuationToken, contents)\n : contents;\n });\n}","function playThatFunkyMusic(songName) {\n spotify\n .search({ type: \"track\", query: songName, limit: 5 })\n .then(function(response) {\n response.tracks.items.forEach(function(song) {\n console.log(\n `\n Artist(s): ${song.album.artists[0].name}\n Song Name: ${song.name}\n Preview Link: ${song.preview_url}\n Album: ${song.album.name}\n `\n );\n });\n\n // console.log(\n // `\n // Artist(s): ${response.tracks.items[0].album.artists[0].name}\n // Song Name: ${response.tracks.items[0].name}\n // Preview Link: ${response.tracks.items[0].preview_url}\n // Album: ${response.tracks.items[0].album.name}\n // `\n // );\n })\n .catch(function(err) {\n console.log(err);\n });\n}"],"string":"[\n \"async getMediaItems(albumID){\\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\\n const token = await GoogleSignin.getTokens();\\n await this.getDbUserData();\\n data = {\\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\\n method: 'POST',\\n headers: {\\n 'Authorization': 'Bearer '+ token.accessToken,\\n 'Content-type': 'application/json'\\n },\\n body: JSON.stringify({\\n \\\"pageSize\\\":\\\"100\\\",\\n \\\"albumId\\\": albumID\\n })\\n }\\n response = await this.APIHandler.sendRequest(data);\\n return response.mediaItems\\n }\",\n \"function MediaByTag() {\\r\\n\\tvar caption;\\r\\n\\tvar link;\\r\\n\\tvar tags;\\r\\n\\tvar comments;\\r\\n\\tvar likes;\\r\\n\\tvar imageUrls;\\r\\n\\tvar userInfo;\\r\\n}\",\n \"function getMediaByIds(ids) {\\n return $.post('/api/media/ids', { media: { ids } });\\n }\",\n \"function queryPictures(req) {\\n\\n let query = Picture.find();\\n\\n if (typeof (req.query.src) == 'string') {\\n query = query.where('src').equals(req.query.src);\\n }\\n\\n if (typeof (req.query.description) == 'string') {\\n query = query.where('description').equals(req.query.description);\\n }\\n\\n return query;\\n}\",\n \"async function getMedia() {\\n if (!username) return;\\n const resp = await fetch(`https://www.instagram.com/${username}/?__a=1`);\\n const { graphql } = await resp.json();\\n setImages(\\n graphql.user.edge_owner_to_timeline_media.edges.map(\\n ({ node }) => node.thumbnail_resources\\n )\\n );\\n }\",\n \"async function FindMediaItems(options = [], button) {\\n\\t\\tif(!(options.length && button))\\n\\t\\t\\treturn;\\n\\n\\t\\t/* Get rid of repeats */\\n\\t\\tlet uuids = [];\\n\\n\\t\\toptions = options.map((v, i, a) => {\\n\\t\\t\\tlet { type, title } = v,\\n\\t\\t\\t\\tuuid = UUID.from({ type, title });\\n\\n\\t\\t\\tif(!!~uuids.indexOf(uuid))\\n\\t\\t\\t\\treturn options.splice(i, 1), null;\\n\\t\\t\\tuuids.push(uuid);\\n\\n\\t\\t\\treturn v;\\n\\t\\t})\\n\\t\\t.filter(v => v);\\n\\n\\t\\tlet results = [],\\n\\t\\t\\tlength = options.length,\\n\\t\\t\\tqueries = (FindMediaItems.queries = FindMediaItems.queries || {});\\n\\n\\t\\tFindMediaItems.OPTIONS = options;\\n\\n\\t\\tlet query = JSON.stringify(options);\\n\\n\\t\\tquery = (queries[query] = queries[query] || {});\\n\\n\\t\\tif(query.running === true)\\n\\t\\t\\treturn;\\n\\t\\telse if(query.results) {\\n\\t\\t\\tlet { results, multiple, items } = query;\\n\\n\\t\\t\\tnew Notification('update', `Welcome back. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\\n\\n\\t\\t\\tif(multiple)\\n\\t\\t\\t\\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\\n\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tquery.running = true;\\n\\n\\t\\tnew Notification('info', `Processing ${ length } item${ 's'[+(length === 1)] || '' }...`);\\n\\n\\t\\tfor(let index = 0, option, opt; index < length; index++) {\\n\\t\\t\\tlet { IMDbID, TMDbID, TVDbID } = (option = await options[index]);\\n\\n\\t\\t\\topt = { name: option.title, title: option.title, year: option.year, image: options.image, type: option.type, imdb: IMDbID, IMDbID, tmdb: TMDbID, TMDbID, tvdb: TVDbID, TVDbID };\\n\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tawait Request_Plex(option)\\n\\t\\t\\t\\t\\t.then(async({ found, key }) => {\\n\\t\\t\\t\\t\\t\\tlet { imdb, tmdb, tvdb } = opt,\\n\\t\\t\\t\\t\\t\\t\\t{ type, title, year } = opt,\\n\\t\\t\\t\\t\\t\\t\\tuuid = UUID.from({ type, title });\\n\\n\\t\\t\\t\\t\\t\\tif(found) {\\n\\t\\t\\t\\t\\t\\t\\t// ignore found items, we only want new items\\n\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\\n\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\toption.field = 'original_title';\\n\\n\\t\\t\\t\\t\\t\\t\\treturn await Request_Plex(option)\\n\\t\\t\\t\\t\\t\\t\\t\\t.then(({ found, key }) => {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tif(found) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// ignore found items, we only want new items\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t} else if(CAUGHT.has({ imdb, tmdb, tvdb })) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// ignore items already being watched\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'queued')\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tlet available = (__CONFIG__.usingOmbi || __CONFIG__.usingWatcher || __CONFIG__.usingRadarr || __CONFIG__.usingSonarr || __CONFIG__.usingMedusa || __CONFIG__.usingSickBeard || __CONFIG__.usingCouchPotato),\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\taction = (available? 'download': 'notfound'),\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttitle = available?\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'Not on Plex (download available)':\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'Not on Plex (download not available)';\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, (available? 'download': 'not-found'));\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tresults.push({ ...opt, found: false, status: action });\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\t});\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t.catch(error => { throw error });\\n\\t\\t\\t} catch(error) {\\n\\t\\t\\t\\tUTILS_TERMINAL.error('Request to Plex failed: ' + String(error));\\n\\t\\t\\t\\t// new Notification('error', 'Failed to query item #' + (index + 1));\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tresults = results.filter(v => v.status == 'download');\\n\\n\\t\\tlet img = furnish('img#plexit-add', { title: 'Add to Plex It!', onmouseup: event => {let frame = document.querySelector('#plexit-bookmarklet-frame'); frame.src = frame.src.replace(/(#plexit:.*)?$/, '#plexit:' + event.target.parentElement.getAttribute('data'))} }),\\n\\t\\t\\tpo, pi = furnish('li#plexit.list-item', { data: encode(JSON.stringify(results)) }, img),\\n\\t\\t\\top = document.querySelector('#wtp-plexit');\\n\\n\\t\\tif(po = button.querySelector('#plexit'))\\n\\t\\t\\tpo.remove();\\n\\t\\ttry {\\n\\t\\t\\tbutton.querySelector('ul').insertBefore(pi, op);\\n\\t\\t} catch(e) { /* Don't do anything */ }\\n\\n\\t\\tlet multiple = results.length,\\n\\t\\t\\titems = multiple == 1? 'item': 'items';\\n\\n\\t\\tnew Notification('update', `Done. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\\n\\n\\t\\tquery.running = false;\\n\\t\\tquery.results = results;\\n\\t\\tquery.multiple = multiple;\\n\\t\\tquery.items = items;\\n\\n\\t\\tif(multiple)\\n\\t\\t\\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\\n\\t}\",\n \"function uploadMusic() {\\n //returns array of music available for ringtone after reading from file, is used for \\\"tones\\\" array\\n}\",\n \"function mediaQueryListDispatcher() {\\n\\t\\tthis.mqls = [];\\n\\t}\",\n \"function myMedia(req, res) {\\n return _media2.default.find({ 'uid': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\\n}\",\n \"async function _loadMedia() {\\n\\n var data = await fetch('/content/media.json');\\n var json = await data.json();\\n\\n json.forEach((file) => {\\n media.push(file);\\n });\\n\\n _buildTable();\\n tableUIUpdate();\\n\\n }\",\n \"processUploadImages(uploadData){\\n mediaItems = []\\n for (i = 0; i < uploadData.length; i ++){\\n mediaItems.push({\\n \\\"description\\\": uploadData[i].description,\\n \\\"simpleMediaItem\\\": {\\n \\\"uploadToken\\\": uploadData[i].uploadToken\\n }\\n })\\n }\\n return mediaItems\\n }\",\n \"function deduplicteMediaItems() {\\n\\n}\",\n \"function getMedia(user) {\\n userId = user || \\\"\\\";\\n if (userId) {\\n userId = \\\"/?userId=\\\" + userId;\\n }\\n $.get(\\\"/api/posts\\\" + authorId, function(data) {\\n console.log(\\\"Posts\\\", data);\\n saved = data;\\n if (!posts || !posts.length) {\\n displayEmpty(user);\\n }\\n else {\\n initializeRows();\\n }\\n });\\n }\",\n \"function searchMusic(name){\\n if(!name){\\n name = \\\"The sigin\\\";\\n }\\n spotify.search({ type: 'track', query: name }, function(err, data) {\\n if (err) {\\n return console.log('Error occurred: ' + err);\\n }\\n for (var i = 0; i < 5; i++) {\\n console.log(\\\"Artist Name: \\\"+data.tracks.items[i].artist[0].name); \\n console.log(\\\"Song name: \\\"+data.tracks.items[i].name);\\n console.log(\\\"Link: \\\"+data.tracks.items[i].album.name);\\n console.log(\\\"Album\\\"+data.tracks.items[i].preview_url);\\n console.log(\\\"-------------------------------------\\\");\\n }\\n });\\n}\",\n \"function loadMedia(location, queries, manage, final) {\\n\\n // Recursive function\\n function nextMedia(i) {\\n\\n // From queries object to array, in order to use $.when()\\n var indices = []; // Keeps track of which number corresponds with which key\\n var queriesArr = []; // Array of the queries\\n var j = 0; // Index\\n for(var q in queries) {\\n indices.push(q);\\n // Make a shallow copy of queries[q], so it's unaffected for next iteration\\n queriesArr.push($.extend({}, queries[q]));\\n // Important! Add the absolute path of the file to the query as a prefix!\\n queriesArr[j].url = location + i.toString() + '/' + queriesArr[j].url;\\n // Replace query data by actual jqXHR object\\n queriesArr[j] = $.ajax(queriesArr[j]);\\n j++;\\n }\\n\\n // When all the queries are completed...\\n $.when(...queriesArr).done(function(...resultsArr) {\\n\\n // Back from array to object\\n var results = {};\\n for(var j = 0; j < resultsArr.length; j++) {\\n results[indices[j]] = resultsArr[j];\\n }\\n\\n // Call to manager function with processed data\\n manage(location, results, i);\\n\\n nextMedia(i + 1); // Keep going\\n\\n }).fail(final); // Call after everything is done\\n\\n } // nextMedia(i)\\n\\n nextMedia(0); // Initial call\\n\\n}\",\n \"function execute() {\\n return gapi.client.photoslibrary.mediaItems.list({}).then(\\n function(response) {\\n // Handle the results here (response.result has the parsed body).\\n console.log(\\\"Response\\\", response);\\n },\\n function(err) {\\n console.error(\\\"Execute error\\\", err);\\n }\\n );\\n}\",\n \"function mediaLocStorage() {\\n // assign media object to a variable\\n var mediaObj = memory.media,\\n // create an empty object\\n mediaLinks = {};\\n // loop through media object\\n for (var i = 0; i < mediaObj.length; i++) {\\n\\n if (mediaLinks[mediaObj[i].post] == mediaObj.post) {\\n // assign object keys and values\\n // \\\"the key will be the post id, and the value will be the image link\\\"\\n mediaLinks[mediaObj[i].post] = mediaObj[i].source_url;\\n }\\n }\\n // save the object in local storage\\n storage.write('postImg', mediaLinks);\\n }\",\n \"images() {\\n // console.log('thumbnails helper');\\n return Images.find({\\n thumbnail: { $exists: 1 },\\n // subscriptionId: ThumbnailsHandle.subscriptionId,\\n }, {\\n limit: ImagesPerPage,\\n sort: { created: -1 }\\n });\\n }\",\n \"function list( url, requestArguments ) {\\n\\t\\t\\tvar getter = {},\\n\\t\\t\\t\\taction = {\\n\\t\\t\\t\\t\\tmethod: 'GET',\\n\\t\\t\\t\\t\\ttransformResponse: function( data ) {\\n\\t\\t\\t\\t\\t\\treturn convertJsonToObj( data );\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t};\\n\\n\\t\\t\\t// Setup API $resource\\n\\t\\t\\tgetter.api = apiService.request( url, { 'get': action } );\\n\\n\\t\\t\\t// Add Wistia authentication to the request arguments\\n\\t\\t\\tangular.merge( requestArguments, apiKey );\\n\\n\\t\\t\\t// Make request to list media\\n\\t\\t\\tgetter.request = getter.api.get( requestArguments ).$promise.then(\\n\\n\\t\\t\\t\\t// SUCCESS\\n\\t\\t\\t\\tfunction( response ) {\\n\\t\\t\\t\\t\\tvar eventArgs = {\\n\\t\\t\\t\\t\\t\\tuploads: {}\\n\\t\\t\\t\\t\\t};\\n\\n\\t\\t\\t\\t\\t// Received list successfully (account for $promise and $resolved objects)\\n\\t\\t\\t\\t\\tif ( response && Object.keys( response ).length > 2 ) {\\n\\t\\t\\t\\t\\t\\tconsole.log( 'Successfully received the list of media' );\\n\\n\\t\\t\\t\\t\\t\\teventArgs.uploads = response;\\n\\t\\t\\t\\t\\t\\tdelete eventArgs.uploads.$promise;\\n\\t\\t\\t\\t\\t\\tdelete eventArgs.uploads.$resolved;\\n\\n\\t\\t\\t\\t\\t\\t$rootScope.$emit( 'videoListReturned', eventArgs );\\n\\n\\t\\t\\t\\t\\t// Could not receive list\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tconsole.warn( 'Could not receive list.', response );\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t},\\n\\n\\t\\t\\t\\t// FAILURE\\n\\t\\t\\t\\tfunction( error ) {\\n\\t\\t\\t\\t\\tconsole.error( error.data );\\n\\t\\t\\t\\t}\\n\\t\\t\\t);\\n\\t\\t}\",\n \"function getNodeMediaItems(title, commonLocation, eventId, eventHtml) {\\n var url = 'http://localhost:8001/search/combined/';\\n url += encodeURIComponent(title + ' ' + commonLocation);\\n var xhr = new XMLHttpRequest();\\n xhr.onreadystatechange = function() {\\n if (xhr.readyState == 4) {\\n requestReceived();\\n if (xhr.status == 200) {\\n var data = JSON.parse(xhr.responseText);\\n retrieveNodeMediaItemsResults(data, eventId, eventHtml);\\n } else {\\n console.log('Error: Getting media items for the query failed.');\\n }\\n }\\n }\\n xhr.open('GET', url, true);\\n xhr.send();\\n requestSent();\\n}\",\n \"function mediaList(req,res,template,block,next) { \\n \\n // Render the item via the template provided above\\n calipso.theme.renderItem(req,res,template,block,{}); \\n next();\\n \\n}\",\n \"function populateStorages(storageModels) {\\n var queues = [],\\n response = $q.defer(),\\n results = _.where(storageModels, {type: 'areaimage'});\\n\\n // $scope.AreaImages = _.where(storageModels, {type: 'areaimage'});\\n\\n _.each(results, function(image){\\n //populateImage(image);\\n queues.push(Storage.GetFileImageString(image.id));\\n });\\n\\n $q.all(queues)\\n .then(function(images){\\n _.each(results, function(image, i){\\n image.data = images[i];\\n });\\n return response.resolve(results);\\n\\n },\\n function(error){\\n return response.reject(error);\\n });\\n return response.promise;\\n /*\\n $scope.Signature = _.where(storageModels, {type: 'signature'})[0];\\n\\n if ($scope.Signature && $scope.Signature.id.length === 36) {\\n populateImage($scope.Signature);\\n }*/\\n\\n }\",\n \"function getMediasFiles(path, cb) {\\n var medias = {};\\n glob(path, function (err, files) {\\n files.forEach(function (filename) {\\n var infos = pathinfo(filename);\\n medias[infos.basename.toUpperCase()] = {\\n filename: filename,\\n products: []\\n };\\n });\\n cb(medias);\\n })\\n }\",\n \"function queryMediaInfo(paramData) {\\n let url = jjkgalleryRoot + \\\"getMediaInfo.php\\\"\\n fetch(url, {\\n method: 'POST',\\n headers: {'Content-Type': 'application/json'},\\n body: JSON.stringify(paramData)\\n })\\n .then(response => response.json())\\n .then(responseMediaInfo => {\\n // Save media information in a variable in a module (that can be imported into other modules)\\n loadMediaInfo(responseMediaInfo)\\n\\n getMenu = paramData.getMenu\\n if (getMenu) {\\n // Save the menu lists\\n setMenuList(mediaInfo.menuList)\\n categoryList = mediaInfo.categoryList\\n menuFilter = mediaInfo.menuFilter\\n setAlbumList(mediaInfo.albumList)\\n peopleList = mediaInfo.peopleList\\n }\\n\\n // Save the parameters from the laste query\\n queryCategory = paramData.MediaFilterCategory\\n querySearchStr = \\\"\\\"\\n if (paramData.MediaFilterSearchStr != null && paramData.MediaFilterSearchStr != \\\"\\\") {\\n querySearchStr = paramData.MediaFilterSearchStr\\n }\\n queryMenuItem = \\\"\\\"\\n if (paramData.MediaFilterMenuItem != null & paramData.MediaFilterMenuItem != \\\"\\\") {\\n queryMenuItem = paramData.MediaFilterMenuItem\\n }\\n\\n createMediaPage()\\n });\\n }\",\n \"function paintMedias(){\\n $.couch.urlPrefix = \\\"https://socpa.cloudant.com\\\";\\n $.couch.login({\\n name: \\\"socpa\\\",\\n password: \\\"asdargonnijao\\\",\\n success: function(data) {\\n console.log(data);\\n\\n },\\n error: function(status) {\\n console.log(status);\\n }\\n });\\n\\n $.couch.db(\\\"media\\\").view(\\\"media/media\\\", {\\n startkey: [canvas_id],\\n endkey: [canvas_id,{}],\\n reduce: false,\\n success: function(data) {\\n setMedia(data.rows,0)\\n },\\n error: function(status) {\\n console.log(status);\\n }\\n\\n });\\n}\",\n \"function AppMeasurement_Module_Media(q) {\\n var b = this;\\n b.s = q;\\n q = window;\\n q.s_c_in || (q.s_c_il = [], q.s_c_in = 0);\\n b._il = q.s_c_il;\\n b._in = q.s_c_in;\\n b._il[b._in] = b;\\n q.s_c_in++;\\n b._c = \\\"s_m\\\";\\n b.list = [];\\n b.open = function (d, c, e, k) {\\n var f = {},\\n a = new Date,\\n l = \\\"\\\",\\n g;\\n c || (c = -1);\\n if (d && e) {\\n b.list || (b.list = {});\\n b.list[d] && b.close(d);\\n k && k.id && (l = k.id);\\n if (l)\\n for (g in b.list) !Object.prototype[g] && b.list[g] && b.list[g].R == l && b.close(b.list[g].name);\\n f.name = d;\\n f.length = c;\\n f.offset = 0;\\n f.e = 0;\\n f.playerName = b.playerName ? b.playerName : e;\\n f.R = l;\\n f.C = 0;\\n f.a = 0;\\n f.timestamp =\\n Math.floor(a.getTime() / 1E3);\\n f.k = 0;\\n f.u = f.timestamp;\\n f.c = -1;\\n f.n = \\\"\\\";\\n f.g = -1;\\n f.D = 0;\\n f.I = {};\\n f.G = 0;\\n f.m = 0;\\n f.f = \\\"\\\";\\n f.B = 0;\\n f.L = 0;\\n f.A = 0;\\n f.F = 0;\\n f.l = !1;\\n f.v = \\\"\\\";\\n f.J = \\\"\\\";\\n f.K = 0;\\n f.r = !1;\\n f.H = \\\"\\\";\\n f.complete = 0;\\n f.Q = 0;\\n f.p = 0;\\n f.q = 0;\\n b.list[d] = f;\\n }\\n };\\n b.openAd = function (d, c, e, k, f, a, l, g) {\\n var h = {};\\n b.open(d, c, e, g);\\n if (h = b.list[d]) h.l = !0, h.v = k, h.J = f, h.K = a, h.H = l;\\n };\\n b.M = function (d) {\\n var c = b.list[d];\\n b.list[d] = 0;\\n c && c.monitor && clearTimeout(c.monitor.interval);\\n };\\n b.close = function (d) {\\n b.i(d, 0, -1);\\n };\\n b.play = function (d, c, e, k) {\\n var f = b.i(d, 1, c, e, k);\\n f && !f.monitor &&\\n (f.monitor = {}, f.monitor.update = function () {\\n 1 == f.k && b.i(f.name, 3, -1);\\n f.monitor.interval = setTimeout(f.monitor.update, 1E3);\\n }, f.monitor.update());\\n };\\n b.click = function (d, c) {\\n b.i(d, 7, c);\\n };\\n b.complete = function (d, c) {\\n b.i(d, 5, c);\\n };\\n b.stop = function (d, c) {\\n b.i(d, 2, c);\\n };\\n b.track = function (d) {\\n b.i(d, 4, -1);\\n };\\n b.P = function (d, c) {\\n var e = \\\"a.media.\\\",\\n k = d.linkTrackVars,\\n f = d.linkTrackEvents,\\n a = \\\"m_i\\\",\\n l, g = d.contextData,\\n h;\\n c.l && (e += \\\"ad.\\\", c.v && (g[\\\"a.media.name\\\"] = c.v, g[e + \\\"pod\\\"] = c.J, g[e + \\\"podPosition\\\"] = c.K), c.G || (g[e + \\\"CPM\\\"] = c.H));\\n c.r && (g[e + \\\"clicked\\\"] = !0, c.r = !1);\\n g[\\\"a.contentType\\\"] = \\\"video\\\" + (c.l ? \\\"Ad\\\" : \\\"\\\");\\n g[\\\"a.media.channel\\\"] = b.channel;\\n g[e + \\\"name\\\"] = c.name;\\n g[e + \\\"playerName\\\"] = c.playerName;\\n 0 < c.length && (g[e + \\\"length\\\"] = c.length);\\n g[e + \\\"timePlayed\\\"] = Math.floor(c.a);\\n 0 < Math.floor(c.a) && (g[e + \\\"timePlayed\\\"] = Math.floor(c.a));\\n c.G || (g[e + \\\"view\\\"] = !0, a = \\\"m_s\\\", b.Heartbeat && b.Heartbeat.enabled && (a = c.l ? b.__primetime ? \\\"mspa_s\\\" : \\\"msa_s\\\" : b.__primetime ? \\\"msp_s\\\" : \\\"ms_s\\\"), c.G = 1);\\n c.f && (g[e + \\\"segmentNum\\\"] = c.m, g[e + \\\"segment\\\"] = c.f, 0 < c.B && (g[e + \\\"segmentLength\\\"] = c.B), c.A && 0 < c.a && (g[e + \\\"segmentView\\\"] = !0));\\n !c.Q && c.complete && (g[e + \\\"complete\\\"] = !0, c.S = 1);\\n 0 < c.p && (g[e + \\\"milestone\\\"] = c.p);\\n 0 < c.q && (g[e + \\\"offsetMilestone\\\"] = c.q);\\n if (k)\\n for (h in g) Object.prototype[h] || (k += \\\",contextData.\\\" + h);\\n l = g[\\\"a.contentType\\\"];\\n d.pe = a;\\n d.pev3 = l;\\n var q, s;\\n if (b.contextDataMapping)\\n for (h in d.events2 || (d.events2 = \\\"\\\"), k && (k += \\\",events\\\"), b.contextDataMapping)\\n if (!Object.prototype[h]) {\\n a = h.length > e.length && h.substring(0, e.length) == e ? h.substring(e.length) : \\\"\\\";\\n l = b.contextDataMapping[h];\\n if (\\\"string\\\" == typeof l)\\n for (q = l.split(\\\",\\\"), s = 0; s < q.length; s++) l =\\n q[s], \\\"a.contentType\\\" == h ? (k && (k += \\\",\\\" + l), d[l] = g[h]) : \\\"view\\\" == a || \\\"segmentView\\\" == a || \\\"clicked\\\" == a || \\\"complete\\\" == a || \\\"timePlayed\\\" == a || \\\"CPM\\\" == a ? (f && (f += \\\",\\\" + l), \\\"timePlayed\\\" == a || \\\"CPM\\\" == a ? g[h] && (d.events2 += (d.events2 ? \\\",\\\" : \\\"\\\") + l + \\\"=\\\" + g[h]) : g[h] && (d.events2 += (d.events2 ? \\\",\\\" : \\\"\\\") + l)) : \\\"segment\\\" == a && g[h + \\\"Num\\\"] ? (k && (k += \\\",\\\" + l), d[l] = g[h + \\\"Num\\\"] + \\\":\\\" + g[h]) : (k && (k += \\\",\\\" + l), d[l] = g[h]);\\n else if (\\\"milestones\\\" == a || \\\"offsetMilestones\\\" == a) h = h.substring(0, h.length - 1), g[h] && b.contextDataMapping[h + \\\"s\\\"][g[h]] && (f && (f += \\\",\\\" + b.contextDataMapping[h +\\n \\\"s\\\"][g[h]]), d.events2 += (d.events2 ? \\\",\\\" : \\\"\\\") + b.contextDataMapping[h + \\\"s\\\"][g[h]]);\\n g[h] && (g[h] = 0);\\n \\\"segment\\\" == a && g[h + \\\"Num\\\"] && (g[h + \\\"Num\\\"] = 0);\\n }\\n d.linkTrackVars = k;\\n d.linkTrackEvents = f;\\n };\\n b.i = function (d, c, e, k, f) {\\n var a = {},\\n l = (new Date).getTime() / 1E3,\\n g, h, q = b.trackVars,\\n s = b.trackEvents,\\n t = b.trackSeconds,\\n u = b.trackMilestones,\\n v = b.trackOffsetMilestones,\\n w = b.segmentByMilestones,\\n x = b.segmentByOffsetMilestones,\\n p, n, r = 1,\\n m = {},\\n y;\\n b.channel || (b.channel = b.s.w.location.hostname);\\n if (a = d && b.list && b.list[d] ? b.list[d] : 0)\\n if (a.l && (t = b.adTrackSeconds,\\n u = b.adTrackMilestones, v = b.adTrackOffsetMilestones, w = b.adSegmentByMilestones, x = b.adSegmentByOffsetMilestones), 0 > e && (e = 1 == a.k && 0 < a.u ? l - a.u + a.c : a.c), 0 < a.length && (e = e < a.length ? e : a.length), 0 > e && (e = 0), a.offset = e, 0 < a.length && (a.e = a.offset / a.length * 100, a.e = 100 < a.e ? 100 : a.e), 0 > a.c && (a.c = e), y = a.D, m.name = d, m.ad = a.l, m.length = a.length, m.openTime = new Date, m.openTime.setTime(1E3 * a.timestamp), m.offset = a.offset, m.percent = a.e, m.playerName = a.playerName, m.mediaEvent = 0 > a.g ? \\\"OPEN\\\" : 1 == c ? \\\"PLAY\\\" : 2 == c ? \\\"STOP\\\" : 3 == c ? \\\"MONITOR\\\" :\\n 4 == c ? \\\"TRACK\\\" : 5 == c ? \\\"COMPLETE\\\" : 7 == c ? \\\"CLICK\\\" : \\\"CLOSE\\\", 2 < c || c != a.k && (2 != c || 1 == a.k)) {\\n f || (k = a.m, f = a.f);\\n if (c) {\\n 1 == c && (a.c = e);\\n if ((3 >= c || 5 <= c) && 0 <= a.g && (r = !1, q = s = \\\"None\\\", a.g != e)) {\\n h = a.g;\\n h > e && (h = a.c, h > e && (h = e));\\n p = u ? u.split(\\\",\\\") : 0;\\n if (0 < a.length && p && e >= h)\\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) && h / a.length * 100 < g && a.e >= g && (r = !0, n = p.length, m.mediaEvent = \\\"MILESTONE\\\", a.p = m.milestone = g);\\n if ((p = v ? v.split(\\\",\\\") : 0) && e >= h)\\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) && h < g && e >= g && (r = !0, n = p.length, m.mediaEvent =\\n \\\"OFFSET_MILESTONE\\\", a.q = m.offsetMilestone = g);\\n }\\n if (a.L || !f) {\\n if (w && u && 0 < a.length) {\\n if (p = u.split(\\\",\\\"))\\n for (p.push(\\\"100\\\"), n = h = 0; n < p.length; n++)\\n if (g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) a.e < g && (k = n + 1, f = \\\"M:\\\" + h + \\\"-\\\" + g, n = p.length), h = g;\\n } else if (x && v && (p = v.split(\\\",\\\")))\\n for (p.push(\\\"\\\" + (0 < a.length ? a.length : \\\"E\\\")), n = h = 0; n < p.length; n++)\\n if ((g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) || \\\"E\\\" == p[n]) {\\n if (e < g || \\\"E\\\" == p[n]) k = n + 1, f = \\\"O:\\\" + h + \\\"-\\\" + g, n = p.length;\\n h = g;\\n }\\n f && (a.L = !0);\\n } (f || a.f) && f != a.f && (a.F = !0, a.f || (a.m = k, a.f = f), 0 <= a.g && (r = !0));\\n (2 <= c || 100 <= a.e) && a.c < e &&\\n (a.C += e - a.c, a.a += e - a.c);\\n if (2 >= c || 3 == c && !a.k) a.n += (1 == c || 3 == c ? \\\"S\\\" : \\\"E\\\") + Math.floor(e), a.k = 3 == c ? 1 : c;\\n !r && 0 <= a.g && 3 >= c && (t = t ? t : 0) && a.a >= t && (r = !0, m.mediaEvent = \\\"SECONDS\\\");\\n a.u = l;\\n a.c = e;\\n }\\n if (!c || 3 >= c && 100 <= a.e) 2 != a.k && (a.n += \\\"E\\\" + Math.floor(e)), c = 0, q = s = \\\"None\\\", m.mediaEvent = \\\"CLOSE\\\";\\n 7 == c && (r = m.clicked = a.r = !0);\\n if (5 == c || b.completeByCloseOffset && (!c || 100 <= a.e) && 0 < a.length && e >= a.length - b.completeCloseOffsetThreshold) r = m.complete = a.complete = !0;\\n l = m.mediaEvent;\\n \\\"MILESTONE\\\" == l ? l += \\\"_\\\" + m.milestone : \\\"OFFSET_MILESTONE\\\" == l && (l +=\\n \\\"_\\\" + m.offsetMilestone);\\n a.I[l] ? m.eventFirstTime = !1 : (m.eventFirstTime = !0, a.I[l] = 1);\\n m.event = m.mediaEvent;\\n m.timePlayed = a.C;\\n m.segmentNum = a.m;\\n m.segment = a.f;\\n m.segmentLength = a.B;\\n b.monitor && 4 != c && b.monitor(b.s, m);\\n b.Heartbeat && b.Heartbeat.enabled && 0 <= a.g && (r = !1);\\n 0 == c && b.M(d);\\n r && a.D == y && (d = {\\n contextData: {}\\n }, d.linkTrackVars = q, d.linkTrackEvents = s, d.linkTrackVars || (d.linkTrackVars = \\\"\\\"), d.linkTrackEvents || (d.linkTrackEvents = \\\"\\\"), b.P(d, a), d.linkTrackVars || (d[\\\"!linkTrackVars\\\"] = 1), d.linkTrackEvents || (d[\\\"!linkTrackEvents\\\"] =\\n 1), b.s.track(d), a.F ? (a.m = k, a.f = f, a.A = !0, a.F = !1) : 0 < a.a && (a.A = !1), a.n = \\\"\\\", a.p = a.q = 0, a.a -= Math.floor(a.a), a.g = e, a.D++);\\n }\\n return a;\\n };\\n b.O = function (d, c, e, k, f) {\\n var a = 0;\\n if (d && (!b.autoTrackMediaLengthRequired || c && 0 < c)) {\\n if (b.list && b.list[d]) a = 1;\\n else if (1 == e || 3 == e) b.open(d, c, \\\"HTML5 Video\\\", f), a = 1;\\n a && b.i(d, e, k, -1, 0);\\n }\\n };\\n b.attach = function (d) {\\n var c, e, k;\\n d && d.tagName && \\\"VIDEO\\\" == d.tagName.toUpperCase() && (b.o || (b.o = function (c, a, d) {\\n var e, h;\\n b.autoTrack && (e = c.currentSrc, (h = c.duration) || (h = -1), 0 > d && (d = c.currentTime), b.O(e, h, a,\\n d, c));\\n }), c = function () {\\n b.o(d, 1, -1);\\n }, e = function () {\\n b.o(d, 1, -1);\\n }, b.j(d, \\\"play\\\", c), b.j(d, \\\"pause\\\", e), b.j(d, \\\"seeking\\\", e), b.j(d, \\\"seeked\\\", c), b.j(d, \\\"ended\\\", function () {\\n b.o(d, 0, -1);\\n }), b.j(d, \\\"timeupdate\\\", c), k = function () {\\n d.paused || d.ended || d.seeking || b.o(d, 3, -1);\\n setTimeout(k, 1E3);\\n }, k());\\n };\\n b.j = function (b, c, e) {\\n b.attachEvent ? b.attachEvent(\\\"on\\\" + c, e) : b.addEventListener && b.addEventListener(c, e, !1);\\n };\\n void 0 == b.completeByCloseOffset && (b.completeByCloseOffset = 1);\\n void 0 == b.completeCloseOffsetThreshold && (b.completeCloseOffsetThreshold =\\n 1);\\n b.Heartbeat = {};\\n b.N = function () {\\n var d, c;\\n if (b.autoTrack && (d = b.s.d.getElementsByTagName(\\\"VIDEO\\\")))\\n for (c = 0; c < d.length; c++) b.attach(d[c]);\\n };\\n b.j(q, \\\"load\\\", b.N);\\n }\",\n \"function handleMediaManagerSelect(fileData){\\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\\n}\",\n \"async findSoundtrack(ctx, payload) {\\n let music = [];\\n if(payload.title != '' && payload.artist != '') {\\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\\n } else if(payload.title == '' && payload.artist != '') {\\n music = await axios.get('https://api.discogs.com/database/search?genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\\n } else if(payload.title != '' && payload.artist == '') {\\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&token='+token.token)\\n }\\n let list = music.data.results.slice(music.data.results[0]);\\n ctx.commit('setSoundtrackSearchResult', list);\\n }\",\n \"function getAllImages(){\\n var contents = Contents_Live.find({ \\\"code\\\": Session.get(\\\"UserLogged\\\").code });\\n var imagesArray = [];\\n contents.forEach(function(doc){\\n var res = doc.contentType.split(\\\"/\\\");\\n if(res[0] == \\\"image\\\"){\\n var obj = {\\n '_id': doc._id,\\n 'imageName': doc.contentName\\n };\\n imagesArray.push(obj);\\n }\\n });\\n if(imagesArray.length > 0){\\n return imagesArray;\\n }else{\\n return null;\\n }\\n}\",\n \"static getMedium(id){\\n return fetch(`${BASE_URL}media/${id}`)\\n .then(res => res.json())\\n }\",\n \"function getSongs(callback) {\\n\\n}\",\n \"function getMediaItems(title, commonLocation, lat, long, eventId, eventHtml) {\\n getNodeMediaItems(title, commonLocation, eventId, eventHtml);\\n // getTeleportdMediaItems(title, lat, long, eventId, eventHtml); // ficken\\n}\",\n \"function retrieveNodeMediaItemsResults(data, eventId, eventHtml) {\\n var socialNetworks = Object.keys(data);\\n // check if we have media at all, a bit ugly, but works\\n var mediaExist = false;\\n for (var i = 0, len = socialNetworks.length; i < len; i++) {\\n var media = data[socialNetworks[i]];\\n if (media.length) {\\n mediaExist = true;\\n break;\\n }\\n }\\n if (mediaExist) {\\n var html = '';\\n socialNetworks.forEach(function(socialNetwork) {\\n var media = data[socialNetwork];\\n media.forEach(function(mediaItem) {\\n if (mediaItem.type === 'photo') {\\n if ((!eventMediaItems[eventId][mediaItem.mediaurl]) &&\\n // TODO: very lame way to remove spammy messages with just too\\n // much characters\\n (mediaItem.micropost.plainText.length <= 500)) {\\n html += htmlFactory.media(\\n mediaItem.mediaUrl,\\n mediaItem.micropost.plainText,\\n mediaItem.micropostUrl);\\n eventMediaItems[eventId][mediaItem.mediaUrl] = true;\\n addBackgroundImage(eventPages[eventId], mediaItem.mediaUrl);\\n }\\n }\\n });\\n });\\n addPageContent(eventPages[eventId], html);\\n }\\n // no media exist\\n else {\\n // ugly hack: getMediaItems gets called two times,\\n // so only delete the second time we get no media\\n var page = eventPages[eventId];\\n var times = page.data('noMediaExistTimes') || 0;\\n times++;\\n page.data('noMediaExistTimes', times);\\n\\n // remove the page from the flipbook\\n if (times == 2) {\\n // find the right pagenumber by looping through all pages (sigh…)\\n var pages = $('#flipbook').data('pageObjs');\\n for (var pageNumber in pages) {\\n if (pages[pageNumber][0] === page[0]) {\\n $('#flipbook').turn('removePage', pageNumber);\\n break;\\n }\\n }\\n }\\n }\\n}\",\n \"function getMedia() {\\n\\tvar results = [];\\n\\n\\tif (extensions && extensions.hasOwnProperty('media')) {\\n\\t\\tvar sourceArray = extensions.media;\\n\\n\\t\\tfor (index = 0; index < sourceArray.length; ++index) {\\n\\t\\t results.push(sourceArray[index]);\\n\\t\\t}\\n\\t}\\n\\n\\treturn results;\\n}\",\n \"function getMediaInfos() {\\n var mediaInfos = adapter.getAllMediaInfoForType(streamInfo, constants.VIDEO);\\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.AUDIO));\\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.TEXT)); // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.MUXED));\\n // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.IMAGE));\\n\\n eventBus.trigger(events.OFFLINE_RECORD_LOADEDMETADATA, {\\n id: manifestId,\\n mediaInfos: mediaInfos\\n });\\n }\",\n \"function getProductMedia(id, media_type) {\\n var deferred = $q.defer();\\n var query = \\\"SELECT * FROM product_media WHERE product_id = ? AND product_media_type = ?\\\";\\n mysql.query(query, [id, media_type], function (err, rows) {\\n if (err) deferred.reject(err);\\n deferred.resolve(rows);\\n });\\n return deferred.promise;\\n }\",\n \"function getMediaQueryString(refreshToken) {\\n let csrfToken = getCookie('csrf-token')\\n\\tlet mediaToken = refreshToken ? md5(refreshToken) : '';\\n return '_csrf='+csrfToken+'&_media='+mediaToken\\n}\",\n \"function deleteMedias(){\\n imagesToRemove = []\\n console.log(\\\"BORRANDO\\\")\\n $.couch.urlPrefix = \\\"https://socpa.cloudant.com\\\";\\n $.couch.login({\\n name: \\\"socpa\\\",\\n password: \\\"asdargonnijao\\\"\\n });\\n\\n return $.couch.db(\\\"media\\\").view(\\\"todelete/todelete\\\", {\\n key: canvas_id,\\n reduce: false,\\n success: function(data) {\\n\\n },\\n error: function(status) {\\n console.log(status);\\n }\\n\\n })\\n}\",\n \"function getSongs() {\\n\\n var spotify = new Spotify(keys.spotify);\\n\\n var songName = process.argv[3];\\n\\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (err, data) {\\n if (err) {\\n return console.log('Error occurred: ' + err);\\n }\\n\\n console.log(data.tracks.items[0].artists[0].name);\\n console.log(data.tracks.items[0].album.name);\\n console.log(data.tracks.items[0].name);\\n console.log(data.tracks.items[0].external_urls.spotify);\\n });\\n\\n\\n}\",\n \"getAllSongs() {\\n Utils.get('/allSongs')\\n .then((response) => {\\n return response.json();\\n })\\n .then((json) => {\\n Dispatcher.dispatch({\\n type: ActionType.RECEIVE_ALL_SONGS,\\n songs: json\\n })\\n })\\n .catch((err) => {\\n console.error('failed: ', err)\\n })\\n }\",\n \"function addMedia(type,media){\\n //assumption ki tabhi chlega jb dbAccess hoga\\n let tx = dbAccess.transaction(\\\"gallery\\\",\\\"readwrite\\\");\\n let galleryObjectStore = tx.objectStore(\\\"gallery\\\");\\n let data={\\n mId : Date.now(),\\n type,\\n media,\\n };\\n galleryObjectStore.add(data);\\n}\",\n \"function getMedia() {\\n\\tvar results = [];\\n\\n\\tif (config.hasOwnProperty('extensions') && config.extensions.hasOwnProperty('media')) {\\n\\t\\tvar sourceArray = config.extensions.media;\\n\\n\\t\\tfor (index = 0; index < sourceArray.length; ++index) {\\n\\t\\t results.push(sourceArray[index]);\\n\\t\\t}\\n\\t}\\n\\n\\treturn results;\\n}\",\n \"function addAlbum(albumID) {\\n var query = \\\" SELECT concat('file://','/', u.rpath)\\\";\\n query += \\\" FROM tracks t, urls u\\\";\\n query += \\\" where t.album=\\\"+albumID;\\n query += \\\" and t.url=u.id\\\";\\n query += \\\" order by t.discnumber, t.tracknumber\\\";\\n var result = sql(query);\\n for (var i=0; i < result.length; i++) {\\n Amarok.Playlist.addMedia(new QUrl(result[i]));\\n }\\n}\",\n \"function mediaHandler ( info, tab ) {\\n sendItem( { 'imageUrl': info.srcUrl } );\\n}\",\n \"async function getMedia() {\\n let results = res.map(post => { \\n // return fetchMediaWithUrl(post[\\\"_links\\\"][\\\"wp:featuredmedia\\\"][0].href).then(images => {\\n // const thumb = images[\\\"media_details\\\"].sizes.thumbnail.source_url;\\n const title = post.title.rendered;\\n const postId = post.id;\\n const thumb = post.featured_media_src_url;\\n // console.log(post.featured_media_src_url);\\n // console.log(thumb);\\n return { title: title, thumb: thumb, id: postId };\\n //});\\n });\\n //return Promise.all(results);\\n return results;\\n}\",\n \"function pubMedia(req, res) {\\n return _media2.default.find({ 'pub': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\\n}\",\n \"function filter (type,id_carousel){\\n $(id_carousel + \\\" ol\\\").empty();\\n $(id_carousel + \\\" .carousel-inner\\\").empty();\\n var url;\\n if (type !== \\\"all\\\"){\\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&album_type='+type+'&limit=40';\\n }else{\\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&limit=40';\\n }\\n \\n request(url,\\\"load_albums\\\",id_carousel);\\n}\",\n \"static addSongs() {\\n fetch(\\\"https://itunes.apple.com/us/rss/topalbums/limit=100/json\\\")\\n .then(resp => resp.json())\\n .then(data => {\\n let i = 1;\\n data.feed.entry.forEach(album => {\\n let newCard = new Album(i, album[\\\"im:image\\\"][0].label, album[\\\"im:name\\\"].label, album[\\\"im:artist\\\"].label, album[\\\"id\\\"].label, album[\\\"im:price\\\"].label, album[\\\"im:releaseDate\\\"].label)\\n i++;\\n Album.all.push(newCard);\\n });\\n })\\n }\",\n \"function allAccessSearch() {\\n var deferred = Q.defer();\\n\\n that.pm.search(query, 25, function(err, data) {\\n if (err) { deferred.reject(err); return; }\\n\\n var songs = (data.entries || []).map(function(res) {\\n var ret = {};\\n\\n ret.score = res.score;\\n\\n if (res.type == \\\"1\\\") {\\n ret.type = \\\"track\\\";\\n ret.track = that._parseTrackObject(res.track);\\n }\\n else if (res.type == \\\"2\\\") {\\n ret.type = \\\"artist\\\";\\n ret.artist = res.artist;\\n }\\n else if (res.type == \\\"3\\\") {\\n ret.type = \\\"album\\\";\\n ret.album = res.album;\\n }\\n\\n return ret;\\n });\\n\\n deferred.resolve(songs);\\n });\\n\\n return deferred.promise;\\n }\",\n \"function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\\\"s_m\\\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\\\"\\\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\\r\\n\\t\\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\\\"\\\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\\\"\\\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\\\"\\\";d.I=\\\"\\\";d.J=0;d.q=!1;d.G=\\\"\\\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\\r\\n\\t\\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\\\"a.media.\\\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\\\"m_i\\\",g,e=w.contextData,f;if(b.l){c+=\\\"ad.\\\";if(b.v)e[\\\"a.media.name\\\"]=b.v,e[c+\\\"pod\\\"]=b.I,e[c+\\\"podPosition\\\"]=b.J;if(!b.F)e[c+\\\"CPM\\\"]=b.G}if(b.q)e[c+\\\"clicked\\\"]=!0,b.q=!1;e[\\\"a.contentType\\\"]=\\r\\n\\t\\t\\\"video\\\"+(b.l?\\\"Ad\\\":\\\"\\\");e[\\\"a.media.channel\\\"]=m.channel;e[c+\\\"name\\\"]=b.name;e[c+\\\"playerName\\\"]=b.playerName;if(b.length>0)e[c+\\\"length\\\"]=b.length;e[c+\\\"timePlayed\\\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\\\"timePlayed\\\"]=Math.floor(b.f));if(!b.F)e[c+\\\"view\\\"]=!0,a=\\\"m_s\\\",b.F=1;if(b.e){e[c+\\\"segmentNum\\\"]=b.m;e[c+\\\"segment\\\"]=b.e;if(b.A>0)e[c+\\\"segmentLength\\\"]=b.A;b.z&&b.f>0&&(e[c+\\\"segmentView\\\"]=!0)}if(!b.Q&&b.complete)e[c+\\\"complete\\\"]=!0,b.T=1;if(b.o>0)e[c+\\\"milestone\\\"]=b.o;if(b.p>0)e[c+\\\"offsetMilestone\\\"]=b.p;if(h)for(f in e)Object.prototype[f]||\\r\\n\\t\\t(h+=\\\",contextData.\\\"+f);g=e[\\\"a.contentType\\\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\\\"\\\";h&&(h+=\\\",events\\\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\\\"\\\";g=m.contextDataMapping[f];if(typeof g==\\\"string\\\"){s=g.split(\\\",\\\");for(n=0;n0?g-a.r+a.a:\\r\\n\\t\\ta.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\\\"OPEN\\\":b==1?\\\"PLAY\\\":b==2?\\\"STOP\\\":b==3?\\\"MONITOR\\\":b==4?\\\"TRACK\\\":b==5?\\\"COMPLETE\\\":b==7?\\\"CLICK\\\":\\\"CLOSE\\\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\\r\\n\\t\\t\\\"None\\\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\\\",\\\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"MILESTONE\\\",a.o=i.milestone=e;if((k=q?q.split(\\\",\\\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"OFFSET_MILESTONE\\\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\\\",\\\")){k.push(\\\"100\\\");for(j=f=0;j0?a.length:\\\"E\\\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\\r\\n\\t\\t\\\"SECONDS\\\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\\\"E\\\"+Math.floor(c)),b=0,s=n=\\\"None\\\",i.mediaEvent=\\\"CLOSE\\\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\\\"MILESTONE\\\"?g+=\\\"_\\\"+i.milestone:g==\\\"OFFSET_MILESTONE\\\"&&(g+=\\\"_\\\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\\r\\n\\t\\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\\\"\\\";if(!w.linkTrackEvents)w.linkTrackEvents=\\\"\\\";m.P(w,a);w.linkTrackVars||(w[\\\"!linkTrackVars\\\"]=1);w.linkTrackEvents||(w[\\\"!linkTrackEvents\\\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\\\"\\\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\\r\\n\\t\\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\\\"HTML5 Video\\\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\\\"VIDEO\\\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\\\"play\\\",b);m.i(w,\\\"pause\\\",c);m.i(w,\\\"seeking\\\",c);m.i(w,\\\"seeked\\\",b);m.i(w,\\\"ended\\\",function(){m.n(w,0,-1)});m.i(w,\\\"timeupdate\\\",\\r\\n\\t\\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\\\"on\\\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\\\"VIDEO\\\")))for(b=0;b0)e[c+\\\"length\\\"]=b.length;e[c+\\\"timePlayed\\\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\\\"timePlayed\\\"]=Math.floor(b.f));if(!b.F)e[c+\\\"view\\\"]=!0,a=\\\"m_s\\\",b.F=1;if(b.e){e[c+\\\"segmentNum\\\"]=b.m;e[c+\\\"segment\\\"]=b.e;if(b.A>0)e[c+\\\"segmentLength\\\"]=b.A;b.z&&b.f>0&&(e[c+\\\"segmentView\\\"]=!0)}if(!b.Q&&b.complete)e[c+\\\"complete\\\"]=!0,b.T=1;if(b.o>0)e[c+\\\"milestone\\\"]=b.o;if(b.p>0)e[c+\\\"offsetMilestone\\\"]=b.p;if(h)for(f in e)Object.prototype[f]||\\r\\n(h+=\\\",contextData.\\\"+f);g=e[\\\"a.contentType\\\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\\\"\\\";h&&(h+=\\\",events\\\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\\\"\\\";g=m.contextDataMapping[f];if(typeof g==\\\"string\\\"){s=g.split(\\\",\\\");for(n=0;n0?g-a.r+a.a:\\r\\na.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\\\"OPEN\\\":b==1?\\\"PLAY\\\":b==2?\\\"STOP\\\":b==3?\\\"MONITOR\\\":b==4?\\\"TRACK\\\":b==5?\\\"COMPLETE\\\":b==7?\\\"CLICK\\\":\\\"CLOSE\\\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\\r\\n\\\"None\\\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\\\",\\\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"MILESTONE\\\",a.o=i.milestone=e;if((k=q?q.split(\\\",\\\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"OFFSET_MILESTONE\\\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\\\",\\\")){k.push(\\\"100\\\");for(j=f=0;j0?a.length:\\\"E\\\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\\r\\n\\\"SECONDS\\\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\\\"E\\\"+Math.floor(c)),b=0,s=n=\\\"None\\\",i.mediaEvent=\\\"CLOSE\\\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\\\"MILESTONE\\\"?g+=\\\"_\\\"+i.milestone:g==\\\"OFFSET_MILESTONE\\\"&&(g+=\\\"_\\\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\\r\\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\\\"\\\";if(!w.linkTrackEvents)w.linkTrackEvents=\\\"\\\";m.P(w,a);w.linkTrackVars||(w[\\\"!linkTrackVars\\\"]=1);w.linkTrackEvents||(w[\\\"!linkTrackEvents\\\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\\\"\\\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\\r\\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\\\"HTML5 Video\\\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\\\"VIDEO\\\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\\\"play\\\",b);m.i(w,\\\"pause\\\",c);m.i(w,\\\"seeking\\\",c);m.i(w,\\\"seeked\\\",b);m.i(w,\\\"ended\\\",function(){m.n(w,0,-1)});m.i(w,\\\"timeupdate\\\",\\r\\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\\\"on\\\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\\\"VIDEO\\\")))for(b=0;b photo[\\\"@size\\\"] === \\\"pn\\\");\\n }\\n\\n return { photos };\\n }\",\n \"function similarItems(media_type, id){\\n tmdb_url = `https://api.themoviedb.org/3/${media_type}/${id}/similar?api_key=${api_key}&language=en-US&page=1`;\\n try{\\n const promise = axios.get(tmdb_url);\\n const pm_data = promise.then(response => processSmallCarousel(response.data, media_type));\\n return pm_data;\\n } catch(error) {\\n console.error(error);\\n }\\n}\",\n \"static listMusic() {\\n let music = new Array();\\n\\n music.push('sounds/music/incompetech/delightful_d.ogg');\\n music.push('sounds/music/incompetech/twisting.ogg'); // Moody, good for cave.\\n music.push('sounds/music/incompetech/pookatori_and_friends.ogg');\\n music.push('sounds/music/incompetech/getting_it_done.ogg');\\n music.push('sounds/music/incompetech/robobozo.ogg');\\n music.push('sounds/music/incompetech/balloon_game.ogg');\\n music.push('sounds/music/incompetech/cold_sober.ogg');\\n music.push('sounds/music/incompetech/salty_ditty.ogg');\\n music.push('sounds/music/incompetech/townie_loop.ogg'); // Very peaceful, flute.\\n music.push('sounds/music/incompetech/mega_hyper_ultrastorm.ogg'); // Super energetic. Maybe for special.\\n // Legacy\\n music.push('sounds/music/music_peaceful_contemplative_starling.ogg');\\n music.push('sounds/music/twinmusicom_8_bit_march.ogg');\\n music.push('sounds/music/twinmusicom_nes_overworld.ogg');\\n music.push('sounds/music/music_juhanijunkala_chiptune_01.ogg');\\n\\n return music;\\n }\",\n \"function mediaqueryresponse(mql){\\n\\t\\t\\t\\tif (mql.matches) { // if media query matches\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t} else if (!mql.matches) {\\n\\t\\t\\t\\t\\tsetupServices();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"get media () {\\n\\n\\t\\tif (typeof this.elements === 'undefined') {\\n\\t\\t\\tthrow Error('Cannot access media until publication is loaded');\\n\\t\\t}\\n\\n\\t\\treturn this.elements.filter(({ type }) => {\\n\\t\\t\\treturn type === 'media';\\n\\t\\t}).map(({ data }) => {\\n\\t\\t\\treturn new Media(data);\\n\\t\\t});\\n\\t}\",\n \"function findSong(savedArrayOfChoices) {\\n // declaring all vars according to savedArrayOfChoices \\n var pickCountry = savedArrayOfChoices[0];\\n var pickArtist = savedArrayOfChoices[1];\\n var pickRelatedArtist = savedArrayOfChoices[2];\\n var pickAlbum = savedArrayOfChoices[3];\\n var pickSong = savedArrayOfChoices[4];\\n\\n // pushing country into chartQuery, returns artist\\n var chartQuery = `chart.artists.get?page=1&page_size=4&country=${pickCountry}`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n\\n // declaring artistId and artistname\\n var artistId = music.message.body.artist_list[pickArtist].artist.artist_id;\\n var artistName = music.message.body.artist_list[pickArtist].artist.artist_name;\\n\\n // pushing artistid, returns related artist\\n var chartQuery = `artist.related.get?artist_id=${artistId}&page_size=4&page=1`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n\\n // declaring related artist id and name\\n var relatedArtistId;\\n var relatedArtistName;\\n\\n // if no related artists, just use artist\\n if (music.message.body.artist_list.length === 0) {\\n relatedArtistId = artistId;\\n relatedArtistName = artistName;\\n }\\n // otherwise use the related artist\\n else {\\n relatedArtistId = music.message.body.artist_list[pickRelatedArtist].artist.artist_id;\\n relatedArtistName = music.message.body.artist_list[pickRelatedArtist].artist.artist_name;\\n\\n }\\n\\n // pushing relatedArtistId, returns album\\n var chartQuery = `artist.albums.get?artist_id=${relatedArtistId}&s_release_date=desc&page_size=4`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n\\n // declaring album id\\n var albumId\\n\\n // if statements for if the artist doesn't have 4 albums\\n if (music.message.body.album_list.length === pickSong) {\\n albumId = music.message.body.album_list[pickAlbum].album.album_id;\\n }\\n else if (music.message.body.album_list.length === 3) {\\n albumId = music.message.body.album_list[2].album.album_id;\\n\\n }\\n else if (music.message.body.album_list.length === 2) {\\n albumId = music.message.body.album_list[1].album.album_id;\\n }\\n else {\\n albumId = music.message.body.album_list[0].album.album_id;\\n\\n }\\n\\n // pushing albumID, returns song\\n var chartQuery = `album.tracks.get?album_id=${albumId}&page=1&page_size=4`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n // declaring song name\\n var songName;\\n\\n // if statements for if the album doesn't have 4 songs\\n if (music.message.body.track_list.length === pickSong) {\\n songName = music.message.body.track_list[pickSong].track.track_name;\\n\\n }\\n else if (music.message.body.track_list.length === 3) {\\n songName = music.message.body.track_list[2].track.track_name;\\n\\n }\\n else if (music.message.body.track_list.length === 2) {\\n songName = music.message.body.track_list[1].track.track_name;\\n\\n }\\n else {\\n songName = music.message.body.track_list[0].track.track_name;\\n\\n }\\n // finds video with youtube api\\n getVideo(`${songName} ${relatedArtistName}`);\\n\\n // sets the text of final-artist-song to the song and artist that is found\\n $(\\\"#final-artist-song\\\").text(`${songName} by ${relatedArtistName}`);\\n });\\n });\\n });\\n });\\n}\",\n \"function getEmbededMedia(item, cb) {\\n\\tvar oembed,\\n\\t\\tu = '',\\n\\t\\thost = url.parse(item.url).host,\\n\\t\\t\\to = {\\n\\t\\t\\t\\turl: item.url,\\n\\t\\t\\t\\tmaxwidth: item.maxwidth//435,\\n\\t\\t\\t\\t//maxheight: 244\\n\\t\\t\\t};\\n\\t\\n\\tif (host.match(/vimeo.com/ig)) {\\n\\t\\tu = config.vimeo.oembed_url + '?' + qs.stringify(o);\\n\\t} else if (host.match(/youtube.com|youtu.be/ig)) {\\n\\t\\to.format = 'json';\\n\\t\\tu = config.youtube.oembed_url + '?' + qs.stringify(o);\\n\\t} else if (host.match(/instagr.am|instagram/)) {\\n\\t\\tu = config.instagram.oembed_url + '?' + qs.stringify(o);\\n\\t}\\n\\telse return cb(null, {});\\n\\t\\n\\tr.get({url: u, json: true}, function(err, resp, body) {\\n\\t\\tif (!err && resp.statusCode === 200) {\\n\\t\\t\\treturn cb(null, body);\\n\\t\\t} else {\\n\\t\\t\\tif (err) return cb(err);\\n\\t\\t\\telse if (err instanceof Error) return cb(new Error(err));\\n\\t\\t\\telse return cb(new Error(body.errors[0].message));\\n\\t\\t}\\n\\t});\\n}\",\n \"function getRecentMediaByTag(tag) {\\r\\n\\tvar url = \\\"https://api.instagram.com/v1/tags/\\\"\\r\\n\\t\\t\\t+ tag\\r\\n\\t\\t\\t+ \\\"/media/recent\\\"\\r\\n\\t\\t\\t+ \\\"?callback=?&access_token=539668504.2c39d74.5b6021beec4048f0bdba845c38919103&client_id=97bf64bca67344afbbe8ea64caa8e617\\\";\\r\\n\\r\\n\\t$.getJSON(url, cacheData);\\r\\n}\",\n \"function findAll(done) {\\n _connect(function(err, db) {\\n if (err) return done(err);\\n db.collection('mediaentries').find({}, done);\\n });\\n }\",\n \"function getMediaElements(where) {\\n return getElementsByTagName(\\\"media:content\\\", where).map((elem) => {\\n const { attribs } = elem;\\n const media = {\\n medium: attribs[\\\"medium\\\"],\\n isDefault: !!attribs[\\\"isDefault\\\"],\\n };\\n for (const attrib of MEDIA_KEYS_STRING) {\\n if (attribs[attrib]) {\\n media[attrib] = attribs[attrib];\\n }\\n }\\n for (const attrib of MEDIA_KEYS_INT) {\\n if (attribs[attrib]) {\\n media[attrib] = parseInt(attribs[attrib], 10);\\n }\\n }\\n if (attribs[\\\"expression\\\"]) {\\n media.expression = attribs[\\\"expression\\\"];\\n }\\n return media;\\n });\\n}\",\n \"medias() {\\n\\t\\treturn this.recentlyAddedMedias.concat(this.initialMedias)\\n\\t}\",\n \"function getMedia(event) {\\n event.preventDefault();\\n\\n let url = `/media/${this.getAttribute('href')}`;\\n\\n fetch(url)\\n .then(res => res.json())\\n .then(data => {\\n showMedia(data);\\n })\\n .catch((err) => console.log(err));\\n\\n\\n for (let i = 0; i < navLink.length; i++) {\\n navLink[i].classList.remove('navSelected'); // Removes selected class from all nav links\\n }\\n this.classList.add('navSelected'); // Adds selected class to chosen nav link\\n }\",\n \"function html5media() {\\n scanElementsByTagName(\\\"video\\\");\\n scanElementsByTagName(\\\"audio\\\");\\n }\",\n \"function getItems(lat, lng, miles, imagelist) {\\n //console.log(\\\"search service\\\", imagelist);\\n var distance=\\\"false\\\";\\n if (miles) {\\n distance=\\\"true\\\";\\n }\\n // return items.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\\\"asc\\\"});\\n return Image.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\\\"asc\\\"});\\n\\n }\",\n \"function cmd(a,b,c){var d=\\\"\\\";if(b.mode==\\\"user\\\"){d=\\\"https://api.instagram.com/v1/users/\\\"+c+\\\"/media/recent/?callback=?\\\"}else{d=\\\"https://api.instagram.com/v1/media/popular?callback=?\\\"}$.getJSON(d,a,function(a){onPhotoLoaded(a,b)})}\",\n \"function html5media() {\\r\\n scanElementsByTagName(\\\"video\\\");\\r\\n scanElementsByTagName(\\\"audio\\\");\\r\\n }\",\n \"async list(queryObj) {\\n const result = await this.doRequest({\\n path: \\\"/files\\\",\\n method: \\\"GET\\\",\\n params: {\\n path: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.path) || \\\"/\\\",\\n pagination_token: queryObj === null || queryObj === void 0 ? void 0 : queryObj.paginationToken,\\n qty: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.quantity) || 300,\\n },\\n });\\n return result;\\n }\",\n \"function mediaMgmt()\\r\\n{\\r\\n this.ucatMediaClass();\\r\\n this.setupMedia = function (containerElement, options)\\r\\n {\\r\\n //AUDIO OR VIDEO\\r\\n $(containerElement).find(\\\"audio, video\\\").each(function ()\\r\\n {\\r\\n var tag = $(this);\\r\\n //Only convert media if not already converted;\\r\\n if(!$(this).hasClass(\\\"ucatMEdiaTag\\\")){\\r\\n $(this).addClass(\\\"ucatMEdiaTag\\\");\\r\\n var mediaType = tag.prop(\\\"tagName\\\").toLowerCase();//Audio or video\\r\\n var argumentOptions = mediaType == 'audio' ? options.audio : options.video;\\r\\n var transcriptHighlights = options.transcriptHighlights;\\r\\n var defaultOptions = mediaType == 'audio' ? defaultUcatAudioOptions : defaultUcatVideoOptions\\r\\n reconcileGlobalVariable(argumentOptions, defaultOptions);\\r\\n var tagOptions = copyGlobalVariable(argumentOptions);\\r\\n $.each(tag[0].dataset, function (key, value)\\r\\n {\\r\\n var valueType = typeof (defaultOptions[key]);\\r\\n switch (valueType)\\r\\n {\\r\\n case \\\"boolean\\\":\\r\\n value = parseBoolean(value);\\r\\n break;\\r\\n case \\\"number\\\":\\r\\n value = parseInt(value);\\r\\n break;\\r\\n default:\\r\\n value = String(value);\\r\\n break;\\r\\n }\\r\\n tagOptions[key] = value;\\r\\n });\\r\\n //The media browser plug-in passes the videosizetitle as a data-attribute;\\r\\n //legacy media should use standard playersize as fallback\\r\\n tagOptions.videosize = tagOptions.videosizetitle ? window[tagOptions.videosizetitle] : standardVideoPlayer;\\r\\n tagOptions.transcriptHighlights = transcriptHighlights;\\r\\n for (var th = 0; th < tagOptions.transcriptHighlights.length; th++)\\r\\n {\\r\\n tagOptions.transcriptHighlights[th].visible = true;\\r\\n }\\r\\n //Addded to force complete download of media\\r\\n // tag.attr(\\\"preload\\\",\\\"auto\\\");\\r\\n\\r\\n //simply means that the browser has loaded enough meta-data to know the media’s .duration\\r\\n tag.on('loadedmetadata', { o: tagOptions }, function (e)\\r\\n {\\r\\n ucatAudioVideo(containerElement, this, e.data.o)\\r\\n });\\r\\n }\\r\\n });\\r\\n\\r\\n //Other file types\\r\\n $(containerElement).find(\\\".doc, .xls, .ppt, .pdf, .file\\\").each(function ()\\r\\n {\\r\\n setupDocumentLink($(this));\\r\\n });\\r\\n }\\r\\n\\r\\n return this;\\r\\n}\",\n \"function getAll(){\\n\\tvar pictures = document.getElementById(\\\"picture\\\");\\n\\taudio.src = SingleList[i].audio;\\n\\tpictures.src = SingleList[i].picture;\\n\\t$('#nowplay').html(SingleList[i].artistSong());\\n\\t\\n\\taudio.play();\\n\\n}\",\n \"function getTracks(searchTerm, limit, tracksDiv, ids, playlistID) {\\n\\n if(!ids) {\\n var filter = {\\n q : searchTerm,\\n limit : limit\\n }\\n } else {\\n var filter = {\\n ids : ids\\n }\\n }\\n\\n SC.get('/tracks/', filter, function(tracks, error) {\\n if(tracks) {\\n tracksDiv.html('');\\n\\n $.each(tracks, function(key, track){\\n\\n var pictureUrl;\\n var genre;\\n var wrapper;\\n\\n if(track.artwork_url == null)\\n pictureUrl = 'includes/imgs/no-image.jpg';\\n else\\n pictureUrl = track.artwork_url;\\n\\n if(track.genre == null)\\n genre = \\\"Undefined\\\";\\n else\\n genre = track.genre.trunc(15);\\n\\n var title = $(''+track.title.trunc(40)+'');\\n var stats = $('
    '+track.playback_count+' '+track.comment_count+' '+track.favoritings_count+' '+genre+'
    ');\\n var player = $('
    ');\\n var clear = $('
    ');\\n var wrapper = $('
  • \\\"'+track.title+'\\\"
  • ');\\n \\n wrapper.append(title).append(player).append(stats).append(clear);\\n if(playlistID) {\\n var remove = $('
    ');\\n wrapper.append(remove);\\n }\\n tracksDiv.append(wrapper);\\n\\n player.scPlayer({\\n links: [{url: track.permalink_url, title: track.title}]\\n });\\n\\n wrapper.draggable({\\n stack: '#tracks li',\\n revert: true,\\n cursor: 'move',\\n containment: '#content'\\n });\\n });\\n\\n if(error)\\n tracksDiv.html('

    No tracks found.

    ');\\n\\n } else {\\n console.log(\\\"The get statement must be wrong.\\\");\\n //triggerNotification(error);\\n }\\n\\n });\\n}\",\n \"function processMulti(response){\\n response = response.results;\\n results_list = [];\\n var i = 0;\\n while(results_list.length < 7 && i < response.length){\\n if(response[i].media_type === 'movie' || response[i].media_type === 'tv'){\\n\\n if(response[i].backdrop_path !== undefined && response[i].backdrop_path !== null\\n\\t && response[i].poster_path !== undefined && response[i].poster_path !== null){\\n m_item = {}\\n m_item['id'] = response[i].id;\\n m_item['backdrop_path'] = \\\"https://image.tmdb.org/t/p/w500\\\" + response[i].backdrop_path\\n m_item['media_type'] = response[i].media_type;\\n\\n field_name = \\\"title\\\";\\n if(response[i].media_type === \\\"tv\\\"){\\n field_name = \\\"name\\\";\\n }\\n if(response[i][field_name] !== undefined && response[i][field_name] !== null){\\n m_item['name'] = response[i][field_name];\\n }\\n results_list.push(m_item);\\n }\\n }\\n i++;\\n }\\n\\n\\n query_results = {'data': results_list};\\n return query_results;\\n}\",\n \"function readAlbumsFromDb() {\\n musicDb.allDocs({\\n include_docs: true,\\n startkey: 'album_',\\n endkey: 'album_\\\\uffff'\\n }).then(function (resultFromDb) {\\n processInfoFromDb(resultFromDb)\\n }).catch(function (err) {\\n console.log(err)\\n })\\n }\",\n \"async fetchYourSoundtracks(ctx) {\\n let docRef = await db.collection(auth.currentUser.uid).doc(ctx.getters.getSoundtracksId);\\n let data = []\\n await docRef.get().then(e => {\\n data.push(e.data())\\n });\\n delete data[0].soundtracks;\\n let resultArray = Object.keys(data[0]).map(function(key) {\\n return [Number(key), data[0][key]];\\n });\\n resultArray.sort((a, b) => (a[1].soundtrackTitle > b[1].soundtrackTitle) ? 1 : -1)\\n ctx.commit('setSoundtrackList', resultArray);\\n localStorage.setItem('userSoundtracks', JSON.stringify(resultArray));\\n }\",\n \"get mediaListView() {\\n return this._mediaListView;\\n }\",\n \"function media(){\\n qtd_args = arguments.length;\\n soma = 0;\\n console.log('total args: '+qtd_args);\\n for (i=0;i {\\n if (data.length) {\\n this.setItems(data);\\n }\\n }\\n );\\n }\",\n \"static getAllArtists(){\\n try{\\n\\n const data = connection.query(`select distinct artist from music`);\\n\\n return {status: 0, message: 'Ok', results: data};\\n } catch (error){\\n return{ status: 1, message: 'Error: ' + error, error}\\n }\\n }\",\n \"function addTrack(ID) {\\n var query = \\\" SELECT concat('file://','/', u.rpath)\\\";\\n query += \\\" FROM tracks t, urls u\\\";\\n query += \\\" where t.id=\\\"+ID;\\n query += \\\" and t.url=u.id\\\";\\n var result = sql(query);\\n Amarok.Playlist.addMedia(new QUrl(result[0]));\\n}\",\n \"function spotifysong(song) {\\n\\n spotify.search({ type: 'track', query: song, limit: 20 }, function (err, data) {\\n if (err) {\\n return console.log('Error occurred: ' + error);\\n }\\n for (var i = 0; i < data.tracks.items.length; i++) {\\n console.log(i);\\n console.log(\\\"artist(s) : \\\" + data.tracks.items[i].album.artists[0].name);\\n console.log(\\\"song name : \\\" + data.tracks.items[i].name);\\n console.log(\\\"preview song : \\\" + data.tracks.items[i].preview_url)\\n console.log(\\\"album : \\\" + data.tracks.items[i].album.name)\\n console.log(\\\"----------------------------------------------\\\")\\n }\\n // console.log(data.tracks.items)\\n\\n });\\n\\n}\",\n \"async function __prepareFiles() {\\n const files = albumDetails.pictures,\\n preparedFiles = [];\\n\\n for (let url of preSignedUrls) {\\n let obj = files.find((file) => file.name === url.fileName)\\n preparedFiles.push({ rawFile: obj.file, uploadUrl: url.url })\\n }\\n\\n return preparedFiles;\\n }\",\n \"_loadSongs(selectContainer) {\\n const PATH='https://fullstackccu.github.io/homeworks/hw4/songs.json';\\n const onJsonReady=(json)=>{\\n this.songList=json;\\n this._createSongs(selectContainer);\\n };\\n\\n fetch(PATH)\\n .then(response => response.json())\\n .then(onJsonReady);\\n }\",\n \"media(key, path) {\\n console.log('[Media]', 'cache', `${key} (${path})`);\\n\\n this.game.cache.addSound(key, '', {\\n path,\\n }, false, false);\\n\\n return this;\\n }\",\n \"function getSong(track) {\\n // If there is no track listed display the default of \\\"The Sign, by Ace of Base\\\"\\n if (track === \\\"\\\" || track === undefined || track === null) {\\n var defaultTrack = \\\"The Sign\\\";\\n spotify.search({ type: \\\"track\\\", query: defaultTrack, limit: 10 }, function (err, response) {\\n if (err) {\\n return console.log('It seems you have an error:: ' + err);\\n }\\n //the default was displaying The Sign by Ty Dolla Sign so I just hard coded the default\\n console.log('---------------------------------------------\\\\nArtist: \\\"' + \\\"Ace of Base\\\" +\\n '\\\"\\\\nTrack: \\\"' + \\\"The Sign\\\" +\\n '\\\"\\\\nAlbum: \\\"' + \\\"The Sign (US Album) [Remastered]\\\" +\\n '\\\"\\\\nLink: \\\"' + \\\"https://p.scdn.co/mp3-preview/4c463359f67dd3546db7294d236dd0ae991882ff?cid=731f3e4c779047e89b0f836152cd61cc\\\" + '\\\"\\\\n');\\n });\\n }\\n else {\\n //run if a track is listed\\n spotify.search({ type: \\\"track\\\", query: track, limit: 3 }, function (err, response) {\\n if (err) {\\n return console.log('It seems you have an error:: ' + err);\\n }\\n for (i = 0; i < response.tracks.items.length; i+=1) {\\n // if there is no preview default a link\\n if (response.tracks.items[i].preview_url === null) {\\n console.log('---------------------------------------------\\\\nArtist: \\\"' + response.tracks.items[i].album.artists[0].name +\\n '\\\"\\\\nTrack: \\\"' + response.tracks.items[i].name +\\n '\\\"\\\\nAlbum: \\\"' + response.tracks.items[i].album.name +\\n '\\\"\\\\nLink: \\\"' + response.tracks.items[i].album.external_urls.spotify + '');\\n }\\n else {\\n console.log('---------------------------------------------\\\\nArtist: \\\"' + response.tracks.items[i].album.artists[0].name +\\n '\\\"\\\\nTrack: \\\"' + response.tracks.items[i].name +\\n '\\\"\\\\nAlbum: \\\"' + response.tracks.items[i].album.name +\\n '\\\"\\\\nLink: \\\"' + response.tracks.items[i].preview_url + '\\\"');\\n }\\n }\\n });\\n }\\n}\",\n \"async getSharedAlbums(){\\n const token = await GoogleSignin.getTokens();\\n await this.getDbUserData();\\n data = {\\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\\n method: 'GET',\\n headers: {\\n 'Authorization': 'Bearer '+ token.accessToken,\\n 'Content-type': 'application/json'\\n },\\n }\\n response = await this.APIHandler.sendRequest(data);\\n return response\\n }\",\n \"function spotifyThisSong() {\\n let song = \\\"The Sign Ace of Base\\\";\\n if (searchTerm) {\\n song = searchTerm;\\n }\\n spotify.request('https://api.spotify.com/v1/search?q=track:' + song + '&type=track&limit=10', function (error, response) {\\n for (i = 0; i < 3; i++) {\\n if (error) {\\n return console.log(error);\\n }\\n console.log(\\\"\\\\nArtist: \\\" + response.tracks.items[i].artists[0].name + \\\"\\\\nSong: \\\" + response.tracks.items[i].name + \\\"\\\\nPreview: \\\" + response.tracks.items[i].preview_url + \\\"\\\\nAlbum: \\\" + response.tracks.items[i].album.name);\\n };\\n });\\n}\",\n \"function spotifySearch(){\\n spotify.search({ type: 'track', query: songToSearch}, function(error, data){\\n if(!error){\\n for(var i = 0; i < data.tracks.items.length; i++){\\n var song = data.tracks.items[i];\\n console.log(\\\"Artist: \\\" + song.artists[0].name);\\n console.log(\\\"Song: \\\" + song.name);\\n console.log(\\\"Preview: \\\" + song.preview_url);\\n console.log(\\\"Album: \\\" + song.album.name);\\n console.log(\\\"-----------------------\\\");\\n }\\n } else{\\n console.log('Error occurred.');\\n }\\n });\\n }\",\n \"async getAlbums(){\\n const token = await GoogleSignin.getTokens();\\n await this.getDbUserData();\\n data = {\\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\\n method: 'GET',\\n headers: {\\n 'Authorization': 'Bearer '+ token.accessToken,\\n 'Content-type': 'application/json'\\n },\\n }\\n response = await this.APIHandler.sendRequest(data);\\n return response\\n }\",\n \"read({ sponsor, user }, res) {\\n const where = {sponsorId: sponsor.id}\\n Promise.all([\\n SponsorLike.findOne({where:{...where,\\n userId: user.id,\\n }}),\\n SponsorLink.findAll({where}),\\n SponsorMedia.findAll({where}),\\n ])\\n .then(([like, links, mediaObjs])=>{\\n let s = resolveUploadSrc(sponsor.toJSON(), ['logo']);\\n if (like) {\\n s.like = true;\\n }\\n links = links.map( ({name, url}) => ({name, url}) );\\n const media = mediaObjs.map( ({url}) => url);\\n\\n res.json({...s, links, media, mediaObjs});\\n })\\n }\",\n \"function getAudio(device_id) {\\n $.ajax({\\n url: \\\"https://api.spotify.com/v1/me/player/play?device_id=\\\" + device_id,\\n type: \\\"PUT\\\",\\n data: '{\\\"uris\\\": [\\\"spotify:track:' + track + '\\\"]}',\\n beforeSend: function (xhr) {\\n xhr.setRequestHeader('Authorization', 'Bearer ' + _token)\\n },\\n success: function (data) {\\n /*console.log(data)*/\\n }\\n })\\n }\",\n \"function callAPI(query) {\\n\\t$.get(\\\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\\\",\\n\\t\\t{'q': query,\\n\\t\\t'limit': '20'},\\n\\t\\tfunction(data) {\\n\\n\\t\\t\\tresetTable('searchBody')\\n\\t\\t\\t$.each(data, function(i, v) {\\n\\t\\t\\t\\tvar artwork = '_css/artwork.jpg'\\n\\t\\t\\t\\tif (v.artwork_url != null){\\n\\t\\t\\t\\t\\tartwork = v.artwork_url;\\n\\t\\t\\t\\t} \\n\\t\\t\\t\\tvar title = v.title;\\n\\t\\t\\t\\tvar artist = v.artist;\\n\\t\\t\\t\\tvar artist = v.user.username;\\n\\t\\t\\t\\tvar url = v.permalink_url;\\n\\t\\t\\t\\taddSong(artwork, title, url, artist);\\n\\t\\t\\t\\t// console.log(data);\\n\\t\\t\\t});\\n\\t\\t},'json'\\n\\t);\\n}\",\n \"componentDidMount() {\\n client.photos.search({ query: 'cats', locale: 'en-US', per_page: 24 }).then(res => {\\n this.setState({\\n catPics: res.photos\\n });\\n })\\n .catch(error => {\\n console.log('Error fetching and parsing data', error);\\n });\\n\\n client.photos.search({ query: 'dogs', locale: 'en-US', per_page: 24 }).then(res => {\\n this.setState({\\n dogPics: res.photos\\n });\\n })\\n .catch(error => {\\n console.log('Error fetching and parsing data', error);\\n });\\n\\n client.photos.search({ query: 'computers', locale: 'en-US', per_page: 24 }).then(res => {\\n this.setState({\\n computerPics: res.photos\\n });\\n })\\n .catch(error => {\\n console.log('Error fetching and parsing data', error);\\n });\\n }\",\n \"function parseImage(items) {\\n var curr_data = [];\\n items.forEach(function (element, index, array) {\\n console.log(element.media_key.S);\\n getImage(element.media_key.S).then((img) => {\\n curr_data.push(img);\\n if (curr_data.length == items.length) {\\n displayImages(curr_data);\\n }\\n })\\n })\\n }\",\n \"async cleanUpMusic() {\\n const docs = await this.db.getDocuments('music');\\n const hashes = {};\\n \\n for(let i = 0; i < docs.length; i++) {\\n const doc = docs[i];\\n \\n if(\\n !doc.fileHash || \\n typeof doc.fileHash != 'string' ||\\n (\\n !this.isFileAdding(doc.fileHash) && \\n !await this.hasFile(doc.fileHash) &&\\n await this.db.getMusicByFileHash(doc.fileHash)\\n )\\n ) {\\n await this.db.deleteDocument(doc);\\n continue;\\n }\\n\\n hashes[doc.fileHash] = true;\\n }\\n\\n await this.iterateFiles(async filePath => {\\n try {\\n const hash = path.basename(filePath);\\n\\n if(!hashes[hash] && !this.isFileAdding(hash) && !await this.db.getMusicByFileHash(hash)) {\\n await this.removeFileFromStorage(hash);\\n }\\n }\\n catch(err) {\\n this.logger.warn(err.stack);\\n }\\n });\\n }\",\n \"static getFilmsFromStorage()\\n {\\n let films;\\n if(localStorage.getItem('films') === null)\\n {\\n films = [];\\n }else{\\n films = JSON.parse(localStorage.getItem('films'));\\n }\\n return films;\\n }\",\n \"function getMusic(songName) {\\n\\n // If no song name, defaults The Sign by Ace\\n if (!songName) {\\n var songName = \\\"The Sign Ace\\\";\\n }\\n\\n spotify.search({ type: 'track', query: songName }, function (err, data) {\\n if (err) {\\n return console.log('Error occurred: ' + err);\\n }\\n\\n var trackObj = data.tracks.items[0];\\n\\n // Artist(s)\\n console.log(`Artist: ${trackObj.artists[0].name}`);\\n\\n // The song's name\\n console.log(`Song Name: ${trackObj.name}`);\\n\\n // A preview link of the song from Spotify\\n console.log(`Preview Link: ${trackObj.external_urls.spotify}`);\\n\\n // The album that the song is from\\n console.log(`Album Name: ${trackObj.album.name}`);\\n });\\n}\",\n \"getInitialData() {\\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\\n if (error) {\\n console.log(error);\\n } else if (item == null) {\\n // Gallery not found.\\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\\n } else {\\n this.setState({ gallery: item,\\n editGallery : {\\n name: item.name,\\n description: item.description\\n }});\\n\\n // Get medias\\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\\n if (error) {\\n console.log(error);\\n } else {\\n this.setState({ images: [...items] });\\n }\\n });\\n }\\n });\\n }\",\n \"function s3ListObjects(token, collection = []) {\\n return listObjects({\\n Bucket: bucket,\\n Prefix: 'sound-sync/',\\n ContinuationToken: token,\\n }).then(({ IsTruncated, Contents, NextContinuationToken }) => {\\n const contents = collection.concat(Contents);\\n return IsTruncated\\n ? s3ListObjects(NextContinuationToken, contents)\\n : contents;\\n });\\n}\",\n \"function playThatFunkyMusic(songName) {\\n spotify\\n .search({ type: \\\"track\\\", query: songName, limit: 5 })\\n .then(function(response) {\\n response.tracks.items.forEach(function(song) {\\n console.log(\\n `\\n Artist(s): ${song.album.artists[0].name}\\n Song Name: ${song.name}\\n Preview Link: ${song.preview_url}\\n Album: ${song.album.name}\\n `\\n );\\n });\\n\\n // console.log(\\n // `\\n // Artist(s): ${response.tracks.items[0].album.artists[0].name}\\n // Song Name: ${response.tracks.items[0].name}\\n // Preview Link: ${response.tracks.items[0].preview_url}\\n // Album: ${response.tracks.items[0].album.name}\\n // `\\n // );\\n })\\n .catch(function(err) {\\n console.log(err);\\n });\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.644103","0.60938877","0.60685694","0.5915229","0.5886536","0.58821404","0.5860882","0.58383995","0.58078915","0.5766396","0.57354265","0.5735394","0.5730848","0.5702633","0.5676882","0.5661672","0.565121","0.5624092","0.5617748","0.55673903","0.55485564","0.5543492","0.5510039","0.54589474","0.54459655","0.54404575","0.54318106","0.54238063","0.54079646","0.53980654","0.5394063","0.5392118","0.539198","0.5381139","0.53767186","0.53573453","0.5349493","0.5339832","0.5332852","0.53283346","0.5319658","0.53094155","0.5307648","0.5296523","0.5286214","0.5278963","0.5264334","0.5242244","0.52401435","0.52377754","0.5236433","0.52275544","0.52254087","0.52101237","0.51953113","0.5194759","0.519405","0.51764894","0.51737654","0.517142","0.51654077","0.51520264","0.51480186","0.5131591","0.51253575","0.5112893","0.51126075","0.5108026","0.51072127","0.5096206","0.5094088","0.50915873","0.509156","0.509133","0.5085427","0.50769705","0.507545","0.50751007","0.50702417","0.5068622","0.5066688","0.5066341","0.5065881","0.5062226","0.5062016","0.50599426","0.5057911","0.5042189","0.50411534","0.5040732","0.50391996","0.50389546","0.5030863","0.5023062","0.5018265","0.5015098","0.50123495","0.500945","0.5003204","0.5000657","0.5000095"],"string":"[\n \"0.644103\",\n \"0.60938877\",\n \"0.60685694\",\n \"0.5915229\",\n \"0.5886536\",\n \"0.58821404\",\n \"0.5860882\",\n \"0.58383995\",\n \"0.58078915\",\n \"0.5766396\",\n \"0.57354265\",\n \"0.5735394\",\n \"0.5730848\",\n \"0.5702633\",\n \"0.5676882\",\n \"0.5661672\",\n \"0.565121\",\n \"0.5624092\",\n \"0.5617748\",\n \"0.55673903\",\n \"0.55485564\",\n \"0.5543492\",\n \"0.5510039\",\n \"0.54589474\",\n \"0.54459655\",\n \"0.54404575\",\n \"0.54318106\",\n \"0.54238063\",\n \"0.54079646\",\n \"0.53980654\",\n \"0.5394063\",\n \"0.5392118\",\n \"0.539198\",\n \"0.5381139\",\n \"0.53767186\",\n \"0.53573453\",\n \"0.5349493\",\n \"0.5339832\",\n \"0.5332852\",\n \"0.53283346\",\n \"0.5319658\",\n \"0.53094155\",\n \"0.5307648\",\n \"0.5296523\",\n \"0.5286214\",\n \"0.5278963\",\n \"0.5264334\",\n \"0.5242244\",\n \"0.52401435\",\n \"0.52377754\",\n \"0.5236433\",\n \"0.52275544\",\n \"0.52254087\",\n \"0.52101237\",\n \"0.51953113\",\n \"0.5194759\",\n \"0.519405\",\n \"0.51764894\",\n \"0.51737654\",\n \"0.517142\",\n \"0.51654077\",\n \"0.51520264\",\n \"0.51480186\",\n \"0.5131591\",\n \"0.51253575\",\n \"0.5112893\",\n \"0.51126075\",\n \"0.5108026\",\n \"0.51072127\",\n \"0.5096206\",\n \"0.5094088\",\n \"0.50915873\",\n \"0.509156\",\n \"0.509133\",\n \"0.5085427\",\n \"0.50769705\",\n \"0.507545\",\n \"0.50751007\",\n \"0.50702417\",\n \"0.5068622\",\n \"0.5066688\",\n \"0.5066341\",\n \"0.5065881\",\n \"0.5062226\",\n \"0.5062016\",\n \"0.50599426\",\n \"0.5057911\",\n \"0.5042189\",\n \"0.50411534\",\n \"0.5040732\",\n \"0.50391996\",\n \"0.50389546\",\n \"0.5030863\",\n \"0.5023062\",\n \"0.5018265\",\n \"0.5015098\",\n \"0.50123495\",\n \"0.500945\",\n \"0.5003204\",\n \"0.5000657\",\n \"0.5000095\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":40,"cells":{"query":{"kind":"string","value":"redirect from createRoom page to joinRoom page or viceVersa"},"document":{"kind":"string","value":"function redirect(param) {\n const value = param;\n if(value === 'createroom'){\n location.href = \"createRoom.html\";\n }\n else if (value === 'joinroom') {\n location.href = \"index.html\";\n }\n else if (value === 'permissionGranted') {\n // location.href = \"homepage\";\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 goToRoom(e) {\n\te.preventDefault();\n\n\tvar roomName = $.trim($('#roomName').val());\n\n\tif(!roomName){ return; } \n\n window.location.href = '/covert/room/' + roomName;\n}","async function createChatroomAndRedirect(e) {\n setLoading(true);\n try {\n let roomId = profileData.chatRoomId;\n if (!roomId) {\n roomId = await createChatRoomInDB(profileData.id, profileData.displayName);\n }\n\n history.push('/chatRoom/' + roomId);\n } catch (error) {\n setLoading(false);\n }\n }","function leaveRoom() {\n window.location = routeHome()\n }","function clickRoom(room) {\n\tvar elem = document.getElementById(ROOM_ID_PREFIX + room);\n\t// var item = findRoomById(room);\n\t// var btn = document.getElementById(room + \"_button\");\n\n\tpage_1.style.display = \"none\";\n\tpage_2.style.display = \"block\";\n\t// room_header_2.innerHTML = item.name;\n\tregister(loggedInUser, room);\n\twindow.history.replaceState('test', '', \"?room=\" + room);\n\t// TODO\n\tmapInit();\n}","function joinedRoom( room ) {\n}","function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}","function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}","function handleJoinRoom(room_name){\n clearErrors();\n socket.emit(\"join_room\", room_name);\n }","function createRoom() {\n db.Room.create({\n room_id: req.body.room_id,\n property_id: req.body.property_id,\n price: req.body.price,\n roomType: req.body.roomType,\n aboutRoom: req.body.aboutRoom,\n status: req.body.status,\n closeDate: req.body.closeDate,\n HotelId: thisId\n })\n .then(function() {\n res.send(\"/choice/\" + lastSegment);\n })\n .catch(function(err) {\n console.log(err);\n res.json(err);\n });\n }","function joinRoom(e, roomAlreadyCreated) {\n e.preventDefault();\n if (roomAlreadyCreated) {\n if (!document.getElementById(\"username_shareableRoom\").value.length < 1) {\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.open();\n var enteredRoomName = document.getElementById(\"roomToJoin\").value;\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n MicroModal.close(\"shareableRoomCreatedModal\");\n // showStartGameButton();\n } else {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid red\";\n setTimeout(function () {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid black\";\n }, 3000);\n }\n } else {\n if (username()) {\n socket.open();\n var enteredRoomName = document.getElementById(\"enteredRoomName\").value;\n userName = document.getElementById(\"userName\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n }\n }\n}","function setRoom(name) {\n $('form').remove();\n $('h1').text(name);\n $('#subTitle').text('Link to join: ' + location.href);\n $('body').addClass('active');\n }","instanciateRoom()\n { \n //this.createRoom();\n $(\"#GP-btn_2\").text(\"Eliminar sala\")\n $(\"#GP-btn_1\").css(\"display\", \"block\");\n pageIndex = 4;\n app.goToPage(\"Game-Roulete\");\n }","function _joinRoom() {\n roomId = rooms[0].id;\n // Join the room\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\n }","function navigateToTickets(roomId){\n window.location.href = \"tickets.html?roomId=\" + roomId; \n}","function createNewRoom() {\r\n // Generate room id.\r\n const newID = uuidv4().substring(0, 8);\r\n\r\n // Join room\r\n socket.join(newID);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, newID);\r\n\r\n // Send room data to socket\r\n io.to(socket.id).emit(\"roomData\", {\r\n roomId: newID,\r\n });\r\n }","function goChatRoomList(id){\n $(location).attr(\"href\",\"/chat/chatRoomList/\"+id);\n }","function leaveRoom() {\n socketRef.current.emit(\"user clicked leave meeting\", socketRef.current.id);\n props.history.push(\"/\");\n }","function joinRoom(id)\n{\n console.log('Request joinRoom: ' + id);\n if (inRoom == false)\n {\n _warpclient.joinRoom(id);\n } else {\n console.warn('Already in another room: ' + roomId);\n }\n}","function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}","function loadEventRoom(id)\n{\n localStorage.setItem(\"roomId\",id);\n if(check_login())\n window.location.replace('event_room.html');\n else\n window.location.replace('unauth_event_room.html');\n}","function go() {\r\n\tvar name = document.getElementById(\"roomName\").value;\r\n\tif(name !== \"\") {\r\n\t\twindow.location.replace(\"/?\" + name);\r\n\t}\r\n}","function joinUserRoom(name) {\r\n divHome.hide();\r\n divRoom.show();\r\n socket.emit(\"joinRoom\", name);\r\n currentRoom = name;\r\n}","function createRoomButton(){\n clearErrors();\n if(newRoomName.length > 1){\n createNewRoom(newRoomName)\n .then(res => {\n handleJoinRoom(res.data.room)\n refreshButton();\n })\n setNewRoomName(\"\");\n } else{\n props.dispatch({type: ACTIONS.ERROR, payload: {errors: [\"Room name must be greater than 1 character\"]}})\n }\n }","function createUserRoom(data) {\r\n inputRoomName.value('');\r\n divHome.hide();\r\n divRoom.show();\r\n currentRoom = data;\r\n}","function leaveRoom() {\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\n if (leaveRoom) {\n window.location = '../index.html';\n }\n}","function handleRoomSetup() {\n app.log(2, 'handleRoomSetup entered');\n var room_to_create = $.getUrlVar('roomname') || '',\n item;\n\n room_to_create = room_to_create.replace(/ /g, '');\n app.log(2, 'room_to_create ' + room_to_create);\n\n Callcast.CreateUnlistedAndJoin(room_to_create, function(new_name) {\n var jqDlg, newUrl;\n // We successfully created the room.\n // Joining is in process now.\n // trigger of joined_room will happen upon join complete.\n\n app.user.scheduleName = 'Place to meet up';\n app.user.scheduleJid = new_name + Callcast.AT_CALLCAST_ROOMS;\n app.user.scheduleTitle = 'Open room';\n\n // set local spot nick todo find a better place for this\n item = app.carousel.getItem(0);\n app.carousel.setSpotName(item, app.user.name);\n\n app.log(2, \"Room named '\" + new_name + \"' has been created. Joining now.\");\n app.log(2, 'window.location ' + window.location);\n if (room_to_create !== new_name)\n {\n newUrl = window.location.pathname + '?roomname=' + new_name;\n app.log(2, 'replacing state ' + newUrl);\n history.replaceState(null, null, newUrl);\n }\n\n // warn user if room name changed (overflow)\n if (room_to_create.length > 0 && room_to_create.toLowerCase() !== new_name.toLowerCase())\n {\n // display warning\n jqDlg = $(app.STATUS_PROMPT_LEFT).css({\"display\": \"block\",\n \"background-image\": 'url(images/warning.png)'});\n $('#message', jqDlg).text('Room ' + room_to_create + ' overflowed. You are now in room ' + new_name);\n $('#stop-showing', jqDlg).css('display', 'none');\n $('#stop-showing-text', jqDlg).css('display', 'none');\n }\n\n // initialize video, audio state here since this method\n // is called after the local plugin is loaded\n // use fb profile pick as bg image if it exists\n if (!Callcast.IsVideoDeviceAvailable())\n {\n if (app.user.fbProfilePicUrl)\n {\n $('#meeting > #streams > #scarousel #mystream')\n .css('background-image', 'url(' + app.user.fbProfilePicUrl + ')');\n }\n }\n else // video available\n {\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseVideo === 'false') {\n changeVideo(false);\n }\n else {\n changeVideo(true); // do this unconditionally so ui gets updated\n }\n }\n if (Callcast.IsMicrophoneDeviceAvailable())\n {\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseMicrophone === 'false') {\n changeAudio(false);\n }\n else {\n changeAudio(true); // do this unconditionally so ui gets updated\n }\n }\n },\n function(iq)\n {\n var errorMsg;\n if ($(iq).find('roomfull'))\n {\n errorMsg = \"Sorry, the room \" + room_to_create + \" is full. Please try again later.\";\n }\n else\n {\n errorMsg = 'There was a problem entering the room ' + room_to_create;\n }\n\n // display error\n app.log(4, \"handleRoomSetup Error \" + iq.toString());\n $('#errorMsgPlugin > h1').text('Oops!!!');\n $('#errorMsgPlugin > p#prompt').text(errorMsg);\n closeWindow();\n openWindow('#errorMsgPlugin');\n });\n}","createPoll(req, res){ \n let roomID = req.params.roomId;\n\n //idea: to have only one link use session and store in object {session id: room id} if curr session and room found in object render\n res.render('./teacher/create_poll', {roomID: roomID});\n }","joinRoom({state}, { roomId }) {\n return state.currentUser.joinRoom({ roomId });\n }","function joinPersonalRoom() {\n const roomName = createPrivateRoomName(drone.clientId);\n const myRoom = drone.subscribe(roomName);\n myRoom.on('open', error => {\n if (error) {\n return console.error(error);\n }\n console.log(`Successfully joined room ${roomName}`);\n });\n\n myRoom.on('message', message => {\n const {data, clientId} = message;\n const member = members.find(m => m.id === clientId);\n if (member) {\n addMessageToRoomArray(createPrivateRoomName(member.id), member, data);\n if (selectedRoom === createPrivateRoomName(clientId)) {\n DOM.addMessageToList(data, member);\n }\n } else {\n /* Message is sent from golang using the REST API.\n * You can handle it like a regular message but it won't have a connection\n * session attached to it (this means no member argument)\n */\n }\n });\n}","joinRoom(room) {\n if (room === undefined) return;\n\n console.log('Attempting to joinRoom. room: ', room);\n\n if (!this.isRoomEnterable())\n {\n console.log('Not already in a locked room. Cannot join. Giving up...');\n return;\n }\n\n // TODO: call some join room action\n\n $.ajax(\n {\n type: 'get',\n url: 'skylink_api_key'\n })\n .done((apiKey) => {\n\n console.log('AJAX retrieved successfully.');\n\n this.skylink.init(\n {\n apiKey: apiKey,\n defaultRoom: room\n },\n (error) => {\n\n if (error)\n {\n alert('An error has occurred while connecting to SkylinkJS.');\n return;\n }\n\n this.skylink.joinRoom({\n audio: true,\n video: true\n })\n });\n })\n .fail((err) => {\n alert('An error has occurred while retrieving the Skylink API key from the server.');\n });\n }","function func_join_room() {\n var room_number = document.getElementById('input_text').value;\n var list_length = list_of_joined.length++;\n list_of_joined[list_length] = room_number;\n $(\"#div_body_joinedRoom\").append(create_room(room_number, 1));\n func_populate(room_number);\n func_close_join_room_pop();\n func_add_room_to_database(room_number);\n}","function setRoom(name) {\r\n $('#createRoom').remove();\r\n $('h1').text(name);\r\n // $('#subTitle').text(name + \" || link: \"+ location.href);\r\n $('body').addClass('active');\r\n}","function continueClick(){\n window.location = nextRoom;\n}","function joinroom(data) {\n\tvar tmproom = data;\n\tif (player != \"\" && passcode != \"\" && tmproom >= 0) {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=joinroom&player=\" + player + \"&passcode=\" + passcode + \"&room=\" + tmproom;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}","function joinRoom(obj) {\r\n modal.style.display = \"block\";\r\n room = obj.id;\r\n}","function joinRoom() {\n const roomId = this.id.substr(5, this.id.length-5)\n player.updatePlayer1(false);\n //player.setPlayerType(false);\n socket.emit('joinGame', { name: player.name, room: this.id });\n\n //player = new Player(player.name, P2);\n }","render() {\r\n return (\r\n \r\n \r\n {\r\n return this.state.roomCode ? (\r\n \r\n ) : (\r\n this.renderFirstPage()\r\n );\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {\r\n return ;\r\n }}\r\n />\r\n \r\n \r\n );\r\n }","function createRoom(e) {\n e.preventDefault();\n if (username()) {\n // $.ajax({\n // url: '/createRoom',\n // type: 'POST',\n // beforeSend: function (xhr) {\n // if (localStorage.getItem(appName)) {\n // xhr.setRequestHeader('Authorization', localStorage.getItem(appName));\n // }\n // },\n // data: {\n // username: userName\n // },\n // success: function (token) {\n // console.log(token);\n // localStorage.setItem(appName, token.token);\n // },\n // error: function () {},\n // });\n\n // TODO: Use this params to send token to server on new connection\n // check if socket is valid and within time limit\n socket.io.opts.query = {\n token: alreadyPlayed(),\n };\n socket.open();\n // FIXME: Delet Test emit\n socket.emit(\"newMessage\", \"lol\", function (err, message) {\n if (err) {\n return console.error(err);\n }\n console.log(message);\n });\n socket.on(\"newMessage\", function (data) {\n console.log(data);\n });\n\n // Asking to create a new room\n socket.emit(\"createRoom\", { username: userName });\n // socket replies back with created room name (which should be sent to other user who wants to play together)\n socket.on(\"roomNameIs\", function (roomName) {\n // console.log(roomName);\n document.getElementById(\"createdRoomName\").innerHTML =\n \"Room name : \" + roomName;\n $(\"#createdRoomName\").show();\n currentRoom = roomName;\n $(\".joinRoom\").hide();\n $(\".createRoom\").hide();\n $(\".generatRoomLink\").hide();\n $(\".singleplayerMode\").hide();\n showStartGameButton();\n currentlyPlaying = true;\n });\n console.log(socket);\n }\n}","function newroom() {\n\t$(\"#warning2\").html(\"\");\n\tvar tmproomname = document.roomform.roomname.value;\n\tif (tmproomname.search(/[^a-zA-Z0-9]/) != -1 || tmproomname.length > 16) {\n\t\t$(\"#warning2\").html(\"Viallinen huoneen nimi.\");\n\t\treturn;\n\t}\n\tvar roomname = tmproomname;\n\tif (player != \"\" && passcode != \"\" && roomname != \"\") {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=newroom&player=\" + player + \"&passcode=\" + passcode + \"&roomname=\" + roomname;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}","function newRoom($id)\n{\n\tif(groupRooms == 0)\n\t{\n\t\tshowInfoBox(\"system\",\"220\",\"300\",\"200\",\"\",lang6);\n\t\treturn false;\t\t\t\n\t}\n\n\tif($id == '1')\n\t{\n\t\t// show create room\n\t\tdocument.getElementById(\"roomCreate\").style.visibility = 'visible';\n\t}\n\telse\n\t{\n\t\t// hide create room\n\t\tdocument.getElementById(\"roomCreate\").style.visibility = 'hidden';\n\t}\n return false;\n}","function dial (room){\n if (room !== '') {\n socket.emit('create or join', room);\n console.log('Attempted to create or join room', room);\n }\n}","joinRoom(data) {\n socket.emit('join-room', data);\n }","function joinRoom(socket, room) {\n // If the close timer is set, cancel it\n // if (closeTimer[room]) {\n // clearTimeout(closeTimer[room]);\n // }\n\n // Create Paperjs instance for this room if it doesn't exist\n var project = projects.projects[room];\n if (!project) {\n console.log(\"made room\");\n projects.projects[room] = {};\n // Use the view from the default project. This project is the default\n // one created when paper is instantiated. Nothing is ever written to\n // this project as each room has its own project. We share the View\n // object but that just helps it \"draw\" stuff to the invisible server\n // canvas.\n projects.projects[room].project = new paper.Project();\n projects.projects[room].external_paths = {};\n db.join(socket, room);\n } else { // Project exists in memory, no need to load from database\n loadFromMemory(room, socket);\n }\n}","function joinRoom(roomName) {\n disableElements('joinRoom');\n\n // Check if roomName was given or if it's joining via roomName input field\n if(typeof roomName == 'undefined'){\n roomName = document.getElementById('roomName').value;\n }\n document.getElementById('roomName').value = roomName;\n\n var data = {\n id: \"joinRoom\",\n roomName: roomName\n };\n sendMessage(data);\n}","function joinAndConnectRoom (roomId) {\n $.post(\"/chatroom/joinedRooms\", {username:username}, function(data) {\n let joinedRoomsGroup = $(\"#joinedRooms\");\n joinedRoomsGroup.empty();\n if (data == null) return;\n for(let i = 0; i < data.length ;i++) {\n let room = data[i];\n let type = room.type;\n let roomTemp = templateJoinedRoom;\n roomTemp = roomTemp.replace('ROOM-NAME', room.name);\n roomTemp = roomTemp.replace('ROOM-ID',room.id);\n roomTemp = roomTemp.replace('all-room-ROOM-ID','joined-room' + room.id);\n if(type === \"Public\") {\n if(room.name === \"General\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-success\");\n } else {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-primary\");\n }\n } else if (type === \"Private\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-secondary\");\n } else {\n return null;\n }\n roomTemp = roomTemp.replace('ROOM-GROUP-NAME',\"joined-room\");\n joinedRoomsGroup.append(roomTemp);\n }\n $('#joined-room' + roomId).prop(\"checked\", true);\n connectToRoom();\n },\"json\");\n}","function requestCreateRoom() {\r\n if (inputRoomName.value()) {\r\n socket.emit(\"createRoomRequest\", inputRoomName.value(), (response) => {\r\n if(!response){\r\n errorNameUsed(inputRoomName.value());\r\n } else{\r\n createUserRoom(inputRoomName.value());\r\n }\r\n });\r\n currentRoom = inputRoomName.value();\r\n }\r\n}","function generateNewRoom(name) {\n\t\n\t//send the request to the server\n\tvar posting = $.post(roomsURI + \"/add\", {\n\t\tname : name\n\t});\n\t\n\t//Send new room to server\n\tposting.done(function(data) {\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\t//$(\"#chat-rooms-list\").children(\"li[room_id!=2]\").remove(); //remove the last room\n\t\t//$(\"#chat-rooms-list\").append(createRoomElement(room)); //add this in it's place\n\t\t$(\"#chat-rooms-dropdown-list\").append(createRoomElement(room));\n\t\troom_id_list.push(room.roomID);\n\t\tjoinRoom(room.roomID,true);\n\t});\n}","joinRoom(roomId) {\n this.socket.emit('create or join', roomId)\n console.log(`joinRoom ${roomId}`)\n this.roomId = roomId\n }","function getRoom(request, response) {\n let roomName = request.params.roomName;\n // Chatroom.find({chatroom_name: roomName}, function (err, docs) {\n // if (err) {\n // console.log(err);\n // } else {\n // let roomId;\n // // If a chatroom with that name exists get it, else create one\n // if (docs.length > 0) {\n // roomId = docs[0].chatroom_id;\n // } else {\n // roomId = roomGenerator.roomIdGenerator()\n // const newChatroom = new Chatroom ({\n // chatroom_id: roomId,\n // chatroom_name: roomName\n // });\n\n // newChatroom\n // .save()\n // .then(item => console.log(item))\n // .catch(err => console.log(err));\n // }\n\n // TODO: Get the messages and submit to room.hbs\n Messages.find({ chatroom_name: roomName })\n .lean()\n .then((items) => {\n response.render(\"room\", {\n title: \"chatroom\",\n roomName,\n messages: items,\n isAvailable: true,\n // newRoomId: roomId\n });\n });\n}","function goToRoster()\n{\n saveTeam();\n window.location.href = \"roster.html\";\n}","connectToRoom() {\n const activeRoom = get(this, 'roomId');\n if (activeRoom) {\n const sessionManager = get(this, 'webrtc');\n sessionManager.joinRoom(activeRoom);\n }\n }","function roomover(){\n createtoast('u have been kicked out by ADMIN');\n showfeedbackscreen();\n //window.location.href = window.location.origin;\n}","function newRoom() {\n socket.emit(\"newRoom\");\n}","function createNewRoom() {\n console.log(nextRoomId);\n createRoomDOM(nextRoomId);\n signalRoomCreated(nextRoomId);\n\n nextRoomId++;\n}","enterRoom(room) {\n console.warn(\"Cannot enter room different room from InBrowserBot\")\n }","join(room){\n \tthis.room[room] = true;\n\t}","goToAjout() {\n history.push(\"/main/clients/ajout\");\n }","joinRoom(room, hostExist, listensers) {\n trace(`Entering room '${room}'...`);\n this.socket.emit('join', room, hostExist, listensers);\n }","function joinRoom() {\n var u = document.getElementById(\"username\").value;\n if(u === \"\") {\n setJoinError(\"Please choose a username\");\n return;\n }\n var r = document.getElementById(\"room\").value;\n if(r === \"\") {\n setJoinError(\"Please enter a room\");\n return;\n }\n var c = document.getElementById(\"color\").value;\n if(c === \"\") {\n setJoinError(\"Please choose a color\");\n return;\n }\n r = r.replace(/\\s+/g, ''); // Remove whitespace from room name\n r = r.toLowerCase();\n var join_message = {username: u, room: r, color: c};\n Game = new MultiplayerGame(u, r);\n socket.emit('join', join_message)\n}","function joinRoom() {\r\n let roomID = $(\"#joinRoomID\").val();\r\n socket.emit(\"joinByRoomID\", roomID);\r\n}","function joinRoom(event){\n \tvar x = $(event.target).text();\n if(x == roomIn){\n\n } else {\n socketio.emit(\"join_room\", {roomName:x, password:\"\"});\n }\n }","function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }","function join ( room, username ) {\n \n var id = getRoomId ( room );\n \n mapUserRooms ( id, username );\n \n return id;\n}","function createBoard() {\n\tsocket.close();\n\tdocument.location.href = 'crear-partida.xhtml?session=' + session + '&player=' + player;\n}","function leaveRoom() {\n let chatLink = server + '/chat/' + roomId;\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\n }).then((result) => { if (result.isConfirmed) window.location.href = \"/main\"; });\n}","function bookRoom(roomTypeId, checkIn, checkOut) {\n // if the user isn't signed in, prompt them to do so (or create an account)\n if(localStorage.getItem('userLogin') == null) {\n document.getElementById(\"sectLogin\").style['display'] = \"block\";\n showSignIn();\n } else {\n // the user is already signed in, so go to the checkout page\n window.location.assign(\"bookReservation.html?roomTypeId=\" + roomTypeId + \"&checkIn=\" + checkIn + \"&checkOut=\" + checkOut);\n }\n}","function switchRoom(room){\n\t\tsocket.emit('switchRoom', room);\n\t}","function findRoom(req, res, next) {\n if (req.query.Name == null) res.redirect(\"/rooms\");\n else {\n room\n .findOne({ Name: req.query.Name })\n .populate({\n path: \"Detail\",\n populate: {\n path: \"Reserve\",\n match: {\n $or: [\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\n ]\n }\n }\n })\n .exec(function(err, Room) {\n if (err) console.error(err);\n var counter = 0;\n for (var i = 0; i < Room.Detail.length; i++) {\n if (Room.Detail[i].Reserve.length == 0) {\n counter++;\n req.session.ReserveInfo = Room.Detail[i];\n req.session.RoomInfo = Room;\n break;\n }\n }\n if (counter == 0) {\n console.log(\"No room left\");\n res.redirect(\"/rooms/\" + req.query.Name, {\n info: { message: \"No Room Left\" }\n });\n } else {\n return next();\n }\n });\n }\n}","function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }","getRoomURL() {\n return location.protocol + \"//\" + location.host + (location.path || \"\") + \"?room=\" + this.getRoom();\n }","function enter(role) {\r\n\r\n\tdisableNameInput();\r\n\tvar message = {\r\n\t\tid: 'joinRoom',\r\n\t\tname: name,\r\n\t\troomName: roomId,\r\n\t\trole: role,\r\n\t\t// Flags for use cases, where user did not give the permissions to his media devices.\r\n\t\t// Constraints to the connection to KMS should be in the same way e.g. audio:true; video:false.\r\n\t\taudioOn: acceptAudio,\r\n\t\tvideoOn: acceptVideo,\r\n\t\tvideoBeforeEnterTheRoom: videoBeforeEnterTheRoom\r\n\t}\r\n\tsendMessage(message);\r\n\ttoggleEnterLeaveButtons();\r\n\r\n}","function name_validate(roomParam) {\n roomParam.child(\"people/\" + $(\"#input_name\").val()).once('value', snapshot => {\n if (!snapshot.exists()) {\n let name = $(\"#input_name\").val();\n roomParam.child(\"people/\" + name).set(true); //adds username to the database, within the room they are joining\n myStorage.setItem(\"name\", name);\n myStorage.setItem(\"roomCode\", $(\"#input_number\").val());\n window.location.href = \"activity.html\";\n // a comment\n } else {\n $(\".join_room_popup_content\").css(\"height\",\"14em\");\n $(\"#pop_message\").html(\"Sorry, that name is taken.\");\n }\n });\n }","function renderRoom(req, res) {\n res.render('pages/room', {connectedUsers: connectedUsers});\n}","function changeRoom() {\n if (currentRoom !== undefined) {\n var desired_room = rotateRoom(currentRoom, this.id);\n\n initialState();\n setMqttRoom(desired_room);\n get_backend(room_list[desired_room]);\n\n }\n}","function buttonClicked(event) {\n var button = event.target;\n var room = button.parentElement.parentElement.parentElement;\n console.log(room);\n localStorage.setItem(\"bookingRoom\", room.id);\n window.location.assign(\"bookingPage.html\")\n}","function setJoinCallBtn() {\n joinCallBtn.addEventListener(\"click\", async (e) => {\n window.location.href='/join/' + roomId;\n });\n}","function connectToRoom() {\n let roomId = $(\"#joinedRooms\").find('input[name=\"joined-room\"]:checked').val();\n if(!checkElement(roomId)) return;\n\n startChatArea();\n\n $.post(\"/chatroom/connect\", {username: username, chatroomId: roomId}, function (data) {\n chatroomId = roomId;\n chatroomType = data.type;\n chatroomName = data.name;\n adminList = data.admins;\n $(\"#chatRoomName\").html(data.name + \" (\" + data.type + \")\");\n $(\"#chatRoomDescription\").html(data.description);\n\n loadUser();\n\n displayMessages(roomId);\n getChatRoomUsers();\n\n //Clear unread notification\n let unread = $(\"#joined-room\" + chatroomId + \" + span .badge-danger\");\n unread.addClass(\"d-none\");\n unread.html(0);\n\n $('#collapseTwo').removeClass('show');\n $('#collapseOne').addClass('show');\n $(\"#joinedRooms\").find('input[name=\"joined-room\"]:checked').prop(\"checked\", false);\n }, \"json\");\n}","redirectToMeetings(ev) {\n ev.preventDefault();//prevent form submittion(delete team)\n loadMeetings(this.props.params.teamId,this.loadMeetings);\n }","function joinRoom() {\n\tif (state == null) {\n\t\t// var campname = document.querySelector('#incoming').value;\n\t\tvar campname = 'dgnby';\n\t\t// TODO: check name is valid, alert() if not\n\t\tdatabase.ref('hosts/' + campname + '/').update({\n\t\t\t// add client signal data to database\n\t\t\tjoinData: signalClient,\n\t\t});\n\n\t\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\n\t\t// wait for host to respond to client signal data\n\t\thostData.on('value', function(snapshot) {\n\t\t\tif(state == \"client\"){\n\t\t\t\tsetTimeout(function(){ readAnswer(campname); }, 200);\n\t\t\t}\n\t\t});\n\t\tstate = \"client\";\n\t}\n\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\n}","function loadLobby(){\n window.location.href = \"/lobby\";\n}","function connectToRoomNew(roomData) {\n var data = roomData;\n roomNo = roomData.roomID\n\n //Checking the database\n getRoomData(roomNo).then(result => {\n //If it is a new room\n if(!result){\n //Store the data in indexedDB\n storeRoomData(data);\n //Open socket and display chat\n socket.emit('create or join', roomNo, data.accessedBy, data.imageSrc);\n displayLoadedMessages([]);\n hideLoginInterface(roomNo, data.accessedBy);\n initCanvas(socket, data.imageSrc, \"\");\n //Initialise annotation modal\n annotationCanvasInit();\n }\n\n //If room already exists\n else{\n //Open socket\n socket.emit('create or join', result.roomID, result.accessedBy, result.imageSrc);\n //Load data from indexedDB\n displayLoadedMessages(result.messages);\n //Display chat\n hideLoginInterface(result.roomID, result.accessedBy);\n initCanvas(socket, result.imageSrc, result.canvas);\n //Initialise annotation modal\n annotationCanvasInit();\n }\n });\n\n //Refresh annotations\n refreshAnnotations(roomNo);\n}","onLeave(client, consented) {\n\t\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\n\t}","function reloadRoom(){\n\twindow.location.assign('https://www.c4cstream.com/?room='+tag_no); \n}","startCommunication(room) {\n this.debug && console.log('Attempted to create or join room: ', room);\n const joinApi = this.joinUrl + `/api/v1/im/join`;\n fetch(joinApi, {\n method: 'POST',\n mode: 'cors',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n body: JSON.stringify({\n roomId: room,\n userId: this.userId\n })\n })\n .then(async data => {\n const { code } = await data.json(); // maybe:ok: false status: 504\n if (code === 200) {\n this.debug && console.log('call join room api successfully!', room);\n this._handleCreateAndJoin(room);\n this.socket.send(this.encodeMsg('create-join'));\n }\n })\n .catch(error => {\n console.error('[lsp join room api occurred]', error);\n });\n }","function handleCreateRoomEnter(e){\n if(e.key === \"Enter\"){\n createRoomButton();\n }\n }","function joinRoom() {\n remoteStream = new MediaStream();\n document.querySelector('#localVideo').srcObject = localStream;\n document.querySelector('#remoteVideo').srcObject = remoteStream;\n document.querySelector('#confirmJoinBtn').addEventListener('click', async() => {\n roomId = document.querySelector('#room-id').value;\n console.log('Join room: ', roomId);\n document.querySelector(\n '#currentRoom').innerText = `Room ID: ${roomId} `;\n await joinRoomById(roomId);\n }, { once: true });\n roomDialog.open();\n}","function leaveRoom() {\n\tif (player != \"\") {\n\t\troundEnded();\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=leaveroom&player=\" + player + \"&passcode=\" + passcode;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tinitRoomList();\n\t\t\t},\n\t\t});\n\t}\n}","function showRoomListPage() {\n\tleaveRoom();\n\tpage_1.style.display = \"block\";\n\tpage_2.style.display = \"none\";\n\twindow.history.replaceState('test', '', '?main=true');\t\n}","createRoom() {\n const room = this.currentUser.createRoom({\n id: this.props.items.name,\n name: this.props.items.name,\n private: false,\n }) .catch(err => {\n console.log(\"nope\");\n }); \n }","async adminJoinRoom(room) {\n //Fetch the currently logged in user\n let user = firebase.auth().currentUser\n\n //Retrieve an instance of our Firestore Database\n const db = firebase.firestore()\n\n //Save the room in the database that the admin just joined\n let adminUsersRef = await db.collection('admin-users').doc(user.uid)\n let adminUsersSnapShot = await adminUsersRef.get()\n\n if (adminUsersSnapShot.exists) {\n adminUsersRef.update({\n \"admin_room_location\": room\n })\n .then(() => {\n this.props.history.push('/chat')\n })\n this.context.triggerAdminJoinRoom(room)\n } \n }","function partingFromRoom( room ) {\n}","function generatRoomLink() {\n MicroModal.show(\"generateShareableRoomLinkModal\");\n\n // if (true) {\n if (!shareableRoomLinkAlreadyGenerated()) {\n $.ajax({\n url: \"/api/game/generateroom\",\n type: \"GET\",\n beforeSend: function (xhr) {\n // TODO: Send user IP ? for throttling purpose\n },\n data: {},\n success: function (data) {\n console.log(data);\n localStorage.setItem(\n appName + \"_GENERATED_ROOM_ID\",\n JSON.stringify(data)\n );\n $(\"#shareableRoomLink\").text(\n window.location.host + \"/?\" + GAMEURLPARAMS + \"=\" + data.gameKey\n );\n },\n error: function (err) {\n console.log(err);\n },\n });\n } else {\n $(\"#shareableRoomLink\").text(\n window.location.host +\n \"/?\" +\n GAMEURLPARAMS +\n \"=\" +\n JSON.parse(localStorage.getItem(appName + \"_GENERATED_ROOM_ID\")).gameKey\n );\n }\n}","function oneOnone() {\n return (\n
    \n \n \n \n \n \n
    \n );\n}","function requestJoin(type) {\n let roomId;\n if (type === \"public\") {\n roomId = $('input[name=\"all-public-room\"]:checked').val();\n } else {\n roomId = $('input[name=\"all-private-room\"]:checked').val();\n }\n\n if (requestRoomsList.indexOf(parseInt(roomId)) < 0) {\n requestRoomsList.push(parseInt(roomId));\n $.post(\"/chatroom/requestJoin\", {username: username, chatroomId: roomId}, function (data) {\n if (data === \"failure\") {\n $(\"#all-room\" + roomId).parent().parent().removeClass(\"list-group-item-success\");\n $(\"#all-room\" + roomId).parent().parent().addClass(\"list-group-item-danger\");\n }\n if (type === \"public\") {\n joinAndConnectRoom(roomId);\n getChatRoomUsers();\n getJoinedRooms();\n } else {\n requestRoomId = roomId;\n isWaitingAccept = true;\n }\n }\n , \"json\");\n }\n}","function AlumnoCrear() {\n window.location = `./AlumnoCrear.html?usu_id=${params.get('usu_id')}`;\n}","function getRoomURL() {\n\treturn location.protocol + \"//\" + location.host + (location.pathname || \"\") + \"?room=\" + getRoom();\n}","function joinDemo()\n{\n\tuserName = document.getElementById(\"txtUserName\").value;\n\tvLocation = document.getElementById(\"DDLocation\").value;\n\tvSubscribe = document.getElementById(\"DDChat\").value;\n\tif(userName == \"\" || userName == \"null\" || userName == null || userName == \"undefined\" || userName == undefined)\n\t{\n\t\talert(\"Please Enter Username.\")\n\t\treturn;\n\t}\n\twindow.location.href = \"/home.html\";\n}","function addUnit(class_room_id) {\n\n\t\twindow.location.href = web+\"classroom-unit/create\" + \"?class_room_id=\" + class_room_id + \"\";\n\n }","function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }","function setRoom(name) {\n\t$('#joinRoom').remove();\n\t$('h1').text('Room name : ' + name);\n\t$('body').append('');\n\t$('body').addClass('active');\n}"],"string":"[\n \"function goToRoom(e) {\\n\\te.preventDefault();\\n\\n\\tvar roomName = $.trim($('#roomName').val());\\n\\n\\tif(!roomName){ return; } \\n\\n window.location.href = '/covert/room/' + roomName;\\n}\",\n \"async function createChatroomAndRedirect(e) {\\n setLoading(true);\\n try {\\n let roomId = profileData.chatRoomId;\\n if (!roomId) {\\n roomId = await createChatRoomInDB(profileData.id, profileData.displayName);\\n }\\n\\n history.push('/chatRoom/' + roomId);\\n } catch (error) {\\n setLoading(false);\\n }\\n }\",\n \"function leaveRoom() {\\n window.location = routeHome()\\n }\",\n \"function clickRoom(room) {\\n\\tvar elem = document.getElementById(ROOM_ID_PREFIX + room);\\n\\t// var item = findRoomById(room);\\n\\t// var btn = document.getElementById(room + \\\"_button\\\");\\n\\n\\tpage_1.style.display = \\\"none\\\";\\n\\tpage_2.style.display = \\\"block\\\";\\n\\t// room_header_2.innerHTML = item.name;\\n\\tregister(loggedInUser, room);\\n\\twindow.history.replaceState('test', '', \\\"?room=\\\" + room);\\n\\t// TODO\\n\\tmapInit();\\n}\",\n \"function joinedRoom( room ) {\\n}\",\n \"function addRoom() {\\n\\tvar roomName = $('#add-room-name').val();\\n\\tvar posting = $.post(roomsAddURI, {\\n\\t\\tname : roomName\\n\\t});\\n\\tposting.done(function(data) {\\n\\t\\t//Add room via rest api then join it\\n\\t\\tvar room = JSON.parse(JSON.stringify(data));\\n\\t\\tjoinRoom(room.roomId, true);\\n\\t});\\n}\",\n \"function join() {\\n var roomName = roomField.value\\n , userName = userField.value\\n\\n roomStore.set(\\\"room-name\\\", roomName)\\n roomStore.set(\\\"user-name\\\", userName)\\n\\n roomField.value = \\\"\\\"\\n userField.value = \\\"\\\"\\n\\n room.emit(\\\"join\\\", roomName, userName)\\n}\",\n \"function handleJoinRoom(room_name){\\n clearErrors();\\n socket.emit(\\\"join_room\\\", room_name);\\n }\",\n \"function createRoom() {\\n db.Room.create({\\n room_id: req.body.room_id,\\n property_id: req.body.property_id,\\n price: req.body.price,\\n roomType: req.body.roomType,\\n aboutRoom: req.body.aboutRoom,\\n status: req.body.status,\\n closeDate: req.body.closeDate,\\n HotelId: thisId\\n })\\n .then(function() {\\n res.send(\\\"/choice/\\\" + lastSegment);\\n })\\n .catch(function(err) {\\n console.log(err);\\n res.json(err);\\n });\\n }\",\n \"function joinRoom(e, roomAlreadyCreated) {\\n e.preventDefault();\\n if (roomAlreadyCreated) {\\n if (!document.getElementById(\\\"username_shareableRoom\\\").value.length < 1) {\\n userName = document.getElementById(\\\"username_shareableRoom\\\").value;\\n socket.open();\\n var enteredRoomName = document.getElementById(\\\"roomToJoin\\\").value;\\n userName = document.getElementById(\\\"username_shareableRoom\\\").value;\\n socket.emit(\\\"joinRoom\\\", enteredRoomName, userName);\\n currentRoom = enteredRoomName;\\n MicroModal.close(\\\"shareableRoomCreatedModal\\\");\\n // showStartGameButton();\\n } else {\\n document.getElementById(\\\"username_shareableRoom\\\").style.border =\\n \\\"2px solid red\\\";\\n setTimeout(function () {\\n document.getElementById(\\\"username_shareableRoom\\\").style.border =\\n \\\"2px solid black\\\";\\n }, 3000);\\n }\\n } else {\\n if (username()) {\\n socket.open();\\n var enteredRoomName = document.getElementById(\\\"enteredRoomName\\\").value;\\n userName = document.getElementById(\\\"userName\\\").value;\\n socket.emit(\\\"joinRoom\\\", enteredRoomName, userName);\\n currentRoom = enteredRoomName;\\n }\\n }\\n}\",\n \"function setRoom(name) {\\n $('form').remove();\\n $('h1').text(name);\\n $('#subTitle').text('Link to join: ' + location.href);\\n $('body').addClass('active');\\n }\",\n \"instanciateRoom()\\n { \\n //this.createRoom();\\n $(\\\"#GP-btn_2\\\").text(\\\"Eliminar sala\\\")\\n $(\\\"#GP-btn_1\\\").css(\\\"display\\\", \\\"block\\\");\\n pageIndex = 4;\\n app.goToPage(\\\"Game-Roulete\\\");\\n }\",\n \"function _joinRoom() {\\n roomId = rooms[0].id;\\n // Join the room\\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\\n }\",\n \"function navigateToTickets(roomId){\\n window.location.href = \\\"tickets.html?roomId=\\\" + roomId; \\n}\",\n \"function createNewRoom() {\\r\\n // Generate room id.\\r\\n const newID = uuidv4().substring(0, 8);\\r\\n\\r\\n // Join room\\r\\n socket.join(newID);\\r\\n\\r\\n // Update corressponding object in usersArray\\r\\n updateUserRoom(socket, newID);\\r\\n\\r\\n // Send room data to socket\\r\\n io.to(socket.id).emit(\\\"roomData\\\", {\\r\\n roomId: newID,\\r\\n });\\r\\n }\",\n \"function goChatRoomList(id){\\n $(location).attr(\\\"href\\\",\\\"/chat/chatRoomList/\\\"+id);\\n }\",\n \"function leaveRoom() {\\n socketRef.current.emit(\\\"user clicked leave meeting\\\", socketRef.current.id);\\n props.history.push(\\\"/\\\");\\n }\",\n \"function joinRoom(id)\\n{\\n console.log('Request joinRoom: ' + id);\\n if (inRoom == false)\\n {\\n _warpclient.joinRoom(id);\\n } else {\\n console.warn('Already in another room: ' + roomId);\\n }\\n}\",\n \"function joinRoom(room)\\r\\n{\\r\\n //TODO erase... Name must be known previously\\r\\n var name = '';\\r\\n while(name == '')\\r\\n {\\r\\n name = prompt(\\\"Wie heißt du?\\\");\\r\\n }\\r\\n\\r\\n socket.emit('requestRoom', room, name);\\r\\n document.getElementById(\\\"chooseRoom\\\").classList.add('hidden');\\r\\n \\r\\n //TODO: maybe show loading icon...\\r\\n}\",\n \"function loadEventRoom(id)\\n{\\n localStorage.setItem(\\\"roomId\\\",id);\\n if(check_login())\\n window.location.replace('event_room.html');\\n else\\n window.location.replace('unauth_event_room.html');\\n}\",\n \"function go() {\\r\\n\\tvar name = document.getElementById(\\\"roomName\\\").value;\\r\\n\\tif(name !== \\\"\\\") {\\r\\n\\t\\twindow.location.replace(\\\"/?\\\" + name);\\r\\n\\t}\\r\\n}\",\n \"function joinUserRoom(name) {\\r\\n divHome.hide();\\r\\n divRoom.show();\\r\\n socket.emit(\\\"joinRoom\\\", name);\\r\\n currentRoom = name;\\r\\n}\",\n \"function createRoomButton(){\\n clearErrors();\\n if(newRoomName.length > 1){\\n createNewRoom(newRoomName)\\n .then(res => {\\n handleJoinRoom(res.data.room)\\n refreshButton();\\n })\\n setNewRoomName(\\\"\\\");\\n } else{\\n props.dispatch({type: ACTIONS.ERROR, payload: {errors: [\\\"Room name must be greater than 1 character\\\"]}})\\n }\\n }\",\n \"function createUserRoom(data) {\\r\\n inputRoomName.value('');\\r\\n divHome.hide();\\r\\n divRoom.show();\\r\\n currentRoom = data;\\r\\n}\",\n \"function leaveRoom() {\\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\\n if (leaveRoom) {\\n window.location = '../index.html';\\n }\\n}\",\n \"function handleRoomSetup() {\\n app.log(2, 'handleRoomSetup entered');\\n var room_to_create = $.getUrlVar('roomname') || '',\\n item;\\n\\n room_to_create = room_to_create.replace(/ /g, '');\\n app.log(2, 'room_to_create ' + room_to_create);\\n\\n Callcast.CreateUnlistedAndJoin(room_to_create, function(new_name) {\\n var jqDlg, newUrl;\\n // We successfully created the room.\\n // Joining is in process now.\\n // trigger of joined_room will happen upon join complete.\\n\\n app.user.scheduleName = 'Place to meet up';\\n app.user.scheduleJid = new_name + Callcast.AT_CALLCAST_ROOMS;\\n app.user.scheduleTitle = 'Open room';\\n\\n // set local spot nick todo find a better place for this\\n item = app.carousel.getItem(0);\\n app.carousel.setSpotName(item, app.user.name);\\n\\n app.log(2, \\\"Room named '\\\" + new_name + \\\"' has been created. Joining now.\\\");\\n app.log(2, 'window.location ' + window.location);\\n if (room_to_create !== new_name)\\n {\\n newUrl = window.location.pathname + '?roomname=' + new_name;\\n app.log(2, 'replacing state ' + newUrl);\\n history.replaceState(null, null, newUrl);\\n }\\n\\n // warn user if room name changed (overflow)\\n if (room_to_create.length > 0 && room_to_create.toLowerCase() !== new_name.toLowerCase())\\n {\\n // display warning\\n jqDlg = $(app.STATUS_PROMPT_LEFT).css({\\\"display\\\": \\\"block\\\",\\n \\\"background-image\\\": 'url(images/warning.png)'});\\n $('#message', jqDlg).text('Room ' + room_to_create + ' overflowed. You are now in room ' + new_name);\\n $('#stop-showing', jqDlg).css('display', 'none');\\n $('#stop-showing-text', jqDlg).css('display', 'none');\\n }\\n\\n // initialize video, audio state here since this method\\n // is called after the local plugin is loaded\\n // use fb profile pick as bg image if it exists\\n if (!Callcast.IsVideoDeviceAvailable())\\n {\\n if (app.user.fbProfilePicUrl)\\n {\\n $('#meeting > #streams > #scarousel #mystream')\\n .css('background-image', 'url(' + app.user.fbProfilePicUrl + ')');\\n }\\n }\\n else // video available\\n {\\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseVideo === 'false') {\\n changeVideo(false);\\n }\\n else {\\n changeVideo(true); // do this unconditionally so ui gets updated\\n }\\n }\\n if (Callcast.IsMicrophoneDeviceAvailable())\\n {\\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseMicrophone === 'false') {\\n changeAudio(false);\\n }\\n else {\\n changeAudio(true); // do this unconditionally so ui gets updated\\n }\\n }\\n },\\n function(iq)\\n {\\n var errorMsg;\\n if ($(iq).find('roomfull'))\\n {\\n errorMsg = \\\"Sorry, the room \\\" + room_to_create + \\\" is full. Please try again later.\\\";\\n }\\n else\\n {\\n errorMsg = 'There was a problem entering the room ' + room_to_create;\\n }\\n\\n // display error\\n app.log(4, \\\"handleRoomSetup Error \\\" + iq.toString());\\n $('#errorMsgPlugin > h1').text('Oops!!!');\\n $('#errorMsgPlugin > p#prompt').text(errorMsg);\\n closeWindow();\\n openWindow('#errorMsgPlugin');\\n });\\n}\",\n \"createPoll(req, res){ \\n let roomID = req.params.roomId;\\n\\n //idea: to have only one link use session and store in object {session id: room id} if curr session and room found in object render\\n res.render('./teacher/create_poll', {roomID: roomID});\\n }\",\n \"joinRoom({state}, { roomId }) {\\n return state.currentUser.joinRoom({ roomId });\\n }\",\n \"function joinPersonalRoom() {\\n const roomName = createPrivateRoomName(drone.clientId);\\n const myRoom = drone.subscribe(roomName);\\n myRoom.on('open', error => {\\n if (error) {\\n return console.error(error);\\n }\\n console.log(`Successfully joined room ${roomName}`);\\n });\\n\\n myRoom.on('message', message => {\\n const {data, clientId} = message;\\n const member = members.find(m => m.id === clientId);\\n if (member) {\\n addMessageToRoomArray(createPrivateRoomName(member.id), member, data);\\n if (selectedRoom === createPrivateRoomName(clientId)) {\\n DOM.addMessageToList(data, member);\\n }\\n } else {\\n /* Message is sent from golang using the REST API.\\n * You can handle it like a regular message but it won't have a connection\\n * session attached to it (this means no member argument)\\n */\\n }\\n });\\n}\",\n \"joinRoom(room) {\\n if (room === undefined) return;\\n\\n console.log('Attempting to joinRoom. room: ', room);\\n\\n if (!this.isRoomEnterable())\\n {\\n console.log('Not already in a locked room. Cannot join. Giving up...');\\n return;\\n }\\n\\n // TODO: call some join room action\\n\\n $.ajax(\\n {\\n type: 'get',\\n url: 'skylink_api_key'\\n })\\n .done((apiKey) => {\\n\\n console.log('AJAX retrieved successfully.');\\n\\n this.skylink.init(\\n {\\n apiKey: apiKey,\\n defaultRoom: room\\n },\\n (error) => {\\n\\n if (error)\\n {\\n alert('An error has occurred while connecting to SkylinkJS.');\\n return;\\n }\\n\\n this.skylink.joinRoom({\\n audio: true,\\n video: true\\n })\\n });\\n })\\n .fail((err) => {\\n alert('An error has occurred while retrieving the Skylink API key from the server.');\\n });\\n }\",\n \"function func_join_room() {\\n var room_number = document.getElementById('input_text').value;\\n var list_length = list_of_joined.length++;\\n list_of_joined[list_length] = room_number;\\n $(\\\"#div_body_joinedRoom\\\").append(create_room(room_number, 1));\\n func_populate(room_number);\\n func_close_join_room_pop();\\n func_add_room_to_database(room_number);\\n}\",\n \"function setRoom(name) {\\r\\n $('#createRoom').remove();\\r\\n $('h1').text(name);\\r\\n // $('#subTitle').text(name + \\\" || link: \\\"+ location.href);\\r\\n $('body').addClass('active');\\r\\n}\",\n \"function continueClick(){\\n window.location = nextRoom;\\n}\",\n \"function joinroom(data) {\\n\\tvar tmproom = data;\\n\\tif (player != \\\"\\\" && passcode != \\\"\\\" && tmproom >= 0) {\\n\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=joinroom&player=\\\" + player + \\\"&passcode=\\\" + passcode + \\\"&room=\\\" + tmproom;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tstartRoom(data);\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function joinRoom(obj) {\\r\\n modal.style.display = \\\"block\\\";\\r\\n room = obj.id;\\r\\n}\",\n \"function joinRoom() {\\n const roomId = this.id.substr(5, this.id.length-5)\\n player.updatePlayer1(false);\\n //player.setPlayerType(false);\\n socket.emit('joinGame', { name: player.name, room: this.id });\\n\\n //player = new Player(player.name, P2);\\n }\",\n \"render() {\\r\\n return (\\r\\n \\r\\n \\r\\n {\\r\\n return this.state.roomCode ? (\\r\\n \\r\\n ) : (\\r\\n this.renderFirstPage()\\r\\n );\\r\\n }}\\r\\n />\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {\\r\\n return ;\\r\\n }}\\r\\n />\\r\\n \\r\\n \\r\\n );\\r\\n }\",\n \"function createRoom(e) {\\n e.preventDefault();\\n if (username()) {\\n // $.ajax({\\n // url: '/createRoom',\\n // type: 'POST',\\n // beforeSend: function (xhr) {\\n // if (localStorage.getItem(appName)) {\\n // xhr.setRequestHeader('Authorization', localStorage.getItem(appName));\\n // }\\n // },\\n // data: {\\n // username: userName\\n // },\\n // success: function (token) {\\n // console.log(token);\\n // localStorage.setItem(appName, token.token);\\n // },\\n // error: function () {},\\n // });\\n\\n // TODO: Use this params to send token to server on new connection\\n // check if socket is valid and within time limit\\n socket.io.opts.query = {\\n token: alreadyPlayed(),\\n };\\n socket.open();\\n // FIXME: Delet Test emit\\n socket.emit(\\\"newMessage\\\", \\\"lol\\\", function (err, message) {\\n if (err) {\\n return console.error(err);\\n }\\n console.log(message);\\n });\\n socket.on(\\\"newMessage\\\", function (data) {\\n console.log(data);\\n });\\n\\n // Asking to create a new room\\n socket.emit(\\\"createRoom\\\", { username: userName });\\n // socket replies back with created room name (which should be sent to other user who wants to play together)\\n socket.on(\\\"roomNameIs\\\", function (roomName) {\\n // console.log(roomName);\\n document.getElementById(\\\"createdRoomName\\\").innerHTML =\\n \\\"Room name : \\\" + roomName;\\n $(\\\"#createdRoomName\\\").show();\\n currentRoom = roomName;\\n $(\\\".joinRoom\\\").hide();\\n $(\\\".createRoom\\\").hide();\\n $(\\\".generatRoomLink\\\").hide();\\n $(\\\".singleplayerMode\\\").hide();\\n showStartGameButton();\\n currentlyPlaying = true;\\n });\\n console.log(socket);\\n }\\n}\",\n \"function newroom() {\\n\\t$(\\\"#warning2\\\").html(\\\"\\\");\\n\\tvar tmproomname = document.roomform.roomname.value;\\n\\tif (tmproomname.search(/[^a-zA-Z0-9]/) != -1 || tmproomname.length > 16) {\\n\\t\\t$(\\\"#warning2\\\").html(\\\"Viallinen huoneen nimi.\\\");\\n\\t\\treturn;\\n\\t}\\n\\tvar roomname = tmproomname;\\n\\tif (player != \\\"\\\" && passcode != \\\"\\\" && roomname != \\\"\\\") {\\n\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=newroom&player=\\\" + player + \\\"&passcode=\\\" + passcode + \\\"&roomname=\\\" + roomname;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tstartRoom(data);\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function newRoom($id)\\n{\\n\\tif(groupRooms == 0)\\n\\t{\\n\\t\\tshowInfoBox(\\\"system\\\",\\\"220\\\",\\\"300\\\",\\\"200\\\",\\\"\\\",lang6);\\n\\t\\treturn false;\\t\\t\\t\\n\\t}\\n\\n\\tif($id == '1')\\n\\t{\\n\\t\\t// show create room\\n\\t\\tdocument.getElementById(\\\"roomCreate\\\").style.visibility = 'visible';\\n\\t}\\n\\telse\\n\\t{\\n\\t\\t// hide create room\\n\\t\\tdocument.getElementById(\\\"roomCreate\\\").style.visibility = 'hidden';\\n\\t}\\n return false;\\n}\",\n \"function dial (room){\\n if (room !== '') {\\n socket.emit('create or join', room);\\n console.log('Attempted to create or join room', room);\\n }\\n}\",\n \"joinRoom(data) {\\n socket.emit('join-room', data);\\n }\",\n \"function joinRoom(socket, room) {\\n // If the close timer is set, cancel it\\n // if (closeTimer[room]) {\\n // clearTimeout(closeTimer[room]);\\n // }\\n\\n // Create Paperjs instance for this room if it doesn't exist\\n var project = projects.projects[room];\\n if (!project) {\\n console.log(\\\"made room\\\");\\n projects.projects[room] = {};\\n // Use the view from the default project. This project is the default\\n // one created when paper is instantiated. Nothing is ever written to\\n // this project as each room has its own project. We share the View\\n // object but that just helps it \\\"draw\\\" stuff to the invisible server\\n // canvas.\\n projects.projects[room].project = new paper.Project();\\n projects.projects[room].external_paths = {};\\n db.join(socket, room);\\n } else { // Project exists in memory, no need to load from database\\n loadFromMemory(room, socket);\\n }\\n}\",\n \"function joinRoom(roomName) {\\n disableElements('joinRoom');\\n\\n // Check if roomName was given or if it's joining via roomName input field\\n if(typeof roomName == 'undefined'){\\n roomName = document.getElementById('roomName').value;\\n }\\n document.getElementById('roomName').value = roomName;\\n\\n var data = {\\n id: \\\"joinRoom\\\",\\n roomName: roomName\\n };\\n sendMessage(data);\\n}\",\n \"function joinAndConnectRoom (roomId) {\\n $.post(\\\"/chatroom/joinedRooms\\\", {username:username}, function(data) {\\n let joinedRoomsGroup = $(\\\"#joinedRooms\\\");\\n joinedRoomsGroup.empty();\\n if (data == null) return;\\n for(let i = 0; i < data.length ;i++) {\\n let room = data[i];\\n let type = room.type;\\n let roomTemp = templateJoinedRoom;\\n roomTemp = roomTemp.replace('ROOM-NAME', room.name);\\n roomTemp = roomTemp.replace('ROOM-ID',room.id);\\n roomTemp = roomTemp.replace('all-room-ROOM-ID','joined-room' + room.id);\\n if(type === \\\"Public\\\") {\\n if(room.name === \\\"General\\\") {\\n roomTemp = roomTemp.replace('ROOM-STYLE',\\\"list-group-item-success\\\");\\n } else {\\n roomTemp = roomTemp.replace('ROOM-STYLE',\\\"list-group-item-primary\\\");\\n }\\n } else if (type === \\\"Private\\\") {\\n roomTemp = roomTemp.replace('ROOM-STYLE',\\\"list-group-item-secondary\\\");\\n } else {\\n return null;\\n }\\n roomTemp = roomTemp.replace('ROOM-GROUP-NAME',\\\"joined-room\\\");\\n joinedRoomsGroup.append(roomTemp);\\n }\\n $('#joined-room' + roomId).prop(\\\"checked\\\", true);\\n connectToRoom();\\n },\\\"json\\\");\\n}\",\n \"function requestCreateRoom() {\\r\\n if (inputRoomName.value()) {\\r\\n socket.emit(\\\"createRoomRequest\\\", inputRoomName.value(), (response) => {\\r\\n if(!response){\\r\\n errorNameUsed(inputRoomName.value());\\r\\n } else{\\r\\n createUserRoom(inputRoomName.value());\\r\\n }\\r\\n });\\r\\n currentRoom = inputRoomName.value();\\r\\n }\\r\\n}\",\n \"function generateNewRoom(name) {\\n\\t\\n\\t//send the request to the server\\n\\tvar posting = $.post(roomsURI + \\\"/add\\\", {\\n\\t\\tname : name\\n\\t});\\n\\t\\n\\t//Send new room to server\\n\\tposting.done(function(data) {\\n\\t\\tvar room = JSON.parse(JSON.stringify(data));\\n\\t\\t//$(\\\"#chat-rooms-list\\\").children(\\\"li[room_id!=2]\\\").remove(); //remove the last room\\n\\t\\t//$(\\\"#chat-rooms-list\\\").append(createRoomElement(room)); //add this in it's place\\n\\t\\t$(\\\"#chat-rooms-dropdown-list\\\").append(createRoomElement(room));\\n\\t\\troom_id_list.push(room.roomID);\\n\\t\\tjoinRoom(room.roomID,true);\\n\\t});\\n}\",\n \"joinRoom(roomId) {\\n this.socket.emit('create or join', roomId)\\n console.log(`joinRoom ${roomId}`)\\n this.roomId = roomId\\n }\",\n \"function getRoom(request, response) {\\n let roomName = request.params.roomName;\\n // Chatroom.find({chatroom_name: roomName}, function (err, docs) {\\n // if (err) {\\n // console.log(err);\\n // } else {\\n // let roomId;\\n // // If a chatroom with that name exists get it, else create one\\n // if (docs.length > 0) {\\n // roomId = docs[0].chatroom_id;\\n // } else {\\n // roomId = roomGenerator.roomIdGenerator()\\n // const newChatroom = new Chatroom ({\\n // chatroom_id: roomId,\\n // chatroom_name: roomName\\n // });\\n\\n // newChatroom\\n // .save()\\n // .then(item => console.log(item))\\n // .catch(err => console.log(err));\\n // }\\n\\n // TODO: Get the messages and submit to room.hbs\\n Messages.find({ chatroom_name: roomName })\\n .lean()\\n .then((items) => {\\n response.render(\\\"room\\\", {\\n title: \\\"chatroom\\\",\\n roomName,\\n messages: items,\\n isAvailable: true,\\n // newRoomId: roomId\\n });\\n });\\n}\",\n \"function goToRoster()\\n{\\n saveTeam();\\n window.location.href = \\\"roster.html\\\";\\n}\",\n \"connectToRoom() {\\n const activeRoom = get(this, 'roomId');\\n if (activeRoom) {\\n const sessionManager = get(this, 'webrtc');\\n sessionManager.joinRoom(activeRoom);\\n }\\n }\",\n \"function roomover(){\\n createtoast('u have been kicked out by ADMIN');\\n showfeedbackscreen();\\n //window.location.href = window.location.origin;\\n}\",\n \"function newRoom() {\\n socket.emit(\\\"newRoom\\\");\\n}\",\n \"function createNewRoom() {\\n console.log(nextRoomId);\\n createRoomDOM(nextRoomId);\\n signalRoomCreated(nextRoomId);\\n\\n nextRoomId++;\\n}\",\n \"enterRoom(room) {\\n console.warn(\\\"Cannot enter room different room from InBrowserBot\\\")\\n }\",\n \"join(room){\\n \\tthis.room[room] = true;\\n\\t}\",\n \"goToAjout() {\\n history.push(\\\"/main/clients/ajout\\\");\\n }\",\n \"joinRoom(room, hostExist, listensers) {\\n trace(`Entering room '${room}'...`);\\n this.socket.emit('join', room, hostExist, listensers);\\n }\",\n \"function joinRoom() {\\n var u = document.getElementById(\\\"username\\\").value;\\n if(u === \\\"\\\") {\\n setJoinError(\\\"Please choose a username\\\");\\n return;\\n }\\n var r = document.getElementById(\\\"room\\\").value;\\n if(r === \\\"\\\") {\\n setJoinError(\\\"Please enter a room\\\");\\n return;\\n }\\n var c = document.getElementById(\\\"color\\\").value;\\n if(c === \\\"\\\") {\\n setJoinError(\\\"Please choose a color\\\");\\n return;\\n }\\n r = r.replace(/\\\\s+/g, ''); // Remove whitespace from room name\\n r = r.toLowerCase();\\n var join_message = {username: u, room: r, color: c};\\n Game = new MultiplayerGame(u, r);\\n socket.emit('join', join_message)\\n}\",\n \"function joinRoom() {\\r\\n let roomID = $(\\\"#joinRoomID\\\").val();\\r\\n socket.emit(\\\"joinByRoomID\\\", roomID);\\r\\n}\",\n \"function joinRoom(event){\\n \\tvar x = $(event.target).text();\\n if(x == roomIn){\\n\\n } else {\\n socketio.emit(\\\"join_room\\\", {roomName:x, password:\\\"\\\"});\\n }\\n }\",\n \"function createOrAddToRoom(){\\n\\n if(!socketClients[clientId]){\\n\\n //if user does not exist\\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\\n if (error) return sendError('invalid cookie')\\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\\n\\n createOrAddToRoom()\\n })\\n\\n \\n }\\n\\n //also broadcast on join and leave and also joined member\\n // console.log(clientId,'creating room or adding:'+roomLabel)\\n function createRoom(){\\n roomToken = random()\\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\\n }\\n\\n if (!roomsRegistry[roomLabel]){ //room not constructed \\n roomsRegistry[roomLabel] = { full:{},notFull:{} }\\n createRoom()\\n }else{\\n\\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\\n createRoom()\\n }else{\\n\\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\\n\\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\\n\\n \\n\\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\\n\\n if(membersCountOfNotFull === notFullRoomLimit){\\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\\n }\\n\\n }\\n\\n }\\n\\n broadcast(roomToken,null,'onopen',roomLabel)\\n\\n }\",\n \"function join ( room, username ) {\\n \\n var id = getRoomId ( room );\\n \\n mapUserRooms ( id, username );\\n \\n return id;\\n}\",\n \"function createBoard() {\\n\\tsocket.close();\\n\\tdocument.location.href = 'crear-partida.xhtml?session=' + session + '&player=' + player;\\n}\",\n \"function leaveRoom() {\\n let chatLink = server + '/chat/' + roomId;\\n Swal.fire({ background: background, position: \\\"top\\\", title: \\\"Leave this room?\\\",\\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\\n }).then((result) => { if (result.isConfirmed) window.location.href = \\\"/main\\\"; });\\n}\",\n \"function bookRoom(roomTypeId, checkIn, checkOut) {\\n // if the user isn't signed in, prompt them to do so (or create an account)\\n if(localStorage.getItem('userLogin') == null) {\\n document.getElementById(\\\"sectLogin\\\").style['display'] = \\\"block\\\";\\n showSignIn();\\n } else {\\n // the user is already signed in, so go to the checkout page\\n window.location.assign(\\\"bookReservation.html?roomTypeId=\\\" + roomTypeId + \\\"&checkIn=\\\" + checkIn + \\\"&checkOut=\\\" + checkOut);\\n }\\n}\",\n \"function switchRoom(room){\\n\\t\\tsocket.emit('switchRoom', room);\\n\\t}\",\n \"function findRoom(req, res, next) {\\n if (req.query.Name == null) res.redirect(\\\"/rooms\\\");\\n else {\\n room\\n .findOne({ Name: req.query.Name })\\n .populate({\\n path: \\\"Detail\\\",\\n populate: {\\n path: \\\"Reserve\\\",\\n match: {\\n $or: [\\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\\n ]\\n }\\n }\\n })\\n .exec(function(err, Room) {\\n if (err) console.error(err);\\n var counter = 0;\\n for (var i = 0; i < Room.Detail.length; i++) {\\n if (Room.Detail[i].Reserve.length == 0) {\\n counter++;\\n req.session.ReserveInfo = Room.Detail[i];\\n req.session.RoomInfo = Room;\\n break;\\n }\\n }\\n if (counter == 0) {\\n console.log(\\\"No room left\\\");\\n res.redirect(\\\"/rooms/\\\" + req.query.Name, {\\n info: { message: \\\"No Room Left\\\" }\\n });\\n } else {\\n return next();\\n }\\n });\\n }\\n}\",\n \"function joinOrCreateRoom(roomCode) {\\n socket.join(roomCode, () => {\\n // Sets the socket's room code\\n socket.roomCode = roomCode\\n // Sends room code to client\\n socket.emit('room_joined', roomCode)\\n // Updates GM's player list\\n updateGMRoomMembers()\\n })\\n }\",\n \"getRoomURL() {\\n return location.protocol + \\\"//\\\" + location.host + (location.path || \\\"\\\") + \\\"?room=\\\" + this.getRoom();\\n }\",\n \"function enter(role) {\\r\\n\\r\\n\\tdisableNameInput();\\r\\n\\tvar message = {\\r\\n\\t\\tid: 'joinRoom',\\r\\n\\t\\tname: name,\\r\\n\\t\\troomName: roomId,\\r\\n\\t\\trole: role,\\r\\n\\t\\t// Flags for use cases, where user did not give the permissions to his media devices.\\r\\n\\t\\t// Constraints to the connection to KMS should be in the same way e.g. audio:true; video:false.\\r\\n\\t\\taudioOn: acceptAudio,\\r\\n\\t\\tvideoOn: acceptVideo,\\r\\n\\t\\tvideoBeforeEnterTheRoom: videoBeforeEnterTheRoom\\r\\n\\t}\\r\\n\\tsendMessage(message);\\r\\n\\ttoggleEnterLeaveButtons();\\r\\n\\r\\n}\",\n \"function name_validate(roomParam) {\\n roomParam.child(\\\"people/\\\" + $(\\\"#input_name\\\").val()).once('value', snapshot => {\\n if (!snapshot.exists()) {\\n let name = $(\\\"#input_name\\\").val();\\n roomParam.child(\\\"people/\\\" + name).set(true); //adds username to the database, within the room they are joining\\n myStorage.setItem(\\\"name\\\", name);\\n myStorage.setItem(\\\"roomCode\\\", $(\\\"#input_number\\\").val());\\n window.location.href = \\\"activity.html\\\";\\n // a comment\\n } else {\\n $(\\\".join_room_popup_content\\\").css(\\\"height\\\",\\\"14em\\\");\\n $(\\\"#pop_message\\\").html(\\\"Sorry, that name is taken.\\\");\\n }\\n });\\n }\",\n \"function renderRoom(req, res) {\\n res.render('pages/room', {connectedUsers: connectedUsers});\\n}\",\n \"function changeRoom() {\\n if (currentRoom !== undefined) {\\n var desired_room = rotateRoom(currentRoom, this.id);\\n\\n initialState();\\n setMqttRoom(desired_room);\\n get_backend(room_list[desired_room]);\\n\\n }\\n}\",\n \"function buttonClicked(event) {\\n var button = event.target;\\n var room = button.parentElement.parentElement.parentElement;\\n console.log(room);\\n localStorage.setItem(\\\"bookingRoom\\\", room.id);\\n window.location.assign(\\\"bookingPage.html\\\")\\n}\",\n \"function setJoinCallBtn() {\\n joinCallBtn.addEventListener(\\\"click\\\", async (e) => {\\n window.location.href='/join/' + roomId;\\n });\\n}\",\n \"function connectToRoom() {\\n let roomId = $(\\\"#joinedRooms\\\").find('input[name=\\\"joined-room\\\"]:checked').val();\\n if(!checkElement(roomId)) return;\\n\\n startChatArea();\\n\\n $.post(\\\"/chatroom/connect\\\", {username: username, chatroomId: roomId}, function (data) {\\n chatroomId = roomId;\\n chatroomType = data.type;\\n chatroomName = data.name;\\n adminList = data.admins;\\n $(\\\"#chatRoomName\\\").html(data.name + \\\" (\\\" + data.type + \\\")\\\");\\n $(\\\"#chatRoomDescription\\\").html(data.description);\\n\\n loadUser();\\n\\n displayMessages(roomId);\\n getChatRoomUsers();\\n\\n //Clear unread notification\\n let unread = $(\\\"#joined-room\\\" + chatroomId + \\\" + span .badge-danger\\\");\\n unread.addClass(\\\"d-none\\\");\\n unread.html(0);\\n\\n $('#collapseTwo').removeClass('show');\\n $('#collapseOne').addClass('show');\\n $(\\\"#joinedRooms\\\").find('input[name=\\\"joined-room\\\"]:checked').prop(\\\"checked\\\", false);\\n }, \\\"json\\\");\\n}\",\n \"redirectToMeetings(ev) {\\n ev.preventDefault();//prevent form submittion(delete team)\\n loadMeetings(this.props.params.teamId,this.loadMeetings);\\n }\",\n \"function joinRoom() {\\n\\tif (state == null) {\\n\\t\\t// var campname = document.querySelector('#incoming').value;\\n\\t\\tvar campname = 'dgnby';\\n\\t\\t// TODO: check name is valid, alert() if not\\n\\t\\tdatabase.ref('hosts/' + campname + '/').update({\\n\\t\\t\\t// add client signal data to database\\n\\t\\t\\tjoinData: signalClient,\\n\\t\\t});\\n\\n\\t\\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\\n\\t\\t// wait for host to respond to client signal data\\n\\t\\thostData.on('value', function(snapshot) {\\n\\t\\t\\tif(state == \\\"client\\\"){\\n\\t\\t\\t\\tsetTimeout(function(){ readAnswer(campname); }, 200);\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tstate = \\\"client\\\";\\n\\t}\\n\\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\\n}\",\n \"function loadLobby(){\\n window.location.href = \\\"/lobby\\\";\\n}\",\n \"function connectToRoomNew(roomData) {\\n var data = roomData;\\n roomNo = roomData.roomID\\n\\n //Checking the database\\n getRoomData(roomNo).then(result => {\\n //If it is a new room\\n if(!result){\\n //Store the data in indexedDB\\n storeRoomData(data);\\n //Open socket and display chat\\n socket.emit('create or join', roomNo, data.accessedBy, data.imageSrc);\\n displayLoadedMessages([]);\\n hideLoginInterface(roomNo, data.accessedBy);\\n initCanvas(socket, data.imageSrc, \\\"\\\");\\n //Initialise annotation modal\\n annotationCanvasInit();\\n }\\n\\n //If room already exists\\n else{\\n //Open socket\\n socket.emit('create or join', result.roomID, result.accessedBy, result.imageSrc);\\n //Load data from indexedDB\\n displayLoadedMessages(result.messages);\\n //Display chat\\n hideLoginInterface(result.roomID, result.accessedBy);\\n initCanvas(socket, result.imageSrc, result.canvas);\\n //Initialise annotation modal\\n annotationCanvasInit();\\n }\\n });\\n\\n //Refresh annotations\\n refreshAnnotations(roomNo);\\n}\",\n \"onLeave(client, consented) {\\n\\t\\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\\n\\t}\",\n \"function reloadRoom(){\\n\\twindow.location.assign('https://www.c4cstream.com/?room='+tag_no); \\n}\",\n \"startCommunication(room) {\\n this.debug && console.log('Attempted to create or join room: ', room);\\n const joinApi = this.joinUrl + `/api/v1/im/join`;\\n fetch(joinApi, {\\n method: 'POST',\\n mode: 'cors',\\n headers: {\\n 'Content-Type': 'application/json; charset=UTF-8'\\n },\\n body: JSON.stringify({\\n roomId: room,\\n userId: this.userId\\n })\\n })\\n .then(async data => {\\n const { code } = await data.json(); // maybe:ok: false status: 504\\n if (code === 200) {\\n this.debug && console.log('call join room api successfully!', room);\\n this._handleCreateAndJoin(room);\\n this.socket.send(this.encodeMsg('create-join'));\\n }\\n })\\n .catch(error => {\\n console.error('[lsp join room api occurred]', error);\\n });\\n }\",\n \"function handleCreateRoomEnter(e){\\n if(e.key === \\\"Enter\\\"){\\n createRoomButton();\\n }\\n }\",\n \"function joinRoom() {\\n remoteStream = new MediaStream();\\n document.querySelector('#localVideo').srcObject = localStream;\\n document.querySelector('#remoteVideo').srcObject = remoteStream;\\n document.querySelector('#confirmJoinBtn').addEventListener('click', async() => {\\n roomId = document.querySelector('#room-id').value;\\n console.log('Join room: ', roomId);\\n document.querySelector(\\n '#currentRoom').innerText = `Room ID: ${roomId} `;\\n await joinRoomById(roomId);\\n }, { once: true });\\n roomDialog.open();\\n}\",\n \"function leaveRoom() {\\n\\tif (player != \\\"\\\") {\\n\\t\\troundEnded();\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=leaveroom&player=\\\" + player + \\\"&passcode=\\\" + passcode;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tinitRoomList();\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function showRoomListPage() {\\n\\tleaveRoom();\\n\\tpage_1.style.display = \\\"block\\\";\\n\\tpage_2.style.display = \\\"none\\\";\\n\\twindow.history.replaceState('test', '', '?main=true');\\t\\n}\",\n \"createRoom() {\\n const room = this.currentUser.createRoom({\\n id: this.props.items.name,\\n name: this.props.items.name,\\n private: false,\\n }) .catch(err => {\\n console.log(\\\"nope\\\");\\n }); \\n }\",\n \"async adminJoinRoom(room) {\\n //Fetch the currently logged in user\\n let user = firebase.auth().currentUser\\n\\n //Retrieve an instance of our Firestore Database\\n const db = firebase.firestore()\\n\\n //Save the room in the database that the admin just joined\\n let adminUsersRef = await db.collection('admin-users').doc(user.uid)\\n let adminUsersSnapShot = await adminUsersRef.get()\\n\\n if (adminUsersSnapShot.exists) {\\n adminUsersRef.update({\\n \\\"admin_room_location\\\": room\\n })\\n .then(() => {\\n this.props.history.push('/chat')\\n })\\n this.context.triggerAdminJoinRoom(room)\\n } \\n }\",\n \"function partingFromRoom( room ) {\\n}\",\n \"function generatRoomLink() {\\n MicroModal.show(\\\"generateShareableRoomLinkModal\\\");\\n\\n // if (true) {\\n if (!shareableRoomLinkAlreadyGenerated()) {\\n $.ajax({\\n url: \\\"/api/game/generateroom\\\",\\n type: \\\"GET\\\",\\n beforeSend: function (xhr) {\\n // TODO: Send user IP ? for throttling purpose\\n },\\n data: {},\\n success: function (data) {\\n console.log(data);\\n localStorage.setItem(\\n appName + \\\"_GENERATED_ROOM_ID\\\",\\n JSON.stringify(data)\\n );\\n $(\\\"#shareableRoomLink\\\").text(\\n window.location.host + \\\"/?\\\" + GAMEURLPARAMS + \\\"=\\\" + data.gameKey\\n );\\n },\\n error: function (err) {\\n console.log(err);\\n },\\n });\\n } else {\\n $(\\\"#shareableRoomLink\\\").text(\\n window.location.host +\\n \\\"/?\\\" +\\n GAMEURLPARAMS +\\n \\\"=\\\" +\\n JSON.parse(localStorage.getItem(appName + \\\"_GENERATED_ROOM_ID\\\")).gameKey\\n );\\n }\\n}\",\n \"function oneOnone() {\\n return (\\n
    \\n \\n \\n \\n \\n \\n
    \\n );\\n}\",\n \"function requestJoin(type) {\\n let roomId;\\n if (type === \\\"public\\\") {\\n roomId = $('input[name=\\\"all-public-room\\\"]:checked').val();\\n } else {\\n roomId = $('input[name=\\\"all-private-room\\\"]:checked').val();\\n }\\n\\n if (requestRoomsList.indexOf(parseInt(roomId)) < 0) {\\n requestRoomsList.push(parseInt(roomId));\\n $.post(\\\"/chatroom/requestJoin\\\", {username: username, chatroomId: roomId}, function (data) {\\n if (data === \\\"failure\\\") {\\n $(\\\"#all-room\\\" + roomId).parent().parent().removeClass(\\\"list-group-item-success\\\");\\n $(\\\"#all-room\\\" + roomId).parent().parent().addClass(\\\"list-group-item-danger\\\");\\n }\\n if (type === \\\"public\\\") {\\n joinAndConnectRoom(roomId);\\n getChatRoomUsers();\\n getJoinedRooms();\\n } else {\\n requestRoomId = roomId;\\n isWaitingAccept = true;\\n }\\n }\\n , \\\"json\\\");\\n }\\n}\",\n \"function AlumnoCrear() {\\n window.location = `./AlumnoCrear.html?usu_id=${params.get('usu_id')}`;\\n}\",\n \"function getRoomURL() {\\n\\treturn location.protocol + \\\"//\\\" + location.host + (location.pathname || \\\"\\\") + \\\"?room=\\\" + getRoom();\\n}\",\n \"function joinDemo()\\n{\\n\\tuserName = document.getElementById(\\\"txtUserName\\\").value;\\n\\tvLocation = document.getElementById(\\\"DDLocation\\\").value;\\n\\tvSubscribe = document.getElementById(\\\"DDChat\\\").value;\\n\\tif(userName == \\\"\\\" || userName == \\\"null\\\" || userName == null || userName == \\\"undefined\\\" || userName == undefined)\\n\\t{\\n\\t\\talert(\\\"Please Enter Username.\\\")\\n\\t\\treturn;\\n\\t}\\n\\twindow.location.href = \\\"/home.html\\\";\\n}\",\n \"function addUnit(class_room_id) {\\n\\n\\t\\twindow.location.href = web+\\\"classroom-unit/create\\\" + \\\"?class_room_id=\\\" + class_room_id + \\\"\\\";\\n\\n }\",\n \"function createRoom(){\\n roomToken = random()\\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\\n }\",\n \"function setRoom(name) {\\n\\t$('#joinRoom').remove();\\n\\t$('h1').text('Room name : ' + name);\\n\\t$('body').append('');\\n\\t$('body').addClass('active');\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7536238","0.7142537","0.69698006","0.6648515","0.66118354","0.6590052","0.6523262","0.6497811","0.6487846","0.64606035","0.64541465","0.6422784","0.64120525","0.6398517","0.6353128","0.63165313","0.6307308","0.6282584","0.62794757","0.6279065","0.6278614","0.6270213","0.62675977","0.6231085","0.62234706","0.62189525","0.6204589","0.61960244","0.6188422","0.6168727","0.616249","0.61623615","0.6137989","0.61029524","0.6079226","0.6076468","0.605391","0.6038186","0.6035048","0.6033718","0.6026491","0.6017686","0.60140616","0.6001554","0.5997513","0.59725136","0.5946879","0.594426","0.5938398","0.5920583","0.59199315","0.5910556","0.59079903","0.59034896","0.5898235","0.5896199","0.58884984","0.58780384","0.5870305","0.58653665","0.5864065","0.58530974","0.5839909","0.58370584","0.5830843","0.58117104","0.5810467","0.5793948","0.5781513","0.57730097","0.57648164","0.5746945","0.5738096","0.5731701","0.57200056","0.571905","0.57117164","0.57088935","0.570082","0.56966776","0.566946","0.56525093","0.56455785","0.5643858","0.5638147","0.56369054","0.56265193","0.562536","0.5623882","0.56192","0.5617838","0.56053215","0.5603824","0.5603807","0.5592171","0.55889916","0.55787575","0.55783176","0.5568709","0.55669"],"string":"[\n \"0.7536238\",\n \"0.7142537\",\n \"0.69698006\",\n \"0.6648515\",\n \"0.66118354\",\n \"0.6590052\",\n \"0.6523262\",\n \"0.6497811\",\n \"0.6487846\",\n \"0.64606035\",\n \"0.64541465\",\n \"0.6422784\",\n \"0.64120525\",\n \"0.6398517\",\n \"0.6353128\",\n \"0.63165313\",\n \"0.6307308\",\n \"0.6282584\",\n \"0.62794757\",\n \"0.6279065\",\n \"0.6278614\",\n \"0.6270213\",\n \"0.62675977\",\n \"0.6231085\",\n \"0.62234706\",\n \"0.62189525\",\n \"0.6204589\",\n \"0.61960244\",\n \"0.6188422\",\n \"0.6168727\",\n \"0.616249\",\n \"0.61623615\",\n \"0.6137989\",\n \"0.61029524\",\n \"0.6079226\",\n \"0.6076468\",\n \"0.605391\",\n \"0.6038186\",\n \"0.6035048\",\n \"0.6033718\",\n \"0.6026491\",\n \"0.6017686\",\n \"0.60140616\",\n \"0.6001554\",\n \"0.5997513\",\n \"0.59725136\",\n \"0.5946879\",\n \"0.594426\",\n \"0.5938398\",\n \"0.5920583\",\n \"0.59199315\",\n \"0.5910556\",\n \"0.59079903\",\n \"0.59034896\",\n \"0.5898235\",\n \"0.5896199\",\n \"0.58884984\",\n \"0.58780384\",\n \"0.5870305\",\n \"0.58653665\",\n \"0.5864065\",\n \"0.58530974\",\n \"0.5839909\",\n \"0.58370584\",\n \"0.5830843\",\n \"0.58117104\",\n \"0.5810467\",\n \"0.5793948\",\n \"0.5781513\",\n \"0.57730097\",\n \"0.57648164\",\n \"0.5746945\",\n \"0.5738096\",\n \"0.5731701\",\n \"0.57200056\",\n \"0.571905\",\n \"0.57117164\",\n \"0.57088935\",\n \"0.570082\",\n \"0.56966776\",\n \"0.566946\",\n \"0.56525093\",\n \"0.56455785\",\n \"0.5643858\",\n \"0.5638147\",\n \"0.56369054\",\n \"0.56265193\",\n \"0.562536\",\n \"0.5623882\",\n \"0.56192\",\n \"0.5617838\",\n \"0.56053215\",\n \"0.5603824\",\n \"0.5603807\",\n \"0.5592171\",\n \"0.55889916\",\n \"0.55787575\",\n \"0.55783176\",\n \"0.5568709\",\n \"0.55669\"\n]"},"document_score":{"kind":"string","value":"0.6787807"},"document_rank":{"kind":"string","value":"3"}}},{"rowIdx":41,"cells":{"query":{"kind":"string","value":"used by collapsible() to hide elements"},"document":{"kind":"string","value":"function hideElements() {\n let elementsToHide = document.querySelectorAll(\".elementToHide\");\n \n elementsToHide.forEach((item) => {\n item.classList.toggle(\"hide-element\");\n })\n // console.log(elementsToHide);\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":["hide() {}","function hideElements() {\n $(\"#collapse_icon\").html(\"show\");\n $(\".sidebar_elements\").addClass(\"hidden\").fadeTo(600, 0).css('dispaly', 'flex');\n $(\"#cross\").removeClass(\"hidden\").fadeTo(600, 1).css('dispaly', 'flex');\n}","function hide() {\n $.forEach(this.elements, function(element) {\n element.style.display = 'none';\n });\n\n return this;\n }","_hide() {\n this.panelElem.addClass(\"hidden\");\n }","hide ()\n\t{\n\t\t//hide the elements of the view\n\t\tthis.root.style.display= 'none';\n\t}","function xHide(e){return xVisibility(e,0);}","_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }","hide() {\n this.isVisible = false;\n }","function hideElements(){\n\t$(\".trivia\").toggle();\n\t$(\".navbar\").toggle();\n\t$(\".end\").toggle();\n}","function hideAll(){\n $$('.contenido').each(function(item){\n item.hide();\n })\n}","hide() {\n\t\tthis.style.display = \"none\";\n\t}","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach(val => val.hide());\n }","onHide() {}","onHide() {}","function hide() {\n that.isSelected = false;\n // change class to default\n that.row.className = 'maqaw-visitor-list-entry';\n that.row.style.display = 'none';\n // tell the VisitorList that we are going to hide this visitor so that it can deselect\n // it if necessary\n that.visitorList.hideVisitor(that);\n // clear chat window\n that.visitorList.chatManager.clear(that);\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $sectionUserProfile\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","hide (element){\n element.style.display = \"none\";\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","function collapseContainers( containers ){\n containers.classed(\"hidden\", true);\n }","hide(){\r\n this.containerElement.style.display=\"none\";\r\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedArticles\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","function hideItems(){\n $(\".bap-objective\").each(function(){\n $(this).css({'display' : 'none'});\n });\n \n $(\".bap-actions\").each(function(){\n $(this).css({'display' : 'none'});\n });\n \n return false;\n}","hideContent() {\n this.content.attr('hidden', 'hidden');\n }","hide() {\n ELEM.setStyle(this.elemId, 'visibility', 'hidden', true);\n this.isHidden = true;\n return this;\n }","hide () {\n this.showing = false\n this.element ? this.element.update(this) : null\n }","function unhide(x){\n\t\tdocument.getElementById(x).style.display=\"inline-block\";\n\t}","hide({ state }) {\n state.visable = false;\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n // **** added favorite article, submit story, user profile hide\n $submitStoryForm,\n $favoriteArticles,\n $userProfile,\n // ****\n ];\n elementsArr.forEach(($elem) => $elem.hide());\n }","function hideAllContent() {\n $(\"#overview\").hide();\n $(\"#tips\").hide();\n $(\"#sample1\").hide();\n $(\"#sample2\").hide();\n $(\"#sample3\").hide();\n }","setVisible() {\n element.removeClass('hidden');\n }","setVisible() {\n element.removeClass('hidden');\n }","function hideElement(e) {\n e.style.display = \"none\";\n }","function hide(el) {\n\t\tel.style.display = 'none';\n\t}","function hide_all() {\n $('#punctual-table-wrapper').collapse(\"hide\")\n $(\"#meta-info\").hide()\n $(\"#progress_bar\").hide()\n $(\"#arrived-late\").hide()\n $(\"#punctual\").hide()\n $(\"#left-early\").hide()\n $(\"#punctual-day-chart\").hide()\n $(\"#breakdown p\").hide()\n}","hide(){\n const listElements = this.el.childNodes;\n for(let i = 0; i < listElements.length; i++){\n listElements[i].removeEventListener('click',this.onItemClickedEvent);\n }\n this.el.innerHTML = '';\n }","function unhide(el) {\n $(el).removeClass(\"hidden\");\n }","unhide() {\n document.getElementById(\"guiArea\").classList.remove(\"hideMe\");\n document.getElementById(\"guiAreaToggle\").classList.remove(\"hideMe\");\n }","_hide() {\n $.setDataset(this._target, { uiAnimating: 'out' });\n\n $.fadeOut(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.removeClass(this._target, 'active');\n $.removeClass(this._node, 'active');\n $.removeDataset(this._target, 'uiAnimating');\n $.setAttribute(this._node, { 'aria-selected': false });\n $.triggerEvent(this._node, 'hidden.ui.tab');\n }).catch((_) => {\n if ($.getDataset(this._target, 'uiAnimating') === 'out') {\n $.removeDataset(this._target, 'uiAnimating');\n }\n });\n }","function showElements() {\n $(\"#collapse_icon\").html(\"hide\");\n $(\".sidebar_elements\").removeClass(\"hidden\").fadeTo(600, 1);\n $(\".range_options\").css('display', 'flex');\n $(\"#cross\").addClass(\"hidden\").fadeTo(600, 0);\n}","function hide() {\n\t\tdashboardContent.empty();\n\n\t}","hide() {\n\t\tthis.panelEl.classList.remove(classes.panel.open);\n\t\tthis.panelEl.classList.add(classes.panel.closed);\n\t}","hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }","onHide() {\n\t}","function hide(event) { event.target.style.visibility = \"hidden\"; }","function hide(el){\r\n el = getList(el);\r\n\r\n for(var i = 0; i $elem.addClass(\"hidden\"));\n }","hide_() {\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\n }","function hideStartingInfo() {\r\n // Hides savings/checking info and transaction info.\r\n hideToggle(checking_info); \r\n hideToggle(savings_info); \r\n hideToggle(transactions); \r\n}","function hide(el){\n el = getList(el);\n\n for(var i = 0; iShow \" + legendText + \"\");\r\n showHide.wrap(\"
    \");\r\n showHide.before(show);\r\n showHide.hide();\r\n function showFunc(event)\r\n {\r\n target = jQ(event.target);\r\n target.hide();\r\n target.next().show();\r\n }\r\n function hideFunc(event)\r\n {\r\n target = jQ(event.target).parent();\r\n target.hide();\r\n target.prev().show();\r\n }\r\n show.click(showFunc);\r\n legend.click(hideFunc);\r\n }\r\n showHides = jQ(\"div.showHideToggle\");\r\n showHides.each(function() {\r\n var showHideDiv = jQ(this);\r\n var toggleText = showHideDiv.find(\"input[@name='toggleText']\").val();\r\n var contentDiv = showHideDiv.find(\">div\");\r\n var cmd = showHideDiv.find(\">span.command\");\r\n cmd.click(function(){ contentDiv.toggleClass(\"hidden\"); var t=cmd.html(); cmd.html(toggleText); toggleText=t; });\r\n });\r\n}","hide() {\n for (var dependent of this.get_dependents()) {\n try { dependent.hide(); }\n catch (e) {}\n }\n }","function collapseHide() {\n $( \".slide-collapse\" ).click(function() {\n collapse($(this));\n });\n}","function hideSelectorContainers(){\n\thideTypeSelector();\n\thidePlayerSelector();\n\thideYearSelector();\n\thideWeekSelector();\n\thideStatNameSelector();\n\thideTeamSelector();\n}","static hide(v) {\n // Set style to none\n UI.find(v).setAttribute(\"hidden\", \"true\");\n }","showContent() {\n this.content.removeAttr('hidden');\n }","function hideTreeExpandCollapseButtons(hide) {\n\tif(hide) {\n\t\t$('#tree-expand').hide();\n\t\t$('#tree-collapse').hide();\n\t\t$('#save-as-profile-btn').hide();\n\t}\n\telse {\n\t\t$('#tree-expand').show();\n\t\t$('#tree-collapse').show();\n\t\t$('#save-as-profile-btn').show();\n\t}\n\t\n}","function invisible(item) {\n item.css(\"visibility\", \"hidden\");\n }","function hideSlides(){\n $('.caps').hide()\n $('.headers').hide();\n}","static hide(obj) {\n obj.setAttribute('visibility', 'hidden');\n }","function hideElement () {\n if(this instanceof HTMLCollection || this instanceof NodeList) {\n for(var i = 0; i < this.length; i++) {\n this[i].style.display = 'none';\n }\n }\n else if(this instanceof HTMLElement) {\n this.style.display = 'none';\n }\n\n return this;\n }","function hideElement() {\n header.setAttribute(\"style\", \"visibility: hidden\");\n text.setAttribute(\"style\", \"visibility: hidden\");\n startBtn.setAttribute(\"style\", \"visibility: hidden\");\n}","hide() {\n if (\n $.getDataset(this._target, 'uiAnimating') ||\n !$.hasClass(this._target, 'active') ||\n !$.triggerOne(this._node, 'hide.ui.tab')\n ) {\n return;\n }\n\n this._hide();\n }","function hideAll() {\n\t\t// Hide counter\n\t\t$('.counter').animate({\n\t\t\ttop: \"-18em\"\n\t\t}, 600, \"swing\", function() {\n\t\t});\n\t\t\n\t\t// Hide highlight\n\t\t$('.highlight, .glow').addClass('highlight-hide');\n\t\tsetTimeout(function() {\n\t\t\t// Slide away main content\n\t\t\t$('.main').animate({\n\t\t\t\tmarginTop: \"150vh\"\n\t\t\t}, 1200, \"swing\", function() {\n\t\t\t\tlocation.reload();\n\t\t\t});\n\t\t}, 400);\n\t\t\n\t\t// Hide nav button and menu\n\t\t$('.collapse').collapse('hide');\n\t\t$('.navbar-toggle').animate({\n\t\t\tbottom: \"-100vh\"\n\t\t}, 800, \"swing\", function() {\n\t\t});\n\t}","_hideItems () {\n const firstFour = this.listItems.filter(notHidden => !notHidden.classList.contains(\"responsive-hidden\") && notHidden.querySelector(SELECTORS.SUB) === null && this._el.querySelector(\"UL\") === notHidden.parentElement);\n\n if (this.submenus.length > 0) {\n this.submenus.forEach(levelTwo => {\n levelTwo.parentElement.classList.add(\"responsive-hidden\");\n });\n\n if (firstFour.length > 4) {\n firstFour.slice(4).forEach(item => {\n item.parentElement.classList.add(\"responsive-hidden\");\n });\n }\n } else {\n this.listItems.slice(4).forEach(items => {\n items.classList.add(\"responsive-hidden\");\n });\n }\n }","function hideElements() {\n document.getElementById(\"pt1\").hidden = true;\n document.getElementById(\"pt2\").hidden = true;\n document.getElementById(\"intercept\").hidden = true;\n document.getElementById(\"slopeLabel\").hidden = true;\n document.getElementById(\"yIntLabel\").hidden = true;\n document.getElementById(\"pt1Label\").hidden = true;\n document.getElementById(\"pt2Label\").hidden = true;\n document.getElementById(\"riseRun1\").hidden = true;\n document.getElementById(\"riseRun2\").hidden = true;\n}","function hide() {\n $( \"#target\" ).hide();}","function hideSelectedHideables(hideables){\n for (let hideMe of hideables){\n if(document.getElementById(hideMe)){\n document.getElementById(hideMe).classList.add(\"displayNone\");\n }\n }\n }","hide() {\n if (this.div) {\n // The visibility property must be a string enclosed in quotes.\n this.div.style.visibility = \"hidden\";\n }\n }","function hide(el) {\n el = getList(el);\n\n for (var i = 0; i < el.length; i++) {\n el[i].style.display = 'none';\n }\n\n return el;\n }","hide() {\n this.visible = false;\n this.closed.emit();\n }","function hideItems() {\r\n piecesSlider.hidePieces({items: [currentImageIndex, currentTextIndex, currentNumberIndex]});\r\n }","function unHideComponents(){\r\n tank.style.visibility = \"visible\";\r\n missile.style.visibility = \"visible\";\r\n score.style.visibility = \"visible\";\r\n}","hide() {\n checkPresent(this.containerDiv, 'not present when hiding');\n // The visibility property must be a string enclosed in quotes.\n this.containerDiv.style.visibility = 'hidden';\n }","hide() {\n\t\tthis.isVisible = false;\n this.element.classList.remove('hide')\n\t\tthis.element.classList.remove('showCarousel')\n\t\tthis.element.classList.add('hideCarousel')\n\t\tthis.buttons.style.paddingTop = \"72px\"\n\t\t\n\t}"],"string":"[\n \"hide() {}\",\n \"function hideElements() {\\n $(\\\"#collapse_icon\\\").html(\\\"show\\\");\\n $(\\\".sidebar_elements\\\").addClass(\\\"hidden\\\").fadeTo(600, 0).css('dispaly', 'flex');\\n $(\\\"#cross\\\").removeClass(\\\"hidden\\\").fadeTo(600, 1).css('dispaly', 'flex');\\n}\",\n \"function hide() {\\n $.forEach(this.elements, function(element) {\\n element.style.display = 'none';\\n });\\n\\n return this;\\n }\",\n \"_hide() {\\n this.panelElem.addClass(\\\"hidden\\\");\\n }\",\n \"hide ()\\n\\t{\\n\\t\\t//hide the elements of the view\\n\\t\\tthis.root.style.display= 'none';\\n\\t}\",\n \"function xHide(e){return xVisibility(e,0);}\",\n \"_hideAll() {\\n this.views.directorySelection.hide();\\n this.views.training.hide();\\n this.views.messages.hide();\\n this.views.directorySelection.css('visibility', 'hidden');\\n this.views.training.css('visibility', 'hidden');\\n this.views.messages.css('visibility', 'hidden');\\n }\",\n \"hide() {\\n this.isVisible = false;\\n }\",\n \"function hideElements(){\\n\\t$(\\\".trivia\\\").toggle();\\n\\t$(\\\".navbar\\\").toggle();\\n\\t$(\\\".end\\\").toggle();\\n}\",\n \"function hideAll(){\\n $$('.contenido').each(function(item){\\n item.hide();\\n })\\n}\",\n \"hide() {\\n\\t\\tthis.style.display = \\\"none\\\";\\n\\t}\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm\\n ];\\n elementsArr.forEach(val => val.hide());\\n }\",\n \"onHide() {}\",\n \"onHide() {}\",\n \"function hide() {\\n that.isSelected = false;\\n // change class to default\\n that.row.className = 'maqaw-visitor-list-entry';\\n that.row.style.display = 'none';\\n // tell the VisitorList that we are going to hide this visitor so that it can deselect\\n // it if necessary\\n that.visitorList.hideVisitor(that);\\n // clear chat window\\n that.visitorList.chatManager.clear(that);\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm,\\n $sectionUserProfile\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"hide (element){\\n element.style.display = \\\"none\\\";\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"function collapseContainers( containers ){\\n containers.classed(\\\"hidden\\\", true);\\n }\",\n \"hide(){\\r\\n this.containerElement.style.display=\\\"none\\\";\\r\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm,\\n $favoritedArticles\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"function hideItems(){\\n $(\\\".bap-objective\\\").each(function(){\\n $(this).css({'display' : 'none'});\\n });\\n \\n $(\\\".bap-actions\\\").each(function(){\\n $(this).css({'display' : 'none'});\\n });\\n \\n return false;\\n}\",\n \"hideContent() {\\n this.content.attr('hidden', 'hidden');\\n }\",\n \"hide() {\\n ELEM.setStyle(this.elemId, 'visibility', 'hidden', true);\\n this.isHidden = true;\\n return this;\\n }\",\n \"hide () {\\n this.showing = false\\n this.element ? this.element.update(this) : null\\n }\",\n \"function unhide(x){\\n\\t\\tdocument.getElementById(x).style.display=\\\"inline-block\\\";\\n\\t}\",\n \"hide({ state }) {\\n state.visable = false;\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm,\\n // **** added favorite article, submit story, user profile hide\\n $submitStoryForm,\\n $favoriteArticles,\\n $userProfile,\\n // ****\\n ];\\n elementsArr.forEach(($elem) => $elem.hide());\\n }\",\n \"function hideAllContent() {\\n $(\\\"#overview\\\").hide();\\n $(\\\"#tips\\\").hide();\\n $(\\\"#sample1\\\").hide();\\n $(\\\"#sample2\\\").hide();\\n $(\\\"#sample3\\\").hide();\\n }\",\n \"setVisible() {\\n element.removeClass('hidden');\\n }\",\n \"setVisible() {\\n element.removeClass('hidden');\\n }\",\n \"function hideElement(e) {\\n e.style.display = \\\"none\\\";\\n }\",\n \"function hide(el) {\\n\\t\\tel.style.display = 'none';\\n\\t}\",\n \"function hide_all() {\\n $('#punctual-table-wrapper').collapse(\\\"hide\\\")\\n $(\\\"#meta-info\\\").hide()\\n $(\\\"#progress_bar\\\").hide()\\n $(\\\"#arrived-late\\\").hide()\\n $(\\\"#punctual\\\").hide()\\n $(\\\"#left-early\\\").hide()\\n $(\\\"#punctual-day-chart\\\").hide()\\n $(\\\"#breakdown p\\\").hide()\\n}\",\n \"hide(){\\n const listElements = this.el.childNodes;\\n for(let i = 0; i < listElements.length; i++){\\n listElements[i].removeEventListener('click',this.onItemClickedEvent);\\n }\\n this.el.innerHTML = '';\\n }\",\n \"function unhide(el) {\\n $(el).removeClass(\\\"hidden\\\");\\n }\",\n \"unhide() {\\n document.getElementById(\\\"guiArea\\\").classList.remove(\\\"hideMe\\\");\\n document.getElementById(\\\"guiAreaToggle\\\").classList.remove(\\\"hideMe\\\");\\n }\",\n \"_hide() {\\n $.setDataset(this._target, { uiAnimating: 'out' });\\n\\n $.fadeOut(this._target, {\\n duration: this._options.duration,\\n }).then((_) => {\\n $.removeClass(this._target, 'active');\\n $.removeClass(this._node, 'active');\\n $.removeDataset(this._target, 'uiAnimating');\\n $.setAttribute(this._node, { 'aria-selected': false });\\n $.triggerEvent(this._node, 'hidden.ui.tab');\\n }).catch((_) => {\\n if ($.getDataset(this._target, 'uiAnimating') === 'out') {\\n $.removeDataset(this._target, 'uiAnimating');\\n }\\n });\\n }\",\n \"function showElements() {\\n $(\\\"#collapse_icon\\\").html(\\\"hide\\\");\\n $(\\\".sidebar_elements\\\").removeClass(\\\"hidden\\\").fadeTo(600, 1);\\n $(\\\".range_options\\\").css('display', 'flex');\\n $(\\\"#cross\\\").addClass(\\\"hidden\\\").fadeTo(600, 0);\\n}\",\n \"function hide() {\\n\\t\\tdashboardContent.empty();\\n\\n\\t}\",\n \"hide() {\\n\\t\\tthis.panelEl.classList.remove(classes.panel.open);\\n\\t\\tthis.panelEl.classList.add(classes.panel.closed);\\n\\t}\",\n \"hide() {\\n if (this[$visible]) {\\n this[$visible] = false;\\n this[$updateVisibility]({ notify: true });\\n }\\n }\",\n \"onHide() {\\n\\t}\",\n \"function hide(event) { event.target.style.visibility = \\\"hidden\\\"; }\",\n \"function hide(el){\\r\\n el = getList(el);\\r\\n\\r\\n for(var i = 0; i $elem.addClass(\\\"hidden\\\"));\\n }\",\n \"hide_() {\\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\\n }\",\n \"function hideStartingInfo() {\\r\\n // Hides savings/checking info and transaction info.\\r\\n hideToggle(checking_info); \\r\\n hideToggle(savings_info); \\r\\n hideToggle(transactions); \\r\\n}\",\n \"function hide(el){\\n el = getList(el);\\n\\n for(var i = 0; iShow \\\" + legendText + \\\"\\\");\\r\\n showHide.wrap(\\\"
    \\\");\\r\\n showHide.before(show);\\r\\n showHide.hide();\\r\\n function showFunc(event)\\r\\n {\\r\\n target = jQ(event.target);\\r\\n target.hide();\\r\\n target.next().show();\\r\\n }\\r\\n function hideFunc(event)\\r\\n {\\r\\n target = jQ(event.target).parent();\\r\\n target.hide();\\r\\n target.prev().show();\\r\\n }\\r\\n show.click(showFunc);\\r\\n legend.click(hideFunc);\\r\\n }\\r\\n showHides = jQ(\\\"div.showHideToggle\\\");\\r\\n showHides.each(function() {\\r\\n var showHideDiv = jQ(this);\\r\\n var toggleText = showHideDiv.find(\\\"input[@name='toggleText']\\\").val();\\r\\n var contentDiv = showHideDiv.find(\\\">div\\\");\\r\\n var cmd = showHideDiv.find(\\\">span.command\\\");\\r\\n cmd.click(function(){ contentDiv.toggleClass(\\\"hidden\\\"); var t=cmd.html(); cmd.html(toggleText); toggleText=t; });\\r\\n });\\r\\n}\",\n \"hide() {\\n for (var dependent of this.get_dependents()) {\\n try { dependent.hide(); }\\n catch (e) {}\\n }\\n }\",\n \"function collapseHide() {\\n $( \\\".slide-collapse\\\" ).click(function() {\\n collapse($(this));\\n });\\n}\",\n \"function hideSelectorContainers(){\\n\\thideTypeSelector();\\n\\thidePlayerSelector();\\n\\thideYearSelector();\\n\\thideWeekSelector();\\n\\thideStatNameSelector();\\n\\thideTeamSelector();\\n}\",\n \"static hide(v) {\\n // Set style to none\\n UI.find(v).setAttribute(\\\"hidden\\\", \\\"true\\\");\\n }\",\n \"showContent() {\\n this.content.removeAttr('hidden');\\n }\",\n \"function hideTreeExpandCollapseButtons(hide) {\\n\\tif(hide) {\\n\\t\\t$('#tree-expand').hide();\\n\\t\\t$('#tree-collapse').hide();\\n\\t\\t$('#save-as-profile-btn').hide();\\n\\t}\\n\\telse {\\n\\t\\t$('#tree-expand').show();\\n\\t\\t$('#tree-collapse').show();\\n\\t\\t$('#save-as-profile-btn').show();\\n\\t}\\n\\t\\n}\",\n \"function invisible(item) {\\n item.css(\\\"visibility\\\", \\\"hidden\\\");\\n }\",\n \"function hideSlides(){\\n $('.caps').hide()\\n $('.headers').hide();\\n}\",\n \"static hide(obj) {\\n obj.setAttribute('visibility', 'hidden');\\n }\",\n \"function hideElement () {\\n if(this instanceof HTMLCollection || this instanceof NodeList) {\\n for(var i = 0; i < this.length; i++) {\\n this[i].style.display = 'none';\\n }\\n }\\n else if(this instanceof HTMLElement) {\\n this.style.display = 'none';\\n }\\n\\n return this;\\n }\",\n \"function hideElement() {\\n header.setAttribute(\\\"style\\\", \\\"visibility: hidden\\\");\\n text.setAttribute(\\\"style\\\", \\\"visibility: hidden\\\");\\n startBtn.setAttribute(\\\"style\\\", \\\"visibility: hidden\\\");\\n}\",\n \"hide() {\\n if (\\n $.getDataset(this._target, 'uiAnimating') ||\\n !$.hasClass(this._target, 'active') ||\\n !$.triggerOne(this._node, 'hide.ui.tab')\\n ) {\\n return;\\n }\\n\\n this._hide();\\n }\",\n \"function hideAll() {\\n\\t\\t// Hide counter\\n\\t\\t$('.counter').animate({\\n\\t\\t\\ttop: \\\"-18em\\\"\\n\\t\\t}, 600, \\\"swing\\\", function() {\\n\\t\\t});\\n\\t\\t\\n\\t\\t// Hide highlight\\n\\t\\t$('.highlight, .glow').addClass('highlight-hide');\\n\\t\\tsetTimeout(function() {\\n\\t\\t\\t// Slide away main content\\n\\t\\t\\t$('.main').animate({\\n\\t\\t\\t\\tmarginTop: \\\"150vh\\\"\\n\\t\\t\\t}, 1200, \\\"swing\\\", function() {\\n\\t\\t\\t\\tlocation.reload();\\n\\t\\t\\t});\\n\\t\\t}, 400);\\n\\t\\t\\n\\t\\t// Hide nav button and menu\\n\\t\\t$('.collapse').collapse('hide');\\n\\t\\t$('.navbar-toggle').animate({\\n\\t\\t\\tbottom: \\\"-100vh\\\"\\n\\t\\t}, 800, \\\"swing\\\", function() {\\n\\t\\t});\\n\\t}\",\n \"_hideItems () {\\n const firstFour = this.listItems.filter(notHidden => !notHidden.classList.contains(\\\"responsive-hidden\\\") && notHidden.querySelector(SELECTORS.SUB) === null && this._el.querySelector(\\\"UL\\\") === notHidden.parentElement);\\n\\n if (this.submenus.length > 0) {\\n this.submenus.forEach(levelTwo => {\\n levelTwo.parentElement.classList.add(\\\"responsive-hidden\\\");\\n });\\n\\n if (firstFour.length > 4) {\\n firstFour.slice(4).forEach(item => {\\n item.parentElement.classList.add(\\\"responsive-hidden\\\");\\n });\\n }\\n } else {\\n this.listItems.slice(4).forEach(items => {\\n items.classList.add(\\\"responsive-hidden\\\");\\n });\\n }\\n }\",\n \"function hideElements() {\\n document.getElementById(\\\"pt1\\\").hidden = true;\\n document.getElementById(\\\"pt2\\\").hidden = true;\\n document.getElementById(\\\"intercept\\\").hidden = true;\\n document.getElementById(\\\"slopeLabel\\\").hidden = true;\\n document.getElementById(\\\"yIntLabel\\\").hidden = true;\\n document.getElementById(\\\"pt1Label\\\").hidden = true;\\n document.getElementById(\\\"pt2Label\\\").hidden = true;\\n document.getElementById(\\\"riseRun1\\\").hidden = true;\\n document.getElementById(\\\"riseRun2\\\").hidden = true;\\n}\",\n \"function hide() {\\n $( \\\"#target\\\" ).hide();}\",\n \"function hideSelectedHideables(hideables){\\n for (let hideMe of hideables){\\n if(document.getElementById(hideMe)){\\n document.getElementById(hideMe).classList.add(\\\"displayNone\\\");\\n }\\n }\\n }\",\n \"hide() {\\n if (this.div) {\\n // The visibility property must be a string enclosed in quotes.\\n this.div.style.visibility = \\\"hidden\\\";\\n }\\n }\",\n \"function hide(el) {\\n el = getList(el);\\n\\n for (var i = 0; i < el.length; i++) {\\n el[i].style.display = 'none';\\n }\\n\\n return el;\\n }\",\n \"hide() {\\n this.visible = false;\\n this.closed.emit();\\n }\",\n \"function hideItems() {\\r\\n piecesSlider.hidePieces({items: [currentImageIndex, currentTextIndex, currentNumberIndex]});\\r\\n }\",\n \"function unHideComponents(){\\r\\n tank.style.visibility = \\\"visible\\\";\\r\\n missile.style.visibility = \\\"visible\\\";\\r\\n score.style.visibility = \\\"visible\\\";\\r\\n}\",\n \"hide() {\\n checkPresent(this.containerDiv, 'not present when hiding');\\n // The visibility property must be a string enclosed in quotes.\\n this.containerDiv.style.visibility = 'hidden';\\n }\",\n \"hide() {\\n\\t\\tthis.isVisible = false;\\n this.element.classList.remove('hide')\\n\\t\\tthis.element.classList.remove('showCarousel')\\n\\t\\tthis.element.classList.add('hideCarousel')\\n\\t\\tthis.buttons.style.paddingTop = \\\"72px\\\"\\n\\t\\t\\n\\t}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7696056","0.7422398","0.7333384","0.7272602","0.7221115","0.72023773","0.7200048","0.7130635","0.7071157","0.7068182","0.70546514","0.7046007","0.69858533","0.69858533","0.69854015","0.69841826","0.6978578","0.6970021","0.6970021","0.6947223","0.6942153","0.692611","0.6895606","0.6893231","0.6889195","0.68792444","0.68756956","0.68439895","0.6832524","0.68209696","0.6814604","0.6814604","0.6807444","0.6802476","0.67963713","0.6790067","0.6772159","0.67690897","0.67583334","0.6749301","0.673435","0.67303985","0.67272764","0.6724263","0.672103","0.67143965","0.67143965","0.6712388","0.6706834","0.6702502","0.6681244","0.6681244","0.6681244","0.66799504","0.6673951","0.66724277","0.66656995","0.66623","0.6660685","0.66588485","0.6658655","0.6657188","0.6656102","0.6650987","0.6650449","0.6645278","0.6643279","0.66353595","0.66343594","0.6633934","0.6632975","0.66321003","0.663001","0.66252065","0.6625052","0.66156673","0.6615058","0.66124934","0.660639","0.6601757","0.65988356","0.658861","0.65745556","0.65744066","0.65642047","0.65632606","0.6560708","0.65578705","0.65535265","0.65499836","0.654783","0.65435266","0.65409064","0.65400064","0.65394217","0.6534932","0.6531314","0.6530837","0.65261877","0.65238833","0.6522114"],"string":"[\n \"0.7696056\",\n \"0.7422398\",\n \"0.7333384\",\n \"0.7272602\",\n \"0.7221115\",\n \"0.72023773\",\n \"0.7200048\",\n \"0.7130635\",\n \"0.7071157\",\n \"0.7068182\",\n \"0.70546514\",\n \"0.7046007\",\n \"0.69858533\",\n \"0.69858533\",\n \"0.69854015\",\n \"0.69841826\",\n \"0.6978578\",\n \"0.6970021\",\n \"0.6970021\",\n \"0.6947223\",\n \"0.6942153\",\n \"0.692611\",\n \"0.6895606\",\n \"0.6893231\",\n \"0.6889195\",\n \"0.68792444\",\n \"0.68756956\",\n \"0.68439895\",\n \"0.6832524\",\n \"0.68209696\",\n \"0.6814604\",\n \"0.6814604\",\n \"0.6807444\",\n \"0.6802476\",\n \"0.67963713\",\n \"0.6790067\",\n \"0.6772159\",\n \"0.67690897\",\n \"0.67583334\",\n \"0.6749301\",\n \"0.673435\",\n \"0.67303985\",\n \"0.67272764\",\n \"0.6724263\",\n \"0.672103\",\n \"0.67143965\",\n \"0.67143965\",\n \"0.6712388\",\n \"0.6706834\",\n \"0.6702502\",\n \"0.6681244\",\n \"0.6681244\",\n \"0.6681244\",\n \"0.66799504\",\n \"0.6673951\",\n \"0.66724277\",\n \"0.66656995\",\n \"0.66623\",\n \"0.6660685\",\n \"0.66588485\",\n \"0.6658655\",\n \"0.6657188\",\n \"0.6656102\",\n \"0.6650987\",\n \"0.6650449\",\n \"0.6645278\",\n \"0.6643279\",\n \"0.66353595\",\n \"0.66343594\",\n \"0.6633934\",\n \"0.6632975\",\n \"0.66321003\",\n \"0.663001\",\n \"0.66252065\",\n \"0.6625052\",\n \"0.66156673\",\n \"0.6615058\",\n \"0.66124934\",\n \"0.660639\",\n \"0.6601757\",\n \"0.65988356\",\n \"0.658861\",\n \"0.65745556\",\n \"0.65744066\",\n \"0.65642047\",\n \"0.65632606\",\n \"0.6560708\",\n \"0.65578705\",\n \"0.65535265\",\n \"0.65499836\",\n \"0.654783\",\n \"0.65435266\",\n \"0.65409064\",\n \"0.65400064\",\n \"0.65394217\",\n \"0.6534932\",\n \"0.6531314\",\n \"0.6530837\",\n \"0.65261877\",\n \"0.65238833\",\n \"0.6522114\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":42,"cells":{"query":{"kind":"string","value":"output message to DOM"},"document":{"kind":"string","value":"function outputMessage(msg) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${msg.username}•${msg.time}

    \n

    \n ${msg.text}\n

    `;\n const chatSection = document.getElementById('chat-message');\n chatSection.appendChild(div);\n // console.log(div);\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 outputMesssage(message) {\n const div = document.createElement('div');\n div.innerHTML = `${message}`;\n document.querySelector('.messages').appendChild(div);\n}","function output(message) {\n const para = document.createElement('p');\n para.innerHTML = message;\n outputDiv.appendChild(para);\n}","function print(message) {\n\t var outputDiv = document.getElementById(\"output\").innerHTML = message;\n\t}","function message(msg){\n\tdocument.getElementById('output').innerHTML = msg + \" event\"\n}","function outputMessage(message) {\n //Creates div\n const div = document.createElement(\"div\");\n // adds div to classList\n div.classList.add(\"message\");\n //Formatting message\n div.innerHTML =\n `
    \n ${message.username} today at: ${message.time}\n
    \n ${message.text}\n
    \n
    `\n document.getElementById(\"c-messages\").appendChild(div)\n}","logOutput (msg) {\n this.DOMNodes.runMessage.className = \"hidden\";\n let node = document.createElement(\"div\");\n node.innerHTML = msg;\n this.DOMNodes.log.appendChild(node);\n }","function message(msg){\n document.getElementById('message').innerHTML = msg;\n }","function outputMessage(message) {\r\n //Manipulaciond el DOM\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\"message\");\r\n div.innerHTML = `

    ${message.username}${message.time}

    \r\n

    \r\n ${message.text}\r\n

    `;\r\n document.querySelector(\".chat-messages\").appendChild(div);\r\n}","function print(message) {\n\t var outputDiv = document.getElementById('output');\n\t outputDiv.innerHTML = message;\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('messages');\n div.innerHTML= `

    \n ${message} \n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function writeMessage(message) {\r\n\tvar li = document.createElement(\"li\");\r\n\r\n\tsetElementText(li, message);\r\n\r\n\r\n output.appendChild(li);\r\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message'); // message comes from
    in chat.html\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `\n document.querySelector('.chat-messages').appendChild(div) // should add a new div to the chat.html when we csubmit a new message\n}","function _print(message) {\n if (_output) {\n _output.innerHTML += message + \"
    \";\n }\n }","function writeMessage(message) {\n var li = document.createElement(\"li\");\n\n setElementText(li, message);\n output.appendChild(li);\n}","function outputMessage(msg) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \n

    ${msg.text}

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n\nconst div=document.createElement('div');\ndiv.classList.add('message');\ndiv.innerHTML=`

    ${message.username}${message.time}

    \n

    \n${message.text}\n\n

    `\n\ndocument.querySelector('.chat-messages').appendChild(div)\n}","function print(message) {\n var outputDiv = document.getElementById('quiz-output'); // node\n outputDiv.innerHTML = message; // similar to document.write\n $( '#quiz-output' ).removeClass( 'hidden' );\n // $( '#output' ).toggleClass( \"hidden\", addOrRemove );\n }","function outputMessage(msg) {\n const div = document.createElement('div');\n\n div.classList.add('message');\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \n

    ${msg.text}

    `;\n chatMessages.appendChild(div);\n}","function writeToPage(msg) {\n results.innerHTML = msg;\n}","function output(message) {\n document.getElementById(\"output\").innerHTML += message + \"
    \";\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}\n
    \n ${message.text}\n

    `;\n\n document.querySelector('.chat-messages').appendChild(div);\n\n}","function outputMessage(message) {\n\tconst div = document.createElement(\"div\");\n\tdiv.classList.add(\"message\");\n\tdiv.innerHTML = `

    ${message.username} ${message.time}\n\t

    ${message.text}

    `;\n\tdocument.querySelector(\".chat-messages\").appendChild(div);\n}","function userMessage(message) {\n output(message);\n try {\n document.getElementById('user_message').innerText = message;\n }\n catch (error) {}\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(msg) {\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \n

    ${msg.text}

    `;\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `; \n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild (div);\n\n}","function outputMessage(message){\n const div= document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n //here we select the chat-messages\n document.querySelector('.chat-messages').appendChild(div); // 9\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.message}\n

    `;\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username}${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.divscroll').appendChild(div);\n }","function print(message) {\r\n var outputDiv = document.getElementById(\"output\");\r\n outputDiv.innerHTML = message;\r\n}","function print(message){\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function print(message) {\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function printToPage(msg) {\n\t\tif(document.getElementById(\"message\") != null){\n\t\t\tdocument.getElementById(\"message\").innerHTML = msg;\n\t\t}\n\t\telse{\n\t\tvar message = \"

    \" + msg + \"<\\p>\";\n\t\t$(\"#result\").append(message);\n\t\t}\n\t}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    ${message.text}

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function print(message) {\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function print(message) {\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n div.innerHTML = `
    \n
    \"sunil\"\n
    \n
    \n
    \n

    ${message.text}

    \n \n ${message.username} at ${message.time}\n
    \n
    \n
    \n `;\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = '

    '+ message.username + '' + message.time +''+\n '

    ' + message.text + '

    '\n document.querySelector(\".chat-messages\").appendChild(div)\n}","function writeMsg(msg){\n msgEl.innerHTML = `\n
    You Said:
    \n ${msg}\n `\n}","setMessage(msg) \n {\n document.getElementById('message').innerHTML = msg;\n }","function outputMessage(payload) {\n const div = document.createElement('div');\n const p = document.createElement('p');\n p.innerText = payload.text;\n let time = moment(payload.unixTime).format('MMMM Do YYYY, h:mm a');\n p.innerHTML += ` ${time}`;\n div.appendChild(p);\n chatForm.appendChild(div);\n}","function printhtml(dom,msg)\r\n{\r\n\t$(dom).html(msg);\r\n\t$(dom).removeClass('hide');\r\n}","function tell(msg) {\n $(\".output\").val(msg);\n }","function outputMessage(message) {\r\n const div = document.createElement('div');\r\n div.classList.add('message');\r\n\r\n const p = document.createElement('p');\r\n p.classList.add('meta');\r\n p.innerText = message.username;\r\n if(message.username == 'server'){\r\n p.innerText += ' | ';\r\n p.style.color = 'red';\r\n }else{\r\n p.innerText += ' @ ';\r\n }\r\n p.innerHTML += `${message.time}`;\r\n div.appendChild(p);\r\n\r\n const para = document.createElement('p');\r\n para.classList.add('text');\r\n para.innerText = message.text;\r\n if(message.username == 'server'){\r\n para.style.color = 'red';\r\n para.style.fontFamily = 'Courier New';\r\n }\r\n div.appendChild(para);\r\n\r\n document.querySelector('.chat-messages').appendChild(div);\r\n}","function render_msg(msg) {\r\n ///This function gets a msg in the form\r\n /// author:\r\n /// msg:\r\n // var divEl = xo.getDom('');\r\n // var el = xo.DomHelper.createDom({\r\n // \"tag\": \"div\",\r\n // \"class\": \"message\",\r\n // \"html\": \"User \" + msg.author + \": \" + msg.data\r\n // }, divEl);\r\n // \r\n }","function tell(msg) {\n $(\".output\").val(msg);\n }","function display(message){\n\tdataElement.innerHTML = dataElement.innerHTML+'
    '+message;\n}","function print ( message ) {\r\n viewDiv.innerHTML = message;\r\n}","function outputMessage(message){\n //each emssage has a div\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = '

    '+\n message.username + ' '+\n message.time +'

    '+\n message.text +\n '

    ';\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n const p = document.createElement(\"p\");\n p.classList.add(\"meta\");\n p.innerText = `${message.playername} `;\n p.innerHTML += `${message.time}`;\n div.appendChild(p);\n const para = document.createElement(\"p\");\n para.classList.add(\"text\");\n para.innerText = message.text;\n div.appendChild(para);\n chatMessages.appendChild(div);\n}","function postMessage(message) {\n const newMessage = document.createElement('p');\n newMessage.textContent = message;\n\n messageOutput.appendChild(newMessage);\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n message.username === \"You\"\n ? div.setAttribute(\"class\", \"ui positive message\")\n : div.setAttribute(\"class\", \"ui info message\");\n const p = document.createElement(\"p\");\n message.username === \"You\"\n ? p.setAttribute(\"class\", \"ui red horizontal label\")\n : p.setAttribute(\"class\", \"ui blue horizontal label\");\n p.innerText = message.username;\n p.innerHTML += ` at ${message.time}`;\n div.appendChild(p);\n const para = document.createElement(\"p\");\n para.classList.add(\"text\");\n para.innerHTML = message.content;\n div.appendChild(para);\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function _addOutput(msg) {\r\n var output = document.getElementById('outputArea');\r\n output.value += msg + \"\\n\";\r\n\r\n // Move cursor to the end of the output area.\r\n output.scrollTop = output.scrollHeight;\r\n }","function renderMessage(text) {\n document.getElementById('res').innerHTML = text;\n}","function showHtmlMsg() {\r\n msg.innerText = ''\r\n disableButton()\r\n message.style.display = 'none'\r\n innerMsg.style.display = 'block'\r\n // var htmlmsg = document.createElement('p')\r\n msg.innerText = \"HTML stands for Hyper Text Markup Language. HTML describes the structure of a Web page.\"\r\n innerMsg.appendChild(msg)\r\n innerMsg.appendChild(hr)\r\n}","function displayMessage(message) {\n document.querySelector('.message').textContent = message;\n}","function outputMessage(message) {\n\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = \n `\n
    \n
    \n \n
    \n
    \n
    \n ${message.username} - ${message.text}\n ${message.time}\n
    \n
    \n
    \n `;\n\n document.querySelector('.chat-messages').appendChild(div);\n\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n const p = document.createElement('p');\n p.classList.add('meta');\n p.innerText = message.username;\n p.innerHTML += `${message.time}`;\n div.appendChild(p);\n const para = document.createElement('p');\n para.classList.add('text');\n para.innerText = message.text;\n div.appendChild(para);\n document.querySelector('.chat-messages').appendChild(div);\n}","function Message(msg){\r\n const mes_ele = document.createElement('div');\r\n mes_ele.innerText = msg;\r\n mes.append(mes_ele);\r\n }","function outputMessage(message) {\n const div = document.createElement('div')\n div.classList.add('alert','alert-dark','my-2','ml-2','mr-5')\n div.innerHTML = `
    \n
    ${message.username} at ${message.time}
    \n
    \n

    ${message.text}

    `\n\n document.getElementById('chat-messages').appendChild(div);\n}","function message(message){\n let results = document.querySelector(\".results\");\n let p = document.createElement(\"p\");\n p.innerHTML = message;\n results.innerHTML = \"\";\n results.appendChild(p);\n }","function writeP2(message_2) {\r\n document.getElementById('message_2').innerHTML += message_2 + '
    ';\r\n}","function appendOutputDiv(message) {\n var pre = document.getElementById('output');\n var textContent = document.createTextNode(message + '\\n');\n if(DEBUG) {\n pre.appendChild(textContent);\n } else {\n pre.textContent = message + \"\\n\";\n }\n}","function outputMessage(message) {\n const li = document.createElement('li');\n li.textContent = message;\n li.classList.add('message');\n document.getElementById('chat-field').appendChild(li);\n}","function display(message) {\n document.querySelector('.message').textContent = message;\n}","function writeMsg(txt) {\n document.getElementById('gameMsg').innerHTML = txt;\n showGameMsg();\n}","function output(message) {\n browser.runtime.sendMessage({ action: 'output', message });\n}","function ilm_display(msg) {\r\n\tdocument.querySelector('#ilm_container .ilm_msg').textContent = msg;\r\n}","function displayMessage() {\n mainEl.textContent = message;\n}","function outputOwnMessage(message) {\n const div = document.createElement('div')\n div.classList.add('alert','alert-success','my-2','mr-2','ml-5')\n div.innerHTML = `
    \n
    ${message.username} at ${message.time}
    \n
    \n

    ${message.text}

    `\n\n document.getElementById('chat-messages').appendChild(div);\n}","function print(out){\n msg = document.createElement(\"p\");\n msg.textContent = out.toString();\n output.appendChild(msg);\n}","renderMessage_() {\n const messsageEl = create(\"div\", {\n classname: cssClass.MESSAGE_WRAPPER,\n copy: copy.NO_SUBSCRIPTIONS,\n });\n\n this.appendChild(messsageEl);\n }","function displayOutputMessage(text) {\n const outputElem = goog.dom.getElement('output');\n outputElem.innerHTML = outputElem.innerHTML + text + '\\n';\n}","function setMessage(msg) {\n\n\tdocument.getElementById(\"message\").innerHTML = msg;\n}","function ShowMessage(msg) {\n\tdocument.getElementById(\"message\").innerHTML += \"

    \"+msg+\"

    \";\n}","function setMessage (msg){\n document.getElementById(\"message\").innerHTML=msg;\n}","function displayMessage(type,message)\n{\n messageEL.text(message);\n messageEL.attr(\"class\",type);\n\n}","function outputStatus(message) {\n const div = document.createElement('div')\n div.classList.add('message')\n div.innerHTML = `
  • \n

    ${message.text}

    \n

    ${message.time}

    \n
  • `\n document.querySelector('.chat-messages').appendChild(div)\n}","function addOutput(msg) {\n var output = document.getElementById('script_output');\n output.value += msg + \"\\n\";\n\n // Move cursor to the end of the output area.\n output.scrollTop = output.scrollHeight;\n }","function setMessage(msg) {\n\t\tdocument.getElementById(\"message\").innerText = msg;\n\t}","function OutputLine(msg) {\n $(\"output\").value += msg + \"\\n\";\n}","function outputMessage(message,position) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.classList.add(position);\n const p = document.createElement('p');\n p.classList.add('time');\n p.innerText = message.time;\n div.appendChild(p);\n \n const para = document.createElement('p');\n para.classList.add('text');\n if(message.username == 'ChatWid')\n para.innerHTML = `${message.text}`;\n else\n para.innerHTML = `${message.username}: ${message.text}`;\n div.appendChild(para);\n\n document.querySelector('.chat_messages').appendChild(div);\n}","function displayMessage(message){\n document.getElementById('ui').innerHTML = message;\n}","displayMessage(message) {\n this.messageContainerEl.innerHTML = `
    ${message}
    `;\n this.messageContainerEl.classList.add('visible');\n }","function setMessage(msg){\n document.getElementById(\"message\").innerHTML = msg;\n}","function setMessage(str) {\n\tdocument.getElementById(\"Messages\").innerHTML = \"

    \" + str + \"

    \";\n}","function output(message) {\n var consoleMessage = \"
    \" + Date.now() + \" \" + message + \"
    \";\n var element = $(consoleMessage);\n addToArrayStorage('wellData', consoleMessage)\n $('#console').append(element);\n }","function printClientInput(msg){\r\n\r\nvar messagelogtxt = document.getElementById('messagelog');\r\n\r\nmessagelogtxt.innerHTML += 'Client : ' + msg + '\\n';\r\nconsole.log(msg);\r\n}","printMessage(input, msg) {\n //Quantidade de erros\n let errorsQty = input.parentNode.querySelector('.error-validation')\n if(errorsQty === null) {\n let template = document.querySelector('.error-validation').cloneNode(true)\n template.textContent = msg\n let inputParent = input.parentNode\n template.classList.remove('template')\n inputParent.appendChild(template)\n }\n }","function t_print(message) {\r\n t_printRaw(\"
    \" + message + \"
    \");\r\n}","function print(infoMessage, asHtml) {\n var $msg = $('
    ');\n if (asHtml) {\n $msg.html(infoMessage);\n } else {\n $msg.text(infoMessage);\n }\n $chatWindow.append($msg);\n }","function print(infoMessage, asHtml) {\n var $msg = $('
    ');\n if (asHtml) {\n\n $msg.html(infoMessage);\n\n } else {\n\n $msg.text(infoMessage);\n\n }\n $chatWindow.append($msg);\n }","function setMessage(msg) {\n document.getElementById(\"message\").innerText = msg;\n}","function outputMessage(message) {\n const div = document.createElement('div')\n div.classList.add('message')\n if (message.username === username) {\n div.innerHTML = `
  • \n ${message.username}\n

    ${message.text} ${message.time}

    \n
  • `\n document.querySelector('.chat-messages').appendChild(div)\n } else {\n div.innerHTML = `
  • \n ${message.username}\n

    ${message.text} ${message.time}

    \n
  • `\n document.querySelector('.chat-messages').appendChild(div)\n }\n}","function print(infoMessage, asHtml) {\n var $msg = $('
    ');\n if (asHtml) {\n $msg.html(infoMessage);\n } else {\n $msg.text(infoMessage);\n }\n $chatWindow.append($msg);\n\n }"],"string":"[\n \"function outputMesssage(message) {\\n const div = document.createElement('div');\\n div.innerHTML = `${message}`;\\n document.querySelector('.messages').appendChild(div);\\n}\",\n \"function output(message) {\\n const para = document.createElement('p');\\n para.innerHTML = message;\\n outputDiv.appendChild(para);\\n}\",\n \"function print(message) {\\n\\t var outputDiv = document.getElementById(\\\"output\\\").innerHTML = message;\\n\\t}\",\n \"function message(msg){\\n\\tdocument.getElementById('output').innerHTML = msg + \\\" event\\\"\\n}\",\n \"function outputMessage(message) {\\n //Creates div\\n const div = document.createElement(\\\"div\\\");\\n // adds div to classList\\n div.classList.add(\\\"message\\\");\\n //Formatting message\\n div.innerHTML =\\n `
    \\n ${message.username} today at: ${message.time}\\n
    \\n ${message.text}\\n
    \\n
    `\\n document.getElementById(\\\"c-messages\\\").appendChild(div)\\n}\",\n \"logOutput (msg) {\\n this.DOMNodes.runMessage.className = \\\"hidden\\\";\\n let node = document.createElement(\\\"div\\\");\\n node.innerHTML = msg;\\n this.DOMNodes.log.appendChild(node);\\n }\",\n \"function message(msg){\\n document.getElementById('message').innerHTML = msg;\\n }\",\n \"function outputMessage(message) {\\r\\n //Manipulaciond el DOM\\r\\n const div = document.createElement(\\\"div\\\");\\r\\n div.classList.add(\\\"message\\\");\\r\\n div.innerHTML = `

    ${message.username}${message.time}

    \\r\\n

    \\r\\n ${message.text}\\r\\n

    `;\\r\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\r\\n}\",\n \"function print(message) {\\n\\t var outputDiv = document.getElementById('output');\\n\\t outputDiv.innerHTML = message;\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('messages');\\n div.innerHTML= `

    \\n ${message} \\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function writeMessage(message) {\\r\\n\\tvar li = document.createElement(\\\"li\\\");\\r\\n\\r\\n\\tsetElementText(li, message);\\r\\n\\r\\n\\r\\n output.appendChild(li);\\r\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message'); // message comes from
    in chat.html\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `\\n document.querySelector('.chat-messages').appendChild(div) // should add a new div to the chat.html when we csubmit a new message\\n}\",\n \"function _print(message) {\\n if (_output) {\\n _output.innerHTML += message + \\\"
    \\\";\\n }\\n }\",\n \"function writeMessage(message) {\\n var li = document.createElement(\\\"li\\\");\\n\\n setElementText(li, message);\\n output.appendChild(li);\\n}\",\n \"function outputMessage(msg) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \\n

    ${msg.text}

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n\\nconst div=document.createElement('div');\\ndiv.classList.add('message');\\ndiv.innerHTML=`

    ${message.username}${message.time}

    \\n

    \\n${message.text}\\n\\n

    `\\n\\ndocument.querySelector('.chat-messages').appendChild(div)\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('quiz-output'); // node\\n outputDiv.innerHTML = message; // similar to document.write\\n $( '#quiz-output' ).removeClass( 'hidden' );\\n // $( '#output' ).toggleClass( \\\"hidden\\\", addOrRemove );\\n }\",\n \"function outputMessage(msg) {\\n const div = document.createElement('div');\\n\\n div.classList.add('message');\\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \\n

    ${msg.text}

    `;\\n chatMessages.appendChild(div);\\n}\",\n \"function writeToPage(msg) {\\n results.innerHTML = msg;\\n}\",\n \"function output(message) {\\n document.getElementById(\\\"output\\\").innerHTML += message + \\\"
    \\\";\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}\\n
    \\n ${message.text}\\n

    `;\\n\\n document.querySelector('.chat-messages').appendChild(div);\\n\\n}\",\n \"function outputMessage(message) {\\n\\tconst div = document.createElement(\\\"div\\\");\\n\\tdiv.classList.add(\\\"message\\\");\\n\\tdiv.innerHTML = `

    ${message.username} ${message.time}\\n\\t

    ${message.text}

    `;\\n\\tdocument.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function userMessage(message) {\\n output(message);\\n try {\\n document.getElementById('user_message').innerText = message;\\n }\\n catch (error) {}\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(msg) {\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \\n

    ${msg.text}

    `;\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `; \\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild (div);\\n\\n}\",\n \"function outputMessage(message){\\n const div= document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n //here we select the chat-messages\\n document.querySelector('.chat-messages').appendChild(div); // 9\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.message}\\n

    `;\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username}${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.divscroll').appendChild(div);\\n }\",\n \"function print(message) {\\r\\n var outputDiv = document.getElementById(\\\"output\\\");\\r\\n outputDiv.innerHTML = message;\\r\\n}\",\n \"function print(message){\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function printToPage(msg) {\\n\\t\\tif(document.getElementById(\\\"message\\\") != null){\\n\\t\\t\\tdocument.getElementById(\\\"message\\\").innerHTML = msg;\\n\\t\\t}\\n\\t\\telse{\\n\\t\\tvar message = \\\"

    \\\" + msg + \\\"<\\\\p>\\\";\\n\\t\\t$(\\\"#result\\\").append(message);\\n\\t\\t}\\n\\t}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    ${message.text}

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n div.innerHTML = `
    \\n
    \\\"sunil\\\"\\n
    \\n
    \\n
    \\n

    ${message.text}

    \\n \\n ${message.username} at ${message.time}\\n
    \\n
    \\n
    \\n `;\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = '

    '+ message.username + '' + message.time +''+\\n '

    ' + message.text + '

    '\\n document.querySelector(\\\".chat-messages\\\").appendChild(div)\\n}\",\n \"function writeMsg(msg){\\n msgEl.innerHTML = `\\n
    You Said:
    \\n ${msg}\\n `\\n}\",\n \"setMessage(msg) \\n {\\n document.getElementById('message').innerHTML = msg;\\n }\",\n \"function outputMessage(payload) {\\n const div = document.createElement('div');\\n const p = document.createElement('p');\\n p.innerText = payload.text;\\n let time = moment(payload.unixTime).format('MMMM Do YYYY, h:mm a');\\n p.innerHTML += ` ${time}`;\\n div.appendChild(p);\\n chatForm.appendChild(div);\\n}\",\n \"function printhtml(dom,msg)\\r\\n{\\r\\n\\t$(dom).html(msg);\\r\\n\\t$(dom).removeClass('hide');\\r\\n}\",\n \"function tell(msg) {\\n $(\\\".output\\\").val(msg);\\n }\",\n \"function outputMessage(message) {\\r\\n const div = document.createElement('div');\\r\\n div.classList.add('message');\\r\\n\\r\\n const p = document.createElement('p');\\r\\n p.classList.add('meta');\\r\\n p.innerText = message.username;\\r\\n if(message.username == 'server'){\\r\\n p.innerText += ' | ';\\r\\n p.style.color = 'red';\\r\\n }else{\\r\\n p.innerText += ' @ ';\\r\\n }\\r\\n p.innerHTML += `${message.time}`;\\r\\n div.appendChild(p);\\r\\n\\r\\n const para = document.createElement('p');\\r\\n para.classList.add('text');\\r\\n para.innerText = message.text;\\r\\n if(message.username == 'server'){\\r\\n para.style.color = 'red';\\r\\n para.style.fontFamily = 'Courier New';\\r\\n }\\r\\n div.appendChild(para);\\r\\n\\r\\n document.querySelector('.chat-messages').appendChild(div);\\r\\n}\",\n \"function render_msg(msg) {\\r\\n ///This function gets a msg in the form\\r\\n /// author:\\r\\n /// msg:\\r\\n // var divEl = xo.getDom('');\\r\\n // var el = xo.DomHelper.createDom({\\r\\n // \\\"tag\\\": \\\"div\\\",\\r\\n // \\\"class\\\": \\\"message\\\",\\r\\n // \\\"html\\\": \\\"User \\\" + msg.author + \\\": \\\" + msg.data\\r\\n // }, divEl);\\r\\n // \\r\\n }\",\n \"function tell(msg) {\\n $(\\\".output\\\").val(msg);\\n }\",\n \"function display(message){\\n\\tdataElement.innerHTML = dataElement.innerHTML+'
    '+message;\\n}\",\n \"function print ( message ) {\\r\\n viewDiv.innerHTML = message;\\r\\n}\",\n \"function outputMessage(message){\\n //each emssage has a div\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = '

    '+\\n message.username + ' '+\\n message.time +'

    '+\\n message.text +\\n '

    ';\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n const p = document.createElement(\\\"p\\\");\\n p.classList.add(\\\"meta\\\");\\n p.innerText = `${message.playername} `;\\n p.innerHTML += `${message.time}`;\\n div.appendChild(p);\\n const para = document.createElement(\\\"p\\\");\\n para.classList.add(\\\"text\\\");\\n para.innerText = message.text;\\n div.appendChild(para);\\n chatMessages.appendChild(div);\\n}\",\n \"function postMessage(message) {\\n const newMessage = document.createElement('p');\\n newMessage.textContent = message;\\n\\n messageOutput.appendChild(newMessage);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n message.username === \\\"You\\\"\\n ? div.setAttribute(\\\"class\\\", \\\"ui positive message\\\")\\n : div.setAttribute(\\\"class\\\", \\\"ui info message\\\");\\n const p = document.createElement(\\\"p\\\");\\n message.username === \\\"You\\\"\\n ? p.setAttribute(\\\"class\\\", \\\"ui red horizontal label\\\")\\n : p.setAttribute(\\\"class\\\", \\\"ui blue horizontal label\\\");\\n p.innerText = message.username;\\n p.innerHTML += ` at ${message.time}`;\\n div.appendChild(p);\\n const para = document.createElement(\\\"p\\\");\\n para.classList.add(\\\"text\\\");\\n para.innerHTML = message.content;\\n div.appendChild(para);\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function _addOutput(msg) {\\r\\n var output = document.getElementById('outputArea');\\r\\n output.value += msg + \\\"\\\\n\\\";\\r\\n\\r\\n // Move cursor to the end of the output area.\\r\\n output.scrollTop = output.scrollHeight;\\r\\n }\",\n \"function renderMessage(text) {\\n document.getElementById('res').innerHTML = text;\\n}\",\n \"function showHtmlMsg() {\\r\\n msg.innerText = ''\\r\\n disableButton()\\r\\n message.style.display = 'none'\\r\\n innerMsg.style.display = 'block'\\r\\n // var htmlmsg = document.createElement('p')\\r\\n msg.innerText = \\\"HTML stands for Hyper Text Markup Language. HTML describes the structure of a Web page.\\\"\\r\\n innerMsg.appendChild(msg)\\r\\n innerMsg.appendChild(hr)\\r\\n}\",\n \"function displayMessage(message) {\\n document.querySelector('.message').textContent = message;\\n}\",\n \"function outputMessage(message) {\\n\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = \\n `\\n
    \\n
    \\n \\n
    \\n
    \\n
    \\n ${message.username} - ${message.text}\\n ${message.time}\\n
    \\n
    \\n
    \\n `;\\n\\n document.querySelector('.chat-messages').appendChild(div);\\n\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n const p = document.createElement('p');\\n p.classList.add('meta');\\n p.innerText = message.username;\\n p.innerHTML += `${message.time}`;\\n div.appendChild(p);\\n const para = document.createElement('p');\\n para.classList.add('text');\\n para.innerText = message.text;\\n div.appendChild(para);\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function Message(msg){\\r\\n const mes_ele = document.createElement('div');\\r\\n mes_ele.innerText = msg;\\r\\n mes.append(mes_ele);\\r\\n }\",\n \"function outputMessage(message) {\\n const div = document.createElement('div')\\n div.classList.add('alert','alert-dark','my-2','ml-2','mr-5')\\n div.innerHTML = `
    \\n
    ${message.username} at ${message.time}
    \\n
    \\n

    ${message.text}

    `\\n\\n document.getElementById('chat-messages').appendChild(div);\\n}\",\n \"function message(message){\\n let results = document.querySelector(\\\".results\\\");\\n let p = document.createElement(\\\"p\\\");\\n p.innerHTML = message;\\n results.innerHTML = \\\"\\\";\\n results.appendChild(p);\\n }\",\n \"function writeP2(message_2) {\\r\\n document.getElementById('message_2').innerHTML += message_2 + '
    ';\\r\\n}\",\n \"function appendOutputDiv(message) {\\n var pre = document.getElementById('output');\\n var textContent = document.createTextNode(message + '\\\\n');\\n if(DEBUG) {\\n pre.appendChild(textContent);\\n } else {\\n pre.textContent = message + \\\"\\\\n\\\";\\n }\\n}\",\n \"function outputMessage(message) {\\n const li = document.createElement('li');\\n li.textContent = message;\\n li.classList.add('message');\\n document.getElementById('chat-field').appendChild(li);\\n}\",\n \"function display(message) {\\n document.querySelector('.message').textContent = message;\\n}\",\n \"function writeMsg(txt) {\\n document.getElementById('gameMsg').innerHTML = txt;\\n showGameMsg();\\n}\",\n \"function output(message) {\\n browser.runtime.sendMessage({ action: 'output', message });\\n}\",\n \"function ilm_display(msg) {\\r\\n\\tdocument.querySelector('#ilm_container .ilm_msg').textContent = msg;\\r\\n}\",\n \"function displayMessage() {\\n mainEl.textContent = message;\\n}\",\n \"function outputOwnMessage(message) {\\n const div = document.createElement('div')\\n div.classList.add('alert','alert-success','my-2','mr-2','ml-5')\\n div.innerHTML = `
    \\n
    ${message.username} at ${message.time}
    \\n
    \\n

    ${message.text}

    `\\n\\n document.getElementById('chat-messages').appendChild(div);\\n}\",\n \"function print(out){\\n msg = document.createElement(\\\"p\\\");\\n msg.textContent = out.toString();\\n output.appendChild(msg);\\n}\",\n \"renderMessage_() {\\n const messsageEl = create(\\\"div\\\", {\\n classname: cssClass.MESSAGE_WRAPPER,\\n copy: copy.NO_SUBSCRIPTIONS,\\n });\\n\\n this.appendChild(messsageEl);\\n }\",\n \"function displayOutputMessage(text) {\\n const outputElem = goog.dom.getElement('output');\\n outputElem.innerHTML = outputElem.innerHTML + text + '\\\\n';\\n}\",\n \"function setMessage(msg) {\\n\\n\\tdocument.getElementById(\\\"message\\\").innerHTML = msg;\\n}\",\n \"function ShowMessage(msg) {\\n\\tdocument.getElementById(\\\"message\\\").innerHTML += \\\"

    \\\"+msg+\\\"

    \\\";\\n}\",\n \"function setMessage (msg){\\n document.getElementById(\\\"message\\\").innerHTML=msg;\\n}\",\n \"function displayMessage(type,message)\\n{\\n messageEL.text(message);\\n messageEL.attr(\\\"class\\\",type);\\n\\n}\",\n \"function outputStatus(message) {\\n const div = document.createElement('div')\\n div.classList.add('message')\\n div.innerHTML = `
  • \\n

    ${message.text}

    \\n

    ${message.time}

    \\n
  • `\\n document.querySelector('.chat-messages').appendChild(div)\\n}\",\n \"function addOutput(msg) {\\n var output = document.getElementById('script_output');\\n output.value += msg + \\\"\\\\n\\\";\\n\\n // Move cursor to the end of the output area.\\n output.scrollTop = output.scrollHeight;\\n }\",\n \"function setMessage(msg) {\\n\\t\\tdocument.getElementById(\\\"message\\\").innerText = msg;\\n\\t}\",\n \"function OutputLine(msg) {\\n $(\\\"output\\\").value += msg + \\\"\\\\n\\\";\\n}\",\n \"function outputMessage(message,position) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.classList.add(position);\\n const p = document.createElement('p');\\n p.classList.add('time');\\n p.innerText = message.time;\\n div.appendChild(p);\\n \\n const para = document.createElement('p');\\n para.classList.add('text');\\n if(message.username == 'ChatWid')\\n para.innerHTML = `${message.text}`;\\n else\\n para.innerHTML = `${message.username}: ${message.text}`;\\n div.appendChild(para);\\n\\n document.querySelector('.chat_messages').appendChild(div);\\n}\",\n \"function displayMessage(message){\\n document.getElementById('ui').innerHTML = message;\\n}\",\n \"displayMessage(message) {\\n this.messageContainerEl.innerHTML = `
    ${message}
    `;\\n this.messageContainerEl.classList.add('visible');\\n }\",\n \"function setMessage(msg){\\n document.getElementById(\\\"message\\\").innerHTML = msg;\\n}\",\n \"function setMessage(str) {\\n\\tdocument.getElementById(\\\"Messages\\\").innerHTML = \\\"

    \\\" + str + \\\"

    \\\";\\n}\",\n \"function output(message) {\\n var consoleMessage = \\\"
    \\\" + Date.now() + \\\" \\\" + message + \\\"
    \\\";\\n var element = $(consoleMessage);\\n addToArrayStorage('wellData', consoleMessage)\\n $('#console').append(element);\\n }\",\n \"function printClientInput(msg){\\r\\n\\r\\nvar messagelogtxt = document.getElementById('messagelog');\\r\\n\\r\\nmessagelogtxt.innerHTML += 'Client : ' + msg + '\\\\n';\\r\\nconsole.log(msg);\\r\\n}\",\n \"printMessage(input, msg) {\\n //Quantidade de erros\\n let errorsQty = input.parentNode.querySelector('.error-validation')\\n if(errorsQty === null) {\\n let template = document.querySelector('.error-validation').cloneNode(true)\\n template.textContent = msg\\n let inputParent = input.parentNode\\n template.classList.remove('template')\\n inputParent.appendChild(template)\\n }\\n }\",\n \"function t_print(message) {\\r\\n t_printRaw(\\\"
    \\\" + message + \\\"
    \\\");\\r\\n}\",\n \"function print(infoMessage, asHtml) {\\n var $msg = $('
    ');\\n if (asHtml) {\\n $msg.html(infoMessage);\\n } else {\\n $msg.text(infoMessage);\\n }\\n $chatWindow.append($msg);\\n }\",\n \"function print(infoMessage, asHtml) {\\n var $msg = $('
    ');\\n if (asHtml) {\\n\\n $msg.html(infoMessage);\\n\\n } else {\\n\\n $msg.text(infoMessage);\\n\\n }\\n $chatWindow.append($msg);\\n }\",\n \"function setMessage(msg) {\\n document.getElementById(\\\"message\\\").innerText = msg;\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div')\\n div.classList.add('message')\\n if (message.username === username) {\\n div.innerHTML = `
  • \\n ${message.username}\\n

    ${message.text} ${message.time}

    \\n
  • `\\n document.querySelector('.chat-messages').appendChild(div)\\n } else {\\n div.innerHTML = `
  • \\n ${message.username}\\n

    ${message.text} ${message.time}

    \\n
  • `\\n document.querySelector('.chat-messages').appendChild(div)\\n }\\n}\",\n \"function print(infoMessage, asHtml) {\\n var $msg = $('
    ');\\n if (asHtml) {\\n $msg.html(infoMessage);\\n } else {\\n $msg.text(infoMessage);\\n }\\n $chatWindow.append($msg);\\n\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.7349049","0.7335071","0.71537566","0.70986444","0.7090382","0.7079102","0.7029552","0.70211124","0.6986701","0.6970532","0.6938852","0.6931121","0.68999714","0.68598974","0.68533146","0.68473786","0.68436587","0.68171614","0.68057007","0.6804204","0.67987967","0.6793894","0.67919785","0.67907906","0.67887115","0.6781171","0.67730784","0.67640454","0.675726","0.67515326","0.67512375","0.6715463","0.6713512","0.67076945","0.670067","0.6700665","0.6698528","0.6696692","0.66930187","0.66930187","0.66858774","0.6681792","0.6681009","0.6671216","0.6669642","0.6663156","0.6657877","0.6647146","0.6646911","0.6634889","0.6625496","0.6616759","0.660278","0.6598213","0.6595484","0.6590413","0.65831685","0.65612155","0.6550998","0.65505075","0.6534918","0.65265894","0.6525591","0.65245265","0.6521987","0.6516475","0.65106046","0.6499613","0.6481182","0.64683753","0.6453471","0.64522797","0.6435572","0.6424349","0.6418317","0.6400467","0.63942975","0.6390499","0.6389481","0.6383705","0.63812476","0.635399","0.6342505","0.63389593","0.6335228","0.63258433","0.6325411","0.6318565","0.63085943","0.6303471","0.62923104","0.62918985","0.6287476","0.628464","0.6277287","0.6277256","0.62721664","0.62420946","0.62280613","0.6215863"],"string":"[\n \"0.7349049\",\n \"0.7335071\",\n \"0.71537566\",\n \"0.70986444\",\n \"0.7090382\",\n \"0.7079102\",\n \"0.7029552\",\n \"0.70211124\",\n \"0.6986701\",\n \"0.6970532\",\n \"0.6938852\",\n \"0.6931121\",\n \"0.68999714\",\n \"0.68598974\",\n \"0.68533146\",\n \"0.68473786\",\n \"0.68436587\",\n \"0.68171614\",\n \"0.68057007\",\n \"0.6804204\",\n \"0.67987967\",\n \"0.6793894\",\n \"0.67919785\",\n \"0.67907906\",\n \"0.67887115\",\n \"0.6781171\",\n \"0.67730784\",\n \"0.67640454\",\n \"0.675726\",\n \"0.67515326\",\n \"0.67512375\",\n \"0.6715463\",\n \"0.6713512\",\n \"0.67076945\",\n \"0.670067\",\n \"0.6700665\",\n \"0.6698528\",\n \"0.6696692\",\n \"0.66930187\",\n \"0.66930187\",\n \"0.66858774\",\n \"0.6681792\",\n \"0.6681009\",\n \"0.6671216\",\n \"0.6669642\",\n \"0.6663156\",\n \"0.6657877\",\n \"0.6647146\",\n \"0.6646911\",\n \"0.6634889\",\n \"0.6625496\",\n \"0.6616759\",\n \"0.660278\",\n \"0.6598213\",\n \"0.6595484\",\n \"0.6590413\",\n \"0.65831685\",\n \"0.65612155\",\n \"0.6550998\",\n \"0.65505075\",\n \"0.6534918\",\n \"0.65265894\",\n \"0.6525591\",\n \"0.65245265\",\n \"0.6521987\",\n \"0.6516475\",\n \"0.65106046\",\n \"0.6499613\",\n \"0.6481182\",\n \"0.64683753\",\n \"0.6453471\",\n \"0.64522797\",\n \"0.6435572\",\n \"0.6424349\",\n \"0.6418317\",\n \"0.6400467\",\n \"0.63942975\",\n \"0.6390499\",\n \"0.6389481\",\n \"0.6383705\",\n \"0.63812476\",\n \"0.635399\",\n \"0.6342505\",\n \"0.63389593\",\n \"0.6335228\",\n \"0.63258433\",\n \"0.6325411\",\n \"0.6318565\",\n \"0.63085943\",\n \"0.6303471\",\n \"0.62923104\",\n \"0.62918985\",\n \"0.6287476\",\n \"0.628464\",\n \"0.6277287\",\n \"0.6277256\",\n \"0.62721664\",\n \"0.62420946\",\n \"0.62280613\",\n \"0.6215863\"\n]"},"document_score":{"kind":"string","value":"0.68937236"},"document_rank":{"kind":"string","value":"13"}}},{"rowIdx":43,"cells":{"query":{"kind":"string","value":"Prompt the user before leave chat room"},"document":{"kind":"string","value":"function leaveRoom() {\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\n if (leaveRoom) {\n window.location = '../index.html';\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 leaveRoom() {\n let chatLink = server + '/chat/' + roomId;\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\n }).then((result) => { if (result.isConfirmed) window.location.href = \"/main\"; });\n}","function leaveUserRoom() {\r\n divHome.show();\r\n divRoom.hide();\r\n allMessageNb = 0;\r\n socket.emit(\"leaveRoom\", currentRoom);\r\n}","function leaveRoom(channel) {\n socket.emit(\"leave\", {\"channel\": channel, \"username\": username})\n document.getElementById(\"messages\").innerHTML = \"\"\n }","function leaveRoom() {\n socketRef.current.emit(\"user clicked leave meeting\", socketRef.current.id);\n props.history.push(\"/\");\n }","function commandLeave(msg) {\n if (!canManageGuild(msg.member)) return;\n\n let guild = msg.guild.id.toString();\n let vc = client.voiceConnections.get(guild);\n if (!vc) {\n return msg.channel.sendMessage('Bot is not in a channel!');\n } else {\n vc.leaveSharedStream();\n vc.disconnect();\n writeGuildConfig(guild, { vc: null });\n\n return msg.channel.sendMessage(';_; o-okay...');\n }\n}","function leaveroom(room) {\n document.querySelector('.chat').innerHTML = '';\n socket.emit('leave', { \"user\": user, \"room\": curr_room })\n}","function leaveChat(){\n\tplayTitleFlag = false;\n\txmlHttp3 = GetXmlHttpObject();\n\n\tif (xmlHttp3 == null){\n\t\talert(\"Browser does not support HTTP Request\");\n\t\treturn;\n\t}\n\n\tvar url = base_url+\"keluarChat/\" + userId;\n\txmlHttp3.open(\"POST\", url, true);\n\txmlHttp3.onreadystatechange = stateChanged3;\n\txmlHttp3.send(null);\n}","function leaveRoom()\n {\n // Leave room\n $(this).removeClass(\"joined\");\n socket.send(JSON.stringify({\n \"command\": \"leave\", // determines which handler will be used (see chat/routing.py)\n \"room\": room_id\n }));\n }","function leaveRoom() {\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\n }).then((result) => { if (result.isConfirmed) window.location.href = \"/main\"; });\n}","function leaveRoom() {\n // Call the server to leave the room\n socketInstance.delete('/room/' + roomId + '/onlineUsers', { id: myChatId });\n\n }","function LeaveRoom(room, username) {\n socket.leave(room);\n socket.broadcast.to(room).emit('ModRoomChangeReceive', { username: username, active: false });\n }","function handleExit() {\r\n\tif (confirm('Are you sure you want to leave the game?')) {\r\n\t\tsocket.emit('toLeave');\r\n\t\tlocation.reload();\r\n\t}\r\n}","async leaveGroupChat(parent, args, ctx, info) {\n // check login\n if (!ctx.request.userId) {\n throw new Error('You must be logged in to do that!');\n }\n // check that the user is the member of the group chat\n const where = { id: args.id };\n const chat = await ctx.db.query.talk({ where }, `{ members {id} }`);\n const isChatMember = chat.members\n .map(member => member.id)\n .includes(ctx.request.userId);\n if (!isChatMember) {\n throw new Error(`You are not a member of the chat!`);\n }\n\n // disconnect the current user\n return ctx.db.mutation.updateTalk(\n {\n data: {\n members: {\n disconnect: { id: ctx.request.userId },\n },\n },\n where: {\n id: args.id,\n },\n },\n info\n );\n }","function C012_AfterClass_Amanda_EndChat() {\n\tif (ActorGetValue(ActorPose) == \"Kneel\") ActorSetPose(\"Shy\");\n\tLeaveIcon = \"Leave\";\n}","function leaveRoom() {\n localStorage.removeItem(\"currentRoom\");\n setCurrentRoom(\"\");\n\n }","function leaveCommand(player, message) {\n\troom.kickPlayer(player.id, \"Bye !\", false);\n}","function leaveMeet() {\n\t// remove screen share stream if the user is sharing screen as well\n\tif (IsscreenShareActive) {\n\t\tStopScreenShare();\n\t}\n\n\tclientinstance.leave(\n\t\tfunction () {\n\t\t\tconsole.log(\"client leaves channel\");\n\t\t\tStreamsContainer.camera.stream.stop(); // stop the camera stream playback of the user\n\t\t\tclientinstance.unpublish(StreamsContainer.camera.stream); // unpublish the camera stream of the user\n\t\t\tStreamsContainer.camera.stream.close(); // clean up and close the camera stream of the user\n\t\t\t$(\"#remote-streams\").empty();\n\t\t\t//disable the UI elements which were enabled when the stream was received first time\n\t\t\t$(\"#mic-btn\").prop(\"disabled\", true);\n\t\t\t$(\"#video-btn\").prop(\"disabled\", true);\n\t\t\t$(\"#screen-share-btn\").prop(\"disabled\", true);\n\t\t\t$(\"#exit-btn\").prop(\"disabled\", true);\n\t\t\ttoggleVisibility(\"#mute-overlay\", false);\n\t\t\ttoggleVisibility(\"#no-local-video\", false);\n\t\t\tResizeGrid(); // resize grid after the user leaves\n\t\t\tredir(); // redirect back to meet room\n\t\t},\n\t\tfunction (err) {\n\t\t\tconsole.log(\"client failed to leave\", err); //error handling in case user couldnt leave properly\n\t\t}\n\t);\n}","function leaveGame() {\n console.log(\"Leaving game...\");\n channelLeaveGame();\n }","function SarahKickPlayerOut() {\n\tDialogLeave();\n\tSarahRoomAvailable = false;\n\tCommonSetScreen(\"Room\", \"MainHall\");\n}","function leaveRoom(id, name) {\n var newMessage = {\n receiverId: id,\n body: `${getel('myName').value} has left!`,\n senderName: getel('myName').value,\n roomName: name\n }\n\n socket.emit('leave', name, newMessage)\n renderMessage(newMessage)\n}","async function leaveChat(e) {\n if (roomId) {\n const db = window.firebase.firestore();\n window.roomRef = db.collection('rooms').doc(roomId);\n const messages = await window.roomRef.collection('messages').get();\n messages.forEach(async candidate => {\n await candidate.ref.delete();\n });\n await window.roomRef.delete();\n }\n //automatically signs out user on hangup.\n window.firebase.auth().signOut();\n window.location.reload();\n}","function OnTriggerExit(col: Collider){\n\tif(col.gameObject.tag == \"Player\") {\n\t\thasEntered = false;\n\t\tif(stateManager != null) {\n\t\t\tstateManager.UpdateContextualState(ContextualState.None, false);\t\t\t\t// false = message does not disappear after a while\n\t\t}\n\t}\n}","function leaveRoom() {\n\tif (player != \"\") {\n\t\troundEnded();\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=leaveroom&player=\" + player + \"&passcode=\" + passcode;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tinitRoomList();\n\t\t\t},\n\t\t});\n\t}\n}","function leaveGame() {\n var gameID = currentGame.id;\n currentGame = undefined;\n socket.emit('boardleave', {\n gameID: gameID,\n boardID: boardID\n });\n openHomeScreen($(\"#gameLobbyScreen\"));\n}","leave(id) {\n this.sock.send(JSON.stringify({action: 14, channel: 'room:' + id, presence: {action: 1, data: {}}}));\n }","doLeave() {\n logger.log('do leave', this.myroomjid);\n const pres = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\"$pres\"])({\n to: this.myroomjid,\n type: 'unavailable'\n });\n this.presMap.length = 0; // XXX Strophe is asynchronously sending by default. Unfortunately, that\n // means that there may not be enough time to send the unavailable\n // presence. Switching Strophe to synchronous sending is not much of an\n // option because it may lead to a noticeable delay in navigating away\n // from the current location. As a compromise, we will try to increase\n // the chances of sending the unavailable presence within the short time\n // span that we have upon unloading by invoking flush() on the\n // connection. We flush() once before sending/queuing the unavailable\n // presence in order to attemtp to have the unavailable presence at the\n // top of the send queue. We flush() once more after sending/queuing the\n // unavailable presence in order to attempt to have it sent as soon as\n // possible.\n // FIXME do not use Strophe.Connection in the ChatRoom directly\n\n !this.connection.isUsingWebSocket && this.connection.flush();\n this.connection.send(pres);\n this.connection.flush();\n }","function leaveRoom(connection) {\n\tif(connection&&connection.room) {\n\t\tvar index=connection.room.players.indexOf(connection.player);\n\t\tif(-1!==index) {\n\t\t\tconnection.room.players.splice(index,1);\n\t\t\troomsConnects[connection.room.id].splice(\n\t\t\t\troomsConnects[connection.room.id].indexOf(connection.sessid),1);\n\t\t\t// notifying players\n\t\t\troomsConnects[connection.room.id].forEach(function(destId) {\n\t\t\t\tconnections[destId].connection.sendUTF(JSON.stringify(\n\t\t\t\t\t{'type':'leave','player':connection.player.id})\n\t\t\t\t);\n\t\t\t});\n\t\t\tconnection.room=null;\n\t\t}\n\t}\n}","function leaveRoom(){\n\n disableElements(\"leaveRoom\");\n var message = {\n id: \"leaveRoom\"\n };\n\n participants[sessionId].rtcPeer.dispose();\n sendMessage(message);\n participants = {};\n\n var myNode = document.getElementById(\"video_list\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n}","function logoutUsr(){\r\n \t\t\r\n if(confirm(\"You will logged out of Chat\")){\r\n var usrName=\"\";\r\n \t if(document.getElementById(\"pageType\").value==\"chat\"){\r\n \t usrName =document.getElementById(\"usrName\").value;\r\n \t emitLogoutMsg(usrName);\r\n document.getElementById(\"usrName\").value=\"\";\r\n eraseCK(chatCK);\r\n window.location=chatUrl; \r\n \r\n \t }else {\r\n \t usrName =document.getElementById(\"usrAdmName\").value;\r\n \t emitLogoutMsg(usrName);\r\n document.getElementById(\"usrAdmName\").value=\"\";\r\n eraseCK(adminCK);\r\n window.location=adminUrl;\r\n \r\n }\r\n\r\n } \r\n }","leave() {\n if (this.client.browser) return;\n const connection = this.client.voice.connections.get(this.guild.id);\n if (connection && connection.channel.id === this.id) connection.disconnect();\n }","leaveChat() {\n return () => {\n this.bbmMessenger.chatLeave(this.chatId).then(() => {\n console.log(\"bbm-chat-header: left the chat\");\n });\n };\n }","function handleUserLeaveRoom({ roomId }) {\r\n socket.leave(roomId);\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, \"\");\r\n const [user, index] = findUserObject(socket);\r\n io.to(roomId).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n }","function leaveThanks(){\r\n\t//need to be able to feed back to 'edit', 'start', and 'confirm' :):)\r\n}","function leaveRoom() {\n window.location = routeHome()\n }","leaveRoom() {\n debug('videoChat:leaveRoom');\n const localMedia = this.get('stream');\n if (localMedia) {\n (localMedia.getTracks() || []).forEach(t => t.stop());\n }\n get(this, 'webrtc').leaveRoom(this.get('roomId'));\n get(this, 'webrtc').disconnect();\n (get(this, 'webrtc.webrtc.localStreams') || []).forEach(stream => stream.getTracks().forEach(t => t.stop()));\n }","function SarahSophieFreePlayerAndAmandaTheyLeave() {\n\tif (LogQuery(\"RentRoom\", \"PrivateRoom\") && (PrivateCharacter.length < PrivateCharacterMax) && !LogQuery(\"LockOutOfPrivateRoom\", \"Rule\")) {\n\t\tSarahTransferAmandaToRoom();\n\t\tCommonSetScreen(\"Room\", \"Private\");\n\t}\n\telse {\n\t\tDialogLeave();\n\t\tCommonSetScreen(\"Room\", \"MainHall\");\n\t}\n\tSarahRoomAvailable = false;\n}","Leave() {\n this.channel.leave();\n this.joined = false;\n this.isPlaying = false;\n delete globals.connections[this.channel.guild.id];\n }","leaveRoom()\n {\n this.setRoom(null);\n }","function leave() {\n document.getElementById(\"leave\").disabled = true;\n document.getElementById(\"join\").disabled = false;\n\n client.unpublish(localStream, function (err) {\n console.log(\"Unpublish local stream failed\" + err);\n });\n\n client.leave(function () {\n console.log(\"Leavel channel successfully\");\n }, function (err) {\n console.log(\"Leave channel failed\");\n });\n}","onLeave(client, consented) {\n\t\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\n\t}","function leaveClient() {\n\tsocket.emit('leave', {name: playerId});\n}","function endGame(winner) {\n\tdisableAll();\t\n\tif(winner === 'user'){\n\t\tif (userName == ''){\n\t\t\tResult.render('winner','The winner is YOU!');\t\t\t\n\t\t}\n\t\telse{ \n\t\t\tvar msg = 'The winner is '+ userName;\n\t\t\tResult.render('winner',msg);\t\t\t\t\t\n\t\t}\t\t\n\t}\n\telse{\n\t\tResult.render('loser','The winner is a Computer!!!');\t\t\n\t}\t\t\n}","function leaveRoom() {\n socket.emit('leave', {'username': username, 'room': room});\n\n document.querySelectorAll('.select-room').forEach(p => {\n p.style.color = \"black\";\n });\n}","function leaveConversation() {\n var confirm = window.confirm(\"Are you sure you want to leave this conversation?\");\n if (confirm) {\n xhttp(\"POST\", \"leave-conversation.php\", {conversation: right.num}, (response) => {\n if (!response) {\n alert(\"There's a problem leaving this conversation.\");\n } else {\n alert(\"You have left this conversation.\");\n //Removes the entry from data.\n delete data.conversations[right.num];\n document.getElementById(\"right\").innerHTML = \"\";\n }\n });\n } \n}","function chatOut (msg) {\n var nickname = $(\"#nickname\")[0].value;\n if (msg == \"\" || !msg)\n return;\n chatRef.push({\n id: id,\n name: (nickname ? nickname : id),\n message: msg,\n timestamp: new Date().getTime()\n })\n}","function confirmExit() {\n if (g_IsNetworked && !g_IsNetworkedActive) return;\n\n closeOpenDialogs();\n\n // Don't ask for exit if other humans are still playing\n let askExit =\n !Engine.HasNetServer() ||\n g_Players.every(\n (player, i) =>\n i == 0 ||\n player.state != \"active\" ||\n g_GameAttributes.settings.PlayerData[i].AI != \"\"\n );\n\n let subject = g_PlayerStateMessages[g_ConfirmExit];\n if (askExit) subject += \"\\n\" + translate(\"Do you want to quit?\");\n\n messageBox(\n 400,\n 200,\n subject,\n g_ConfirmExit == \"won\" ? translate(\"VICTORIOUS!\") : translate(\"DEFEATED!\"),\n askExit ? [translate(\"No\"), translate(\"Yes\")] : [translate(\"OK\")],\n askExit ? [resumeGame, leaveGame] : [resumeGame]\n );\n\n g_ConfirmExit = false;\n}","leaveVc(msg, bot, lang) {\r\n if (this.voiceConnection) {\r\n this.musicChannel.send(\r\n {\r\n embed: {\r\n type: 'rich',\r\n description: `⛔ Musique arrétée. Je part du channel : **${this.voiceConnection.channel.name}**.`,\r\n color: 3447003\r\n }}\r\n );\r\n\r\n this.musicChannel = null;\r\n if (this.dispatch) this.dispatch.end('leave');\r\n this.voiceConnection.disconnect();\r\n this.voiceConnection.removeAllListeners();\r\n\r\n this.changeStatus(Statustype.OFFLINE);\r\n\r\n this.voiceConnection = null;\r\n this.dispatch = null;\r\n } else {\r\n msg.channel.send(\r\n `I'm not in a voice channel! `\r\n );\r\n }\r\n }","function detachPlayerFromRoom(request)\n {\n var diff_lvl = request.session.player.diff_lvl;\n var tag = request.session.player.player_tag;\n\n roomCount[diff_lvl]--;\n request.io.leave(diff_lvl);\n console.log('LEAVE [' + diff_lvl + '] (' + tag + '): roomCount=' + roomCount[diff_lvl] );\n \n if (roomCount[diff_lvl] > 0)\n {\n var player = { player_tag: tag };\n request.io.room('' + diff_lvl).broadcast('gamer_exited_room', player );\n console.log(\"BROADCAST [\" + diff_lvl + \"]: gamer_exited_room (\" + tag + \")\");\n }\n else\n {\n console.log(\"...not BROADCASTing, since room [\" + diff_lvl + \"] is empty\");\n }\n }","handleClose() {\n this.room.leave(this);\n this.room.broadcast({\n type: 'note',\n text: `${this.name} left ${this.room.name}.`\n });\n }","function cancelForgotUsername(){\n\tcloseWindow();\n}","function endGame(msg) {\n //pop up alert message\n alert (`${msg}`);\n}","function endGame(msg) {\n\t// TODO: pop up alert message\n\t// this delivers a special pop up alert when a player wins the game\n\tSwal.fire('Good job!', msg, 'success');\n}","function leaveGame(sockId) {\n GameLobby.leftGame(sockId);\n}","function hangUpCall() {\n closeVideoCall();\n\n sendToServer({\n // caller: my_profile?.userId,\n sendto: params?.userId,\n type: \"leave\",\n });\n }","function leaveAllRooms() {\n reloadChatArea();\n $.post(\"/chatroom/leaveAll\", {username: username, reasonCode: 0}, function () {\n chatroomId = -1;\n getJoinedRooms();\n getChatRoomUsers();\n }, \"json\");\n}","function denyTournament() {\n\tdocument.getElementById('askTournament').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_tournament' : false\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for other players to finish tournament\");\n}","function clientDisconnect(data) {\n\tshowNewMessage(\"notification\", {msg: ' ~ '+data.username+' left the chatroom. ~'});\n\tMaterialize.toast(data.username+' left the chatroom.', 2000);\n\tremoveUserFromList(data);\n}","function leaveBooking() {\n if (localStorage.getItem(\"bookingRoom\")) {\n localStorage.removeItem(\"bookingRoom\");\n }\n // return \"Leaving booking page !\";\n}","function notifyLogout(userFound){\n if(userFound !== false){\n // echo globally that this client has left\n socket.broadcast.emit('user left', {\n username: socket.username,\n numUsers: 1\n });\n userFromMemory.isOnline = false;\n sendPlayer(userFromMemory);\n }\n }","function endGame(msg) {\n\t// TODO: pop up alert message\n\talert(msg);\n\tgameLive = false;\n}","function OnLeaveTeamPressed () {\n Game.PlayerJoinTeam(DOTATeam_t.DOTA_TEAM_NOTEAM);\n}","function endChat() {\n\t\t\t\tlogger.debug(\"endChat\", \"...chatState=\"+chatState);\n\t\t\t\t\n\t\t\t\tif (chat && (chatState == chat.chatStates.CHATTING || chatState == chat.chatStates.RESUMING \n\t\t\t\t\t|| chatState == chat.chatStates.WAITING)) { //|| chatState == chat.chatStates.NOTFOUND\n\t\t\t\t\t\n\t\t\t\t\tvar endChatParam = {\n\t\t\t\t\t\t\t\tdisposeVisitor : true,\n\t\t\t\t\t\t\t\tcontext : myChatWiz,\n\t\t\t\t\t\t\t\tskill : skill,\n\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\t\tlogger.debug(\"endChat.error\", data);\n\t\t\t\t\t\t\t\t\tchatWinCloseable = true;\n\t\t\t\t\t\t\t\t\tendChatHandler();\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t/* send endChat request and waiting for endChat event call back */\n\t\t\t\t\tvar failedRequest = chat.endChat(endChatParam);\n\t\t\t\t\t\t\t\n\t\t\t\t\tif (failedRequest && failedRequest.error) {\n\t\t\t\t\t\tlogger.debug(\"endChat.error2\", failedRequest);\n\t\t\t\t\t\tchatWinCloseable = true;\n\t\t\t\t\t\tendChatHandler();\t\n\t\t\t\t\t}\n\t\t\t\t}else if(chatState == chat.chatStates.INITIALISED){\n\t\t\t\t\tendChatHandler();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}","function SarahAmandaLeaveRoom() {\n\tfor (let C = 1; C < SarahCharacter.length; C++)\n\t\tif (SarahCharacter[C].Name == \"Amanda\")\n\t\t\tSarahCharacter.splice(C, 1);\n\tAmandaInside = false;\n\tDialogLeave();\n}","function leavePageWith(stateString) {\n socketRef.current.emit('leave-room-silently', currentUser.uid, room);\n history.push('/after', {\n state: { match_id: match_id, type: stateString },\n });\n }","function leaveTeam(context) {\n teamsService.leaveTeam()\n .then(function (res) {\n sessionStorage.clear();\n auth.saveSession(res);\n auth.showInfo(`Successfully leave the team!`);\n context.redirect('#/catalog');\n }).catch(auth.handleError);\n }","sendLeavePortalRequest() {\n log.debug('Sending request to leave portal.');\n const msgHeader = new MessageBuilder().\n setType(LEAVE_PORTAL_REQUEST).\n setPortalHostPeerId(this.portalHostPeerId).\n setTargetPeerId(this.portalHostPeerId).\n setSenderPeerId(this.localPeerId).\n getResult();\n const message = new MessageBuilder().\n setHeader(msgHeader).\n getResult();\n this.emitter.emit('enqueue-message', message);\n }","function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}","function send_off_game_message() {\n var chat_msg = $('#chat_msg').val();\n var chat_to = $('#chat_to').val();\n if (check_field_empty(chat_msg, 'message, cannot send empty message'))\n return false;\n if (check_field_empty(chat_to, 'recipient, no recipient specified'))\n return false;\n var dataObj = {\n \"content\" : [\n { \"session_id\" : get_cookie() },\n { \"to\" : chat_to },\n { \"content\" : chat_msg }\n ]\n };\n call_server('user_msg', dataObj);\n}","exitHandler() {\n this.saveUser(this.user);\n Channel.botMessage(`\\nGoodbye, ${this.user}!\\n\\n`);\n database.save(chatDB);\n process.exit(0);\n }","function disappear(){\n\tif (document.getElementById(\"prompt\")){\n\t\tvar prompt = document.getElementById(\"prompt\");\n\t\tprompt.parentNode.removeChild(prompt);\n\t}\n}","leaveCourt() {\n // User is not queued and is thus playing on this court\n this.props.removeUserFromActive();\n }","function OnLeaveTeamPressed()\n{\n\tGame.PlayerJoinTeam( DOTATeam_t.DOTA_TEAM_NOTEAM );\n}","function SarahLeaveRoom() {\n\tfor (let C = 1; C < SarahCharacter.length; C++)\n\t\tif (SarahCharacter[C].Name == \"Sarah\")\n\t\t\tSarahCharacter.splice(C, 1);\n\tSarahInside = false;\n\tDialogLeave();\n}","function handleDisconnect() {\r\n console.log(\"disconect received\", { socket });\r\n // Find corressponding object in usersArray\r\n const [user, index] = findUserObject(socket);\r\n\r\n // Emit to room\r\n io.to(user.room).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n\r\n // Remove user object\r\n removeUserObject(socket);\r\n }","function leaveRoom(socket, userId) {\n const roomID = socketToRoom[userId];\n let room = users[roomID];\n if (room) {\n room = room.filter(user => user.id !== userId);\n users[roomID] = room;\n }\n socket.broadcast.emit('user left', userId);\n}","function cancel_function() {\n var testV = 1;\n var pass1 = prompt('Please Enter Your Password','password');\n while (testV < 3) {\n if (pass1.toLowerCase() == \"letmein\") {\n cancel_rn = prompt(\"Which room would you like to cancel reservation?\");\n for (var i = 0; i < rooms.length; i++) {\n if(cancel_rn == rooms[i].number){\n rooms[i].duration_start = \"-\";\n rooms[i].duration_end = \"-\";\n rooms[i].open = \"Open\";\n rooms[i].breakTime = 0;\n break;\n }\n }\n loadRooms();\n \n break;\n } \n else {\n testV+=1;\n var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password');\n }\n }\n if (pass1.toLowerCase()!=\"password\" & testV ==3)\n history.go(-1);\n return \" \";\n}","function handleMessage(){\n if(currentRoom != old){\n \n var message = $('.chat-input input').val().trim();\n if(message){\n // send the message to the server with the room name\n var msg = new Messaging.Message(JSON.stringify({nickname: nickname, message: message, timestamp: Date.now()}));\n msg.destinationName = atopicName(currentRoom);\n msg.qos = 1;\n mqttClient.send(msg);\n \n $('.chat-input input').val('');\n } \n }}","function endgame() {\n inquirer\n //ask if the user would like to continue via a y or n prompt \n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to order more beans?\",\n })\n .then(function(answer) {\n // based on their answer, either run queryBeans function (i.e. start over) or end the connection and exit the app\n if (answer.continue === true) {\n queryBeans();\n }\n else{\n connection.end();\n return;\n }\n });\n }","handleOpponentLeaving()\n {\n console.log(\"opponent left\")\n playSound(\"oppLeft\");\n if(game.state.current===\"ticTac\")\n {\n Client.disconnectedFromChat({\"opponent\": game.opponent});\n game.state.start(\"waitingRoom\");\n }\n else\n {\n game.challengingFriend = false\n game.firstPlay = true\n }\n game.opponentLeft = true;\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\n 'right' : '-20%'\n });\n }","function quit() {\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"menu\",\n message: \"Would you like to go back to the main menu?\"\n }\n ]).then(function (arg) {\n if (arg.menu === false) {\n connection.end();\n process.exit();\n } else {\n userPrompt();\n }\n });\n}","function PromptNotActive(){}","function prepsend() {\n\tvar text = Chatbox.input.value;\n\tChatbox.input.value = null;\n\tswitch (text) {\n\tcase \"/version\":\n\t\tAPI.version();\n\t\treturn;\n\t}\n\tAPI.sendMsg(text);\n}","function endGame() {\r\n\t\tgameOver = true;\r\n\t\tsetMessage2(\"Game Over\");\r\n\t}","leaveRoom(roomName, ack) {\n /**\n * Leave the room. The leave method is internal to the socket.io\n * socket instance.\n */\n this.socket.leave(roomName);\n\n /**\n * Log the leave room action.\n */\n this.logger.info([this.socket.id, 'left room', roomName].join(' '));\n \n /**\n * Update the list of created rooms.\n */\n this.socketManager.updateRooms();\n\n /**\n * This acknowledge function essentially sends a message back to the client\n * acknowledging that the server received the send event. This particular\n * ack returns true that the server successfully removed the client from\n * the room.\n */\n ack(roomName);\n }","quit_game(){\n this.room = DEFAULT_CHATROOM;\n this.socket.emit('game:stop', { chatroom: this.room });\n delete this.game;\n }","function confirmClose()\r\n{\r\n if (g_bActive && event.clientY < 0)\r\n {\r\n event.returnValue = 'And do you want to quit this chat session also?';\r\n// setTimeout('myclose=false',100);\r\n// myclose=true;\r\n }\r\n}","function logOut() {\n input = readline.question(\"Are you sure you want to log out? (yes / no)\\n>> \");\n if (input === \"yes\") {\n console.log(\"Logging out, thanks for using MustGet Banking CLI!\");\n // Clear user\n user = {};\n // If user wants to logout, return back to beginning of program\n currentLoc = \"start\";\n } else if (input === \"no\") {\n console.log(\"Ok, returning to menu\");\n // If user doesn't want to logout, return back to menu.\n currentLoc = \"menu\";\n }\n}","function func_close_join_room_pop() {\n join_room.css(\"display\", \"none\");\n}","function endGame(msg) {\n\t// TODO: pop up alert message\n\talert(msg);\n}","function userMsgSend(e){\n\tif(e.which==13){\n\t\tif($('#userText').val()!=0){\n\t\t\topenAdminOpChat();\n\t\t}\n\t}\n}","function leaveClassroomClientSide(id) {\n\tvar classroomid = clients[id].classroomid;\n\tsendMessage(id, new Message(\"*\", \"server\", \"classroomid,undefined\"));\n\tsendMessage(id, new Message(\"*\", \"server\", \"permissions,undefined\"));\n\tsendMessage(id, new Message(\"message\", \"server\", \"Disconnecting from classroom\"));\n}","function endGame(msg) {\n // TODO: pop up alert message\n alert(msg)\n}","function SarahSophieLeaveRoom() {\n\tfor (let C = 1; C < SarahCharacter.length; C++)\n\t\tif ((SarahCharacter[C].Name == \"Sophie\") || (SarahCharacter[C].Name == \"Mistress Sophie\"))\n\t\t\tSarahCharacter.splice(C, 1);\n\tSophieInside = false;\n\tDialogLeave();\n}","function main(msg) {\n // Check if user types 'leave\n if (msg.content === '\\'leave') {\n // Check if the user is in the same voice channel\n if (msg.member.voice.channel) {\n // Make the bot leave\n msg.member.voice.channel.leave();\n // Delete the user's message\n msg.delete();\n }\n } else if (msg.content === '\\'stop') {\n // Play nothing\n play(msg, '', volume);\n } else if (msg.content === '\\'cmd') {\n // Run the commands method\n commands(msg);\n }\n}","function endConversationReceived(param) {\r\n\tendConversation(param);\r\n\tnotifyToolbar();\r\n}","function leave_channel(message, channel)\n{\n\tlet c = find_channel(channel);\n\tlet role = message.guild.roles.find(r => r.name === c.role);\n\t//let role = message.member.roles.find(r => r.name === c.role);\n\n\tif (role == undefined) {\n\t\treturn false;\n\t}\n\n\tif (!c.optout) {\n\t\tif (!message.member.roles.has(role.id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tmessage.member.removeRole(role);\n\t} else {\n\t\tmessage.member.addRole(role);\n\t}\n\treturn true;\n}","closeChat() {\n if (this.messagesRef ) {\n this.messagesRef.off();\n }\n }","socketsLeave(room) {\r\n this.adapter.delSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }","function endConversationHandler() {\r\n endConversation(tabs.getActiveTab().title);\r\n\r\n //send end conversation system message'\r\n conn.request({\r\n url: CONTACT_LIST_JSON_URL,\r\n method: 'POST',\r\n params: { method: \"endConversation\", userId:tabs.getActiveTab().title},\r\n success: function(responseObject) {\r\n },\r\n failure: function() {\r\n\t Ext.Msg.alert(getLocalizationValue('application.javascript.messagingWindow.alert.errorTitle'), getLocalizationValue('application.javascript.messagingWindow.alert.errorMsg'));\r\n }\r\n });\r\n}","function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}"],"string":"[\n \"function leaveRoom() {\\n let chatLink = server + '/chat/' + roomId;\\n Swal.fire({ background: background, position: \\\"top\\\", title: \\\"Leave this room?\\\",\\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\\n }).then((result) => { if (result.isConfirmed) window.location.href = \\\"/main\\\"; });\\n}\",\n \"function leaveUserRoom() {\\r\\n divHome.show();\\r\\n divRoom.hide();\\r\\n allMessageNb = 0;\\r\\n socket.emit(\\\"leaveRoom\\\", currentRoom);\\r\\n}\",\n \"function leaveRoom(channel) {\\n socket.emit(\\\"leave\\\", {\\\"channel\\\": channel, \\\"username\\\": username})\\n document.getElementById(\\\"messages\\\").innerHTML = \\\"\\\"\\n }\",\n \"function leaveRoom() {\\n socketRef.current.emit(\\\"user clicked leave meeting\\\", socketRef.current.id);\\n props.history.push(\\\"/\\\");\\n }\",\n \"function commandLeave(msg) {\\n if (!canManageGuild(msg.member)) return;\\n\\n let guild = msg.guild.id.toString();\\n let vc = client.voiceConnections.get(guild);\\n if (!vc) {\\n return msg.channel.sendMessage('Bot is not in a channel!');\\n } else {\\n vc.leaveSharedStream();\\n vc.disconnect();\\n writeGuildConfig(guild, { vc: null });\\n\\n return msg.channel.sendMessage(';_; o-okay...');\\n }\\n}\",\n \"function leaveroom(room) {\\n document.querySelector('.chat').innerHTML = '';\\n socket.emit('leave', { \\\"user\\\": user, \\\"room\\\": curr_room })\\n}\",\n \"function leaveChat(){\\n\\tplayTitleFlag = false;\\n\\txmlHttp3 = GetXmlHttpObject();\\n\\n\\tif (xmlHttp3 == null){\\n\\t\\talert(\\\"Browser does not support HTTP Request\\\");\\n\\t\\treturn;\\n\\t}\\n\\n\\tvar url = base_url+\\\"keluarChat/\\\" + userId;\\n\\txmlHttp3.open(\\\"POST\\\", url, true);\\n\\txmlHttp3.onreadystatechange = stateChanged3;\\n\\txmlHttp3.send(null);\\n}\",\n \"function leaveRoom()\\n {\\n // Leave room\\n $(this).removeClass(\\\"joined\\\");\\n socket.send(JSON.stringify({\\n \\\"command\\\": \\\"leave\\\", // determines which handler will be used (see chat/routing.py)\\n \\\"room\\\": room_id\\n }));\\n }\",\n \"function leaveRoom() {\\n Swal.fire({ background: background, position: \\\"top\\\", title: \\\"Leave this room?\\\",\\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\\n }).then((result) => { if (result.isConfirmed) window.location.href = \\\"/main\\\"; });\\n}\",\n \"function leaveRoom() {\\n // Call the server to leave the room\\n socketInstance.delete('/room/' + roomId + '/onlineUsers', { id: myChatId });\\n\\n }\",\n \"function LeaveRoom(room, username) {\\n socket.leave(room);\\n socket.broadcast.to(room).emit('ModRoomChangeReceive', { username: username, active: false });\\n }\",\n \"function handleExit() {\\r\\n\\tif (confirm('Are you sure you want to leave the game?')) {\\r\\n\\t\\tsocket.emit('toLeave');\\r\\n\\t\\tlocation.reload();\\r\\n\\t}\\r\\n}\",\n \"async leaveGroupChat(parent, args, ctx, info) {\\n // check login\\n if (!ctx.request.userId) {\\n throw new Error('You must be logged in to do that!');\\n }\\n // check that the user is the member of the group chat\\n const where = { id: args.id };\\n const chat = await ctx.db.query.talk({ where }, `{ members {id} }`);\\n const isChatMember = chat.members\\n .map(member => member.id)\\n .includes(ctx.request.userId);\\n if (!isChatMember) {\\n throw new Error(`You are not a member of the chat!`);\\n }\\n\\n // disconnect the current user\\n return ctx.db.mutation.updateTalk(\\n {\\n data: {\\n members: {\\n disconnect: { id: ctx.request.userId },\\n },\\n },\\n where: {\\n id: args.id,\\n },\\n },\\n info\\n );\\n }\",\n \"function C012_AfterClass_Amanda_EndChat() {\\n\\tif (ActorGetValue(ActorPose) == \\\"Kneel\\\") ActorSetPose(\\\"Shy\\\");\\n\\tLeaveIcon = \\\"Leave\\\";\\n}\",\n \"function leaveRoom() {\\n localStorage.removeItem(\\\"currentRoom\\\");\\n setCurrentRoom(\\\"\\\");\\n\\n }\",\n \"function leaveCommand(player, message) {\\n\\troom.kickPlayer(player.id, \\\"Bye !\\\", false);\\n}\",\n \"function leaveMeet() {\\n\\t// remove screen share stream if the user is sharing screen as well\\n\\tif (IsscreenShareActive) {\\n\\t\\tStopScreenShare();\\n\\t}\\n\\n\\tclientinstance.leave(\\n\\t\\tfunction () {\\n\\t\\t\\tconsole.log(\\\"client leaves channel\\\");\\n\\t\\t\\tStreamsContainer.camera.stream.stop(); // stop the camera stream playback of the user\\n\\t\\t\\tclientinstance.unpublish(StreamsContainer.camera.stream); // unpublish the camera stream of the user\\n\\t\\t\\tStreamsContainer.camera.stream.close(); // clean up and close the camera stream of the user\\n\\t\\t\\t$(\\\"#remote-streams\\\").empty();\\n\\t\\t\\t//disable the UI elements which were enabled when the stream was received first time\\n\\t\\t\\t$(\\\"#mic-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\t$(\\\"#video-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\t$(\\\"#screen-share-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\t$(\\\"#exit-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\ttoggleVisibility(\\\"#mute-overlay\\\", false);\\n\\t\\t\\ttoggleVisibility(\\\"#no-local-video\\\", false);\\n\\t\\t\\tResizeGrid(); // resize grid after the user leaves\\n\\t\\t\\tredir(); // redirect back to meet room\\n\\t\\t},\\n\\t\\tfunction (err) {\\n\\t\\t\\tconsole.log(\\\"client failed to leave\\\", err); //error handling in case user couldnt leave properly\\n\\t\\t}\\n\\t);\\n}\",\n \"function leaveGame() {\\n console.log(\\\"Leaving game...\\\");\\n channelLeaveGame();\\n }\",\n \"function SarahKickPlayerOut() {\\n\\tDialogLeave();\\n\\tSarahRoomAvailable = false;\\n\\tCommonSetScreen(\\\"Room\\\", \\\"MainHall\\\");\\n}\",\n \"function leaveRoom(id, name) {\\n var newMessage = {\\n receiverId: id,\\n body: `${getel('myName').value} has left!`,\\n senderName: getel('myName').value,\\n roomName: name\\n }\\n\\n socket.emit('leave', name, newMessage)\\n renderMessage(newMessage)\\n}\",\n \"async function leaveChat(e) {\\n if (roomId) {\\n const db = window.firebase.firestore();\\n window.roomRef = db.collection('rooms').doc(roomId);\\n const messages = await window.roomRef.collection('messages').get();\\n messages.forEach(async candidate => {\\n await candidate.ref.delete();\\n });\\n await window.roomRef.delete();\\n }\\n //automatically signs out user on hangup.\\n window.firebase.auth().signOut();\\n window.location.reload();\\n}\",\n \"function OnTriggerExit(col: Collider){\\n\\tif(col.gameObject.tag == \\\"Player\\\") {\\n\\t\\thasEntered = false;\\n\\t\\tif(stateManager != null) {\\n\\t\\t\\tstateManager.UpdateContextualState(ContextualState.None, false);\\t\\t\\t\\t// false = message does not disappear after a while\\n\\t\\t}\\n\\t}\\n}\",\n \"function leaveRoom() {\\n\\tif (player != \\\"\\\") {\\n\\t\\troundEnded();\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=leaveroom&player=\\\" + player + \\\"&passcode=\\\" + passcode;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tinitRoomList();\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function leaveGame() {\\n var gameID = currentGame.id;\\n currentGame = undefined;\\n socket.emit('boardleave', {\\n gameID: gameID,\\n boardID: boardID\\n });\\n openHomeScreen($(\\\"#gameLobbyScreen\\\"));\\n}\",\n \"leave(id) {\\n this.sock.send(JSON.stringify({action: 14, channel: 'room:' + id, presence: {action: 1, data: {}}}));\\n }\",\n \"doLeave() {\\n logger.log('do leave', this.myroomjid);\\n const pres = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\\\"$pres\\\"])({\\n to: this.myroomjid,\\n type: 'unavailable'\\n });\\n this.presMap.length = 0; // XXX Strophe is asynchronously sending by default. Unfortunately, that\\n // means that there may not be enough time to send the unavailable\\n // presence. Switching Strophe to synchronous sending is not much of an\\n // option because it may lead to a noticeable delay in navigating away\\n // from the current location. As a compromise, we will try to increase\\n // the chances of sending the unavailable presence within the short time\\n // span that we have upon unloading by invoking flush() on the\\n // connection. We flush() once before sending/queuing the unavailable\\n // presence in order to attemtp to have the unavailable presence at the\\n // top of the send queue. We flush() once more after sending/queuing the\\n // unavailable presence in order to attempt to have it sent as soon as\\n // possible.\\n // FIXME do not use Strophe.Connection in the ChatRoom directly\\n\\n !this.connection.isUsingWebSocket && this.connection.flush();\\n this.connection.send(pres);\\n this.connection.flush();\\n }\",\n \"function leaveRoom(connection) {\\n\\tif(connection&&connection.room) {\\n\\t\\tvar index=connection.room.players.indexOf(connection.player);\\n\\t\\tif(-1!==index) {\\n\\t\\t\\tconnection.room.players.splice(index,1);\\n\\t\\t\\troomsConnects[connection.room.id].splice(\\n\\t\\t\\t\\troomsConnects[connection.room.id].indexOf(connection.sessid),1);\\n\\t\\t\\t// notifying players\\n\\t\\t\\troomsConnects[connection.room.id].forEach(function(destId) {\\n\\t\\t\\t\\tconnections[destId].connection.sendUTF(JSON.stringify(\\n\\t\\t\\t\\t\\t{'type':'leave','player':connection.player.id})\\n\\t\\t\\t\\t);\\n\\t\\t\\t});\\n\\t\\t\\tconnection.room=null;\\n\\t\\t}\\n\\t}\\n}\",\n \"function leaveRoom(){\\n\\n disableElements(\\\"leaveRoom\\\");\\n var message = {\\n id: \\\"leaveRoom\\\"\\n };\\n\\n participants[sessionId].rtcPeer.dispose();\\n sendMessage(message);\\n participants = {};\\n\\n var myNode = document.getElementById(\\\"video_list\\\");\\n while (myNode.firstChild) {\\n myNode.removeChild(myNode.firstChild);\\n }\\n}\",\n \"function logoutUsr(){\\r\\n \\t\\t\\r\\n if(confirm(\\\"You will logged out of Chat\\\")){\\r\\n var usrName=\\\"\\\";\\r\\n \\t if(document.getElementById(\\\"pageType\\\").value==\\\"chat\\\"){\\r\\n \\t usrName =document.getElementById(\\\"usrName\\\").value;\\r\\n \\t emitLogoutMsg(usrName);\\r\\n document.getElementById(\\\"usrName\\\").value=\\\"\\\";\\r\\n eraseCK(chatCK);\\r\\n window.location=chatUrl; \\r\\n \\r\\n \\t }else {\\r\\n \\t usrName =document.getElementById(\\\"usrAdmName\\\").value;\\r\\n \\t emitLogoutMsg(usrName);\\r\\n document.getElementById(\\\"usrAdmName\\\").value=\\\"\\\";\\r\\n eraseCK(adminCK);\\r\\n window.location=adminUrl;\\r\\n \\r\\n }\\r\\n\\r\\n } \\r\\n }\",\n \"leave() {\\n if (this.client.browser) return;\\n const connection = this.client.voice.connections.get(this.guild.id);\\n if (connection && connection.channel.id === this.id) connection.disconnect();\\n }\",\n \"leaveChat() {\\n return () => {\\n this.bbmMessenger.chatLeave(this.chatId).then(() => {\\n console.log(\\\"bbm-chat-header: left the chat\\\");\\n });\\n };\\n }\",\n \"function handleUserLeaveRoom({ roomId }) {\\r\\n socket.leave(roomId);\\r\\n // Update corressponding object in usersArray\\r\\n updateUserRoom(socket, \\\"\\\");\\r\\n const [user, index] = findUserObject(socket);\\r\\n io.to(roomId).emit(\\\"userLeave\\\", {\\r\\n name: user.name,\\r\\n });\\r\\n }\",\n \"function leaveThanks(){\\r\\n\\t//need to be able to feed back to 'edit', 'start', and 'confirm' :):)\\r\\n}\",\n \"function leaveRoom() {\\n window.location = routeHome()\\n }\",\n \"leaveRoom() {\\n debug('videoChat:leaveRoom');\\n const localMedia = this.get('stream');\\n if (localMedia) {\\n (localMedia.getTracks() || []).forEach(t => t.stop());\\n }\\n get(this, 'webrtc').leaveRoom(this.get('roomId'));\\n get(this, 'webrtc').disconnect();\\n (get(this, 'webrtc.webrtc.localStreams') || []).forEach(stream => stream.getTracks().forEach(t => t.stop()));\\n }\",\n \"function SarahSophieFreePlayerAndAmandaTheyLeave() {\\n\\tif (LogQuery(\\\"RentRoom\\\", \\\"PrivateRoom\\\") && (PrivateCharacter.length < PrivateCharacterMax) && !LogQuery(\\\"LockOutOfPrivateRoom\\\", \\\"Rule\\\")) {\\n\\t\\tSarahTransferAmandaToRoom();\\n\\t\\tCommonSetScreen(\\\"Room\\\", \\\"Private\\\");\\n\\t}\\n\\telse {\\n\\t\\tDialogLeave();\\n\\t\\tCommonSetScreen(\\\"Room\\\", \\\"MainHall\\\");\\n\\t}\\n\\tSarahRoomAvailable = false;\\n}\",\n \"Leave() {\\n this.channel.leave();\\n this.joined = false;\\n this.isPlaying = false;\\n delete globals.connections[this.channel.guild.id];\\n }\",\n \"leaveRoom()\\n {\\n this.setRoom(null);\\n }\",\n \"function leave() {\\n document.getElementById(\\\"leave\\\").disabled = true;\\n document.getElementById(\\\"join\\\").disabled = false;\\n\\n client.unpublish(localStream, function (err) {\\n console.log(\\\"Unpublish local stream failed\\\" + err);\\n });\\n\\n client.leave(function () {\\n console.log(\\\"Leavel channel successfully\\\");\\n }, function (err) {\\n console.log(\\\"Leave channel failed\\\");\\n });\\n}\",\n \"onLeave(client, consented) {\\n\\t\\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\\n\\t}\",\n \"function leaveClient() {\\n\\tsocket.emit('leave', {name: playerId});\\n}\",\n \"function endGame(winner) {\\n\\tdisableAll();\\t\\n\\tif(winner === 'user'){\\n\\t\\tif (userName == ''){\\n\\t\\t\\tResult.render('winner','The winner is YOU!');\\t\\t\\t\\n\\t\\t}\\n\\t\\telse{ \\n\\t\\t\\tvar msg = 'The winner is '+ userName;\\n\\t\\t\\tResult.render('winner',msg);\\t\\t\\t\\t\\t\\n\\t\\t}\\t\\t\\n\\t}\\n\\telse{\\n\\t\\tResult.render('loser','The winner is a Computer!!!');\\t\\t\\n\\t}\\t\\t\\n}\",\n \"function leaveRoom() {\\n socket.emit('leave', {'username': username, 'room': room});\\n\\n document.querySelectorAll('.select-room').forEach(p => {\\n p.style.color = \\\"black\\\";\\n });\\n}\",\n \"function leaveConversation() {\\n var confirm = window.confirm(\\\"Are you sure you want to leave this conversation?\\\");\\n if (confirm) {\\n xhttp(\\\"POST\\\", \\\"leave-conversation.php\\\", {conversation: right.num}, (response) => {\\n if (!response) {\\n alert(\\\"There's a problem leaving this conversation.\\\");\\n } else {\\n alert(\\\"You have left this conversation.\\\");\\n //Removes the entry from data.\\n delete data.conversations[right.num];\\n document.getElementById(\\\"right\\\").innerHTML = \\\"\\\";\\n }\\n });\\n } \\n}\",\n \"function chatOut (msg) {\\n var nickname = $(\\\"#nickname\\\")[0].value;\\n if (msg == \\\"\\\" || !msg)\\n return;\\n chatRef.push({\\n id: id,\\n name: (nickname ? nickname : id),\\n message: msg,\\n timestamp: new Date().getTime()\\n })\\n}\",\n \"function confirmExit() {\\n if (g_IsNetworked && !g_IsNetworkedActive) return;\\n\\n closeOpenDialogs();\\n\\n // Don't ask for exit if other humans are still playing\\n let askExit =\\n !Engine.HasNetServer() ||\\n g_Players.every(\\n (player, i) =>\\n i == 0 ||\\n player.state != \\\"active\\\" ||\\n g_GameAttributes.settings.PlayerData[i].AI != \\\"\\\"\\n );\\n\\n let subject = g_PlayerStateMessages[g_ConfirmExit];\\n if (askExit) subject += \\\"\\\\n\\\" + translate(\\\"Do you want to quit?\\\");\\n\\n messageBox(\\n 400,\\n 200,\\n subject,\\n g_ConfirmExit == \\\"won\\\" ? translate(\\\"VICTORIOUS!\\\") : translate(\\\"DEFEATED!\\\"),\\n askExit ? [translate(\\\"No\\\"), translate(\\\"Yes\\\")] : [translate(\\\"OK\\\")],\\n askExit ? [resumeGame, leaveGame] : [resumeGame]\\n );\\n\\n g_ConfirmExit = false;\\n}\",\n \"leaveVc(msg, bot, lang) {\\r\\n if (this.voiceConnection) {\\r\\n this.musicChannel.send(\\r\\n {\\r\\n embed: {\\r\\n type: 'rich',\\r\\n description: `⛔ Musique arrétée. Je part du channel : **${this.voiceConnection.channel.name}**.`,\\r\\n color: 3447003\\r\\n }}\\r\\n );\\r\\n\\r\\n this.musicChannel = null;\\r\\n if (this.dispatch) this.dispatch.end('leave');\\r\\n this.voiceConnection.disconnect();\\r\\n this.voiceConnection.removeAllListeners();\\r\\n\\r\\n this.changeStatus(Statustype.OFFLINE);\\r\\n\\r\\n this.voiceConnection = null;\\r\\n this.dispatch = null;\\r\\n } else {\\r\\n msg.channel.send(\\r\\n `I'm not in a voice channel! `\\r\\n );\\r\\n }\\r\\n }\",\n \"function detachPlayerFromRoom(request)\\n {\\n var diff_lvl = request.session.player.diff_lvl;\\n var tag = request.session.player.player_tag;\\n\\n roomCount[diff_lvl]--;\\n request.io.leave(diff_lvl);\\n console.log('LEAVE [' + diff_lvl + '] (' + tag + '): roomCount=' + roomCount[diff_lvl] );\\n \\n if (roomCount[diff_lvl] > 0)\\n {\\n var player = { player_tag: tag };\\n request.io.room('' + diff_lvl).broadcast('gamer_exited_room', player );\\n console.log(\\\"BROADCAST [\\\" + diff_lvl + \\\"]: gamer_exited_room (\\\" + tag + \\\")\\\");\\n }\\n else\\n {\\n console.log(\\\"...not BROADCASTing, since room [\\\" + diff_lvl + \\\"] is empty\\\");\\n }\\n }\",\n \"handleClose() {\\n this.room.leave(this);\\n this.room.broadcast({\\n type: 'note',\\n text: `${this.name} left ${this.room.name}.`\\n });\\n }\",\n \"function cancelForgotUsername(){\\n\\tcloseWindow();\\n}\",\n \"function endGame(msg) {\\n //pop up alert message\\n alert (`${msg}`);\\n}\",\n \"function endGame(msg) {\\n\\t// TODO: pop up alert message\\n\\t// this delivers a special pop up alert when a player wins the game\\n\\tSwal.fire('Good job!', msg, 'success');\\n}\",\n \"function leaveGame(sockId) {\\n GameLobby.leftGame(sockId);\\n}\",\n \"function hangUpCall() {\\n closeVideoCall();\\n\\n sendToServer({\\n // caller: my_profile?.userId,\\n sendto: params?.userId,\\n type: \\\"leave\\\",\\n });\\n }\",\n \"function leaveAllRooms() {\\n reloadChatArea();\\n $.post(\\\"/chatroom/leaveAll\\\", {username: username, reasonCode: 0}, function () {\\n chatroomId = -1;\\n getJoinedRooms();\\n getChatRoomUsers();\\n }, \\\"json\\\");\\n}\",\n \"function denyTournament() {\\n\\tdocument.getElementById('askTournament').style.display = \\\"none\\\";\\n\\tvar data = JSON.stringify({\\n\\t\\t'name' : PlayerName,\\n\\t\\t'participate_tournament' : false\\n\\t});\\n\\tsocketConn.send(data);\\n\\tvar serverMsg = document.getElementById('serverMsg');\\n\\tserverMsg.value += (\\\"\\\\n> waiting for other players to finish tournament\\\");\\n}\",\n \"function clientDisconnect(data) {\\n\\tshowNewMessage(\\\"notification\\\", {msg: ' ~ '+data.username+' left the chatroom. ~'});\\n\\tMaterialize.toast(data.username+' left the chatroom.', 2000);\\n\\tremoveUserFromList(data);\\n}\",\n \"function leaveBooking() {\\n if (localStorage.getItem(\\\"bookingRoom\\\")) {\\n localStorage.removeItem(\\\"bookingRoom\\\");\\n }\\n // return \\\"Leaving booking page !\\\";\\n}\",\n \"function notifyLogout(userFound){\\n if(userFound !== false){\\n // echo globally that this client has left\\n socket.broadcast.emit('user left', {\\n username: socket.username,\\n numUsers: 1\\n });\\n userFromMemory.isOnline = false;\\n sendPlayer(userFromMemory);\\n }\\n }\",\n \"function endGame(msg) {\\n\\t// TODO: pop up alert message\\n\\talert(msg);\\n\\tgameLive = false;\\n}\",\n \"function OnLeaveTeamPressed () {\\n Game.PlayerJoinTeam(DOTATeam_t.DOTA_TEAM_NOTEAM);\\n}\",\n \"function endChat() {\\n\\t\\t\\t\\tlogger.debug(\\\"endChat\\\", \\\"...chatState=\\\"+chatState);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif (chat && (chatState == chat.chatStates.CHATTING || chatState == chat.chatStates.RESUMING \\n\\t\\t\\t\\t\\t|| chatState == chat.chatStates.WAITING)) { //|| chatState == chat.chatStates.NOTFOUND\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tvar endChatParam = {\\n\\t\\t\\t\\t\\t\\t\\t\\tdisposeVisitor : true,\\n\\t\\t\\t\\t\\t\\t\\t\\tcontext : myChatWiz,\\n\\t\\t\\t\\t\\t\\t\\t\\tskill : skill,\\n\\t\\t\\t\\t\\t\\t\\t\\terror: function(data) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tlogger.debug(\\\"endChat.error\\\", data);\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tchatWinCloseable = true;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tendChatHandler();\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t/* send endChat request and waiting for endChat event call back */\\n\\t\\t\\t\\t\\tvar failedRequest = chat.endChat(endChatParam);\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif (failedRequest && failedRequest.error) {\\n\\t\\t\\t\\t\\t\\tlogger.debug(\\\"endChat.error2\\\", failedRequest);\\n\\t\\t\\t\\t\\t\\tchatWinCloseable = true;\\n\\t\\t\\t\\t\\t\\tendChatHandler();\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}else if(chatState == chat.chatStates.INITIALISED){\\n\\t\\t\\t\\t\\tendChatHandler();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t}\",\n \"function SarahAmandaLeaveRoom() {\\n\\tfor (let C = 1; C < SarahCharacter.length; C++)\\n\\t\\tif (SarahCharacter[C].Name == \\\"Amanda\\\")\\n\\t\\t\\tSarahCharacter.splice(C, 1);\\n\\tAmandaInside = false;\\n\\tDialogLeave();\\n}\",\n \"function leavePageWith(stateString) {\\n socketRef.current.emit('leave-room-silently', currentUser.uid, room);\\n history.push('/after', {\\n state: { match_id: match_id, type: stateString },\\n });\\n }\",\n \"function leaveTeam(context) {\\n teamsService.leaveTeam()\\n .then(function (res) {\\n sessionStorage.clear();\\n auth.saveSession(res);\\n auth.showInfo(`Successfully leave the team!`);\\n context.redirect('#/catalog');\\n }).catch(auth.handleError);\\n }\",\n \"sendLeavePortalRequest() {\\n log.debug('Sending request to leave portal.');\\n const msgHeader = new MessageBuilder().\\n setType(LEAVE_PORTAL_REQUEST).\\n setPortalHostPeerId(this.portalHostPeerId).\\n setTargetPeerId(this.portalHostPeerId).\\n setSenderPeerId(this.localPeerId).\\n getResult();\\n const message = new MessageBuilder().\\n setHeader(msgHeader).\\n getResult();\\n this.emitter.emit('enqueue-message', message);\\n }\",\n \"function joinRoom(room)\\r\\n{\\r\\n //TODO erase... Name must be known previously\\r\\n var name = '';\\r\\n while(name == '')\\r\\n {\\r\\n name = prompt(\\\"Wie heißt du?\\\");\\r\\n }\\r\\n\\r\\n socket.emit('requestRoom', room, name);\\r\\n document.getElementById(\\\"chooseRoom\\\").classList.add('hidden');\\r\\n \\r\\n //TODO: maybe show loading icon...\\r\\n}\",\n \"function send_off_game_message() {\\n var chat_msg = $('#chat_msg').val();\\n var chat_to = $('#chat_to').val();\\n if (check_field_empty(chat_msg, 'message, cannot send empty message'))\\n return false;\\n if (check_field_empty(chat_to, 'recipient, no recipient specified'))\\n return false;\\n var dataObj = {\\n \\\"content\\\" : [\\n { \\\"session_id\\\" : get_cookie() },\\n { \\\"to\\\" : chat_to },\\n { \\\"content\\\" : chat_msg }\\n ]\\n };\\n call_server('user_msg', dataObj);\\n}\",\n \"exitHandler() {\\n this.saveUser(this.user);\\n Channel.botMessage(`\\\\nGoodbye, ${this.user}!\\\\n\\\\n`);\\n database.save(chatDB);\\n process.exit(0);\\n }\",\n \"function disappear(){\\n\\tif (document.getElementById(\\\"prompt\\\")){\\n\\t\\tvar prompt = document.getElementById(\\\"prompt\\\");\\n\\t\\tprompt.parentNode.removeChild(prompt);\\n\\t}\\n}\",\n \"leaveCourt() {\\n // User is not queued and is thus playing on this court\\n this.props.removeUserFromActive();\\n }\",\n \"function OnLeaveTeamPressed()\\n{\\n\\tGame.PlayerJoinTeam( DOTATeam_t.DOTA_TEAM_NOTEAM );\\n}\",\n \"function SarahLeaveRoom() {\\n\\tfor (let C = 1; C < SarahCharacter.length; C++)\\n\\t\\tif (SarahCharacter[C].Name == \\\"Sarah\\\")\\n\\t\\t\\tSarahCharacter.splice(C, 1);\\n\\tSarahInside = false;\\n\\tDialogLeave();\\n}\",\n \"function handleDisconnect() {\\r\\n console.log(\\\"disconect received\\\", { socket });\\r\\n // Find corressponding object in usersArray\\r\\n const [user, index] = findUserObject(socket);\\r\\n\\r\\n // Emit to room\\r\\n io.to(user.room).emit(\\\"userLeave\\\", {\\r\\n name: user.name,\\r\\n });\\r\\n\\r\\n // Remove user object\\r\\n removeUserObject(socket);\\r\\n }\",\n \"function leaveRoom(socket, userId) {\\n const roomID = socketToRoom[userId];\\n let room = users[roomID];\\n if (room) {\\n room = room.filter(user => user.id !== userId);\\n users[roomID] = room;\\n }\\n socket.broadcast.emit('user left', userId);\\n}\",\n \"function cancel_function() {\\n var testV = 1;\\n var pass1 = prompt('Please Enter Your Password','password');\\n while (testV < 3) {\\n if (pass1.toLowerCase() == \\\"letmein\\\") {\\n cancel_rn = prompt(\\\"Which room would you like to cancel reservation?\\\");\\n for (var i = 0; i < rooms.length; i++) {\\n if(cancel_rn == rooms[i].number){\\n rooms[i].duration_start = \\\"-\\\";\\n rooms[i].duration_end = \\\"-\\\";\\n rooms[i].open = \\\"Open\\\";\\n rooms[i].breakTime = 0;\\n break;\\n }\\n }\\n loadRooms();\\n \\n break;\\n } \\n else {\\n testV+=1;\\n var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password');\\n }\\n }\\n if (pass1.toLowerCase()!=\\\"password\\\" & testV ==3)\\n history.go(-1);\\n return \\\" \\\";\\n}\",\n \"function handleMessage(){\\n if(currentRoom != old){\\n \\n var message = $('.chat-input input').val().trim();\\n if(message){\\n // send the message to the server with the room name\\n var msg = new Messaging.Message(JSON.stringify({nickname: nickname, message: message, timestamp: Date.now()}));\\n msg.destinationName = atopicName(currentRoom);\\n msg.qos = 1;\\n mqttClient.send(msg);\\n \\n $('.chat-input input').val('');\\n } \\n }}\",\n \"function endgame() {\\n inquirer\\n //ask if the user would like to continue via a y or n prompt \\n .prompt({\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to order more beans?\\\",\\n })\\n .then(function(answer) {\\n // based on their answer, either run queryBeans function (i.e. start over) or end the connection and exit the app\\n if (answer.continue === true) {\\n queryBeans();\\n }\\n else{\\n connection.end();\\n return;\\n }\\n });\\n }\",\n \"handleOpponentLeaving()\\n {\\n console.log(\\\"opponent left\\\")\\n playSound(\\\"oppLeft\\\");\\n if(game.state.current===\\\"ticTac\\\")\\n {\\n Client.disconnectedFromChat({\\\"opponent\\\": game.opponent});\\n game.state.start(\\\"waitingRoom\\\");\\n }\\n else\\n {\\n game.challengingFriend = false\\n game.firstPlay = true\\n }\\n game.opponentLeft = true;\\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\\n 'right' : '-20%'\\n });\\n }\",\n \"function quit() {\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"menu\\\",\\n message: \\\"Would you like to go back to the main menu?\\\"\\n }\\n ]).then(function (arg) {\\n if (arg.menu === false) {\\n connection.end();\\n process.exit();\\n } else {\\n userPrompt();\\n }\\n });\\n}\",\n \"function PromptNotActive(){}\",\n \"function prepsend() {\\n\\tvar text = Chatbox.input.value;\\n\\tChatbox.input.value = null;\\n\\tswitch (text) {\\n\\tcase \\\"/version\\\":\\n\\t\\tAPI.version();\\n\\t\\treturn;\\n\\t}\\n\\tAPI.sendMsg(text);\\n}\",\n \"function endGame() {\\r\\n\\t\\tgameOver = true;\\r\\n\\t\\tsetMessage2(\\\"Game Over\\\");\\r\\n\\t}\",\n \"leaveRoom(roomName, ack) {\\n /**\\n * Leave the room. The leave method is internal to the socket.io\\n * socket instance.\\n */\\n this.socket.leave(roomName);\\n\\n /**\\n * Log the leave room action.\\n */\\n this.logger.info([this.socket.id, 'left room', roomName].join(' '));\\n \\n /**\\n * Update the list of created rooms.\\n */\\n this.socketManager.updateRooms();\\n\\n /**\\n * This acknowledge function essentially sends a message back to the client\\n * acknowledging that the server received the send event. This particular\\n * ack returns true that the server successfully removed the client from\\n * the room.\\n */\\n ack(roomName);\\n }\",\n \"quit_game(){\\n this.room = DEFAULT_CHATROOM;\\n this.socket.emit('game:stop', { chatroom: this.room });\\n delete this.game;\\n }\",\n \"function confirmClose()\\r\\n{\\r\\n if (g_bActive && event.clientY < 0)\\r\\n {\\r\\n event.returnValue = 'And do you want to quit this chat session also?';\\r\\n// setTimeout('myclose=false',100);\\r\\n// myclose=true;\\r\\n }\\r\\n}\",\n \"function logOut() {\\n input = readline.question(\\\"Are you sure you want to log out? (yes / no)\\\\n>> \\\");\\n if (input === \\\"yes\\\") {\\n console.log(\\\"Logging out, thanks for using MustGet Banking CLI!\\\");\\n // Clear user\\n user = {};\\n // If user wants to logout, return back to beginning of program\\n currentLoc = \\\"start\\\";\\n } else if (input === \\\"no\\\") {\\n console.log(\\\"Ok, returning to menu\\\");\\n // If user doesn't want to logout, return back to menu.\\n currentLoc = \\\"menu\\\";\\n }\\n}\",\n \"function func_close_join_room_pop() {\\n join_room.css(\\\"display\\\", \\\"none\\\");\\n}\",\n \"function endGame(msg) {\\n\\t// TODO: pop up alert message\\n\\talert(msg);\\n}\",\n \"function userMsgSend(e){\\n\\tif(e.which==13){\\n\\t\\tif($('#userText').val()!=0){\\n\\t\\t\\topenAdminOpChat();\\n\\t\\t}\\n\\t}\\n}\",\n \"function leaveClassroomClientSide(id) {\\n\\tvar classroomid = clients[id].classroomid;\\n\\tsendMessage(id, new Message(\\\"*\\\", \\\"server\\\", \\\"classroomid,undefined\\\"));\\n\\tsendMessage(id, new Message(\\\"*\\\", \\\"server\\\", \\\"permissions,undefined\\\"));\\n\\tsendMessage(id, new Message(\\\"message\\\", \\\"server\\\", \\\"Disconnecting from classroom\\\"));\\n}\",\n \"function endGame(msg) {\\n // TODO: pop up alert message\\n alert(msg)\\n}\",\n \"function SarahSophieLeaveRoom() {\\n\\tfor (let C = 1; C < SarahCharacter.length; C++)\\n\\t\\tif ((SarahCharacter[C].Name == \\\"Sophie\\\") || (SarahCharacter[C].Name == \\\"Mistress Sophie\\\"))\\n\\t\\t\\tSarahCharacter.splice(C, 1);\\n\\tSophieInside = false;\\n\\tDialogLeave();\\n}\",\n \"function main(msg) {\\n // Check if user types 'leave\\n if (msg.content === '\\\\'leave') {\\n // Check if the user is in the same voice channel\\n if (msg.member.voice.channel) {\\n // Make the bot leave\\n msg.member.voice.channel.leave();\\n // Delete the user's message\\n msg.delete();\\n }\\n } else if (msg.content === '\\\\'stop') {\\n // Play nothing\\n play(msg, '', volume);\\n } else if (msg.content === '\\\\'cmd') {\\n // Run the commands method\\n commands(msg);\\n }\\n}\",\n \"function endConversationReceived(param) {\\r\\n\\tendConversation(param);\\r\\n\\tnotifyToolbar();\\r\\n}\",\n \"function leave_channel(message, channel)\\n{\\n\\tlet c = find_channel(channel);\\n\\tlet role = message.guild.roles.find(r => r.name === c.role);\\n\\t//let role = message.member.roles.find(r => r.name === c.role);\\n\\n\\tif (role == undefined) {\\n\\t\\treturn false;\\n\\t}\\n\\n\\tif (!c.optout) {\\n\\t\\tif (!message.member.roles.has(role.id)) {\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\n\\t\\tmessage.member.removeRole(role);\\n\\t} else {\\n\\t\\tmessage.member.addRole(role);\\n\\t}\\n\\treturn true;\\n}\",\n \"closeChat() {\\n if (this.messagesRef ) {\\n this.messagesRef.off();\\n }\\n }\",\n \"socketsLeave(room) {\\r\\n this.adapter.delSockets({\\r\\n rooms: this.rooms,\\r\\n except: this.exceptRooms,\\r\\n }, Array.isArray(room) ? room : [room]);\\r\\n }\",\n \"function endConversationHandler() {\\r\\n endConversation(tabs.getActiveTab().title);\\r\\n\\r\\n //send end conversation system message'\\r\\n conn.request({\\r\\n url: CONTACT_LIST_JSON_URL,\\r\\n method: 'POST',\\r\\n params: { method: \\\"endConversation\\\", userId:tabs.getActiveTab().title},\\r\\n success: function(responseObject) {\\r\\n },\\r\\n failure: function() {\\r\\n\\t Ext.Msg.alert(getLocalizationValue('application.javascript.messagingWindow.alert.errorTitle'), getLocalizationValue('application.javascript.messagingWindow.alert.errorMsg'));\\r\\n }\\r\\n });\\r\\n}\",\n \"function endGame(msg) {\\n // TODO: pop up alert message\\n alert(msg);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7367518","0.7307474","0.72227997","0.7046869","0.6863847","0.68358433","0.68050003","0.6736533","0.66827023","0.66460466","0.6634746","0.6505397","0.6496834","0.6462929","0.6460044","0.64054745","0.6391411","0.6321094","0.6310152","0.62895876","0.62817484","0.6198753","0.613407","0.6119738","0.6105933","0.6100672","0.6092192","0.60802233","0.6076658","0.60501844","0.6024035","0.59923023","0.5973529","0.5972423","0.59267","0.5924167","0.5899115","0.5892778","0.5878221","0.58633256","0.58608836","0.5850646","0.5845452","0.58444387","0.5829315","0.5825856","0.57990414","0.5794012","0.5788164","0.5780917","0.5779853","0.5778756","0.57551295","0.5732102","0.57315254","0.5725374","0.56952757","0.5672169","0.56717753","0.5625015","0.561606","0.561373","0.5611756","0.5593723","0.5589702","0.5588916","0.55855805","0.5578352","0.5577689","0.5561705","0.5561209","0.5561171","0.5553398","0.5544924","0.5542591","0.5537021","0.5512005","0.5507795","0.5500571","0.55001706","0.5499985","0.54980934","0.54947335","0.54913","0.5488004","0.5484479","0.5484116","0.5482841","0.54770094","0.54770076","0.5470186","0.54696256","0.5455271","0.5452669","0.54515994","0.5450089","0.54493284","0.54436445","0.5437331","0.54362696"],"string":"[\n \"0.7367518\",\n \"0.7307474\",\n \"0.72227997\",\n \"0.7046869\",\n \"0.6863847\",\n \"0.68358433\",\n \"0.68050003\",\n \"0.6736533\",\n \"0.66827023\",\n \"0.66460466\",\n \"0.6634746\",\n \"0.6505397\",\n \"0.6496834\",\n \"0.6462929\",\n \"0.6460044\",\n \"0.64054745\",\n \"0.6391411\",\n \"0.6321094\",\n \"0.6310152\",\n \"0.62895876\",\n \"0.62817484\",\n \"0.6198753\",\n \"0.613407\",\n \"0.6119738\",\n \"0.6105933\",\n \"0.6100672\",\n \"0.6092192\",\n \"0.60802233\",\n \"0.6076658\",\n \"0.60501844\",\n \"0.6024035\",\n \"0.59923023\",\n \"0.5973529\",\n \"0.5972423\",\n \"0.59267\",\n \"0.5924167\",\n \"0.5899115\",\n \"0.5892778\",\n \"0.5878221\",\n \"0.58633256\",\n \"0.58608836\",\n \"0.5850646\",\n \"0.5845452\",\n \"0.58444387\",\n \"0.5829315\",\n \"0.5825856\",\n \"0.57990414\",\n \"0.5794012\",\n \"0.5788164\",\n \"0.5780917\",\n \"0.5779853\",\n \"0.5778756\",\n \"0.57551295\",\n \"0.5732102\",\n \"0.57315254\",\n \"0.5725374\",\n \"0.56952757\",\n \"0.5672169\",\n \"0.56717753\",\n \"0.5625015\",\n \"0.561606\",\n \"0.561373\",\n \"0.5611756\",\n \"0.5593723\",\n \"0.5589702\",\n \"0.5588916\",\n \"0.55855805\",\n \"0.5578352\",\n \"0.5577689\",\n \"0.5561705\",\n \"0.5561209\",\n \"0.5561171\",\n \"0.5553398\",\n \"0.5544924\",\n \"0.5542591\",\n \"0.5537021\",\n \"0.5512005\",\n \"0.5507795\",\n \"0.5500571\",\n \"0.55001706\",\n \"0.5499985\",\n \"0.54980934\",\n \"0.54947335\",\n \"0.54913\",\n \"0.5488004\",\n \"0.5484479\",\n \"0.5484116\",\n \"0.5482841\",\n \"0.54770094\",\n \"0.54770076\",\n \"0.5470186\",\n \"0.54696256\",\n \"0.5455271\",\n \"0.5452669\",\n \"0.54515994\",\n \"0.5450089\",\n \"0.54493284\",\n \"0.54436445\",\n \"0.5437331\",\n \"0.54362696\"\n]"},"document_score":{"kind":"string","value":"0.72276896"},"document_rank":{"kind":"string","value":"2"}}},{"rowIdx":44,"cells":{"query":{"kind":"string","value":"Add room name to DOM"},"document":{"kind":"string","value":"function outputRoomName(room) {\n const roomName = document.getElementById('room-name');\n \n roomName.innerHTML = room;\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 outputRoomName(room) {\n roomName.innerHTML = `
  • \n
    \n
    \n

    ${room}

    \n
    \n
    \n
  • `\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n \n roomName.innerText = room;\n}","function outputRoomName(room) {\r\n roomName.innerText = room;\r\n}","function outputRoomName(room) {\r\n roomName.innerText = room;\r\n}","function outputRoomName(room){\n roomName.innerHTML = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room){\n roomName.innerText = room;\n}","function outputRoomName(room){\n roomName.innerHTML = room;\n }","function outputRoomName(room){\n roomName.innerText = room;\n}","function outputRoomName(room){\n roomName.innerText=room;\n}","function outputRoomname(room){\n roomName.innerText = room;\n}","function outputRoomname(room){\n roomName.innerText= room;\n}","function outputRoomName(room){\n\n roomName.innerText=room;\n\n}","function setRoom(name) {\n\t$('#joinRoom').remove();\n\t$('h1').text('Room name : ' + name);\n\t$('body').append('');\n\t$('body').addClass('active');\n}","function setChatroom(room) {\n $('#chatroom h1').append(room);\n}","function createRoom(name)\n\t{\n\t\tdocument.getElementsByClassName('dropdown-item selected')[0].className = 'dropdown-item'\n\n\t\tvar room = document.createElement('div')\n\t\troom.className = 'dropdown-item selected'\n\t\troom.innerText = name\n\t\tcreateDropdownClickMethod(room)\n\t\tget('create-room-name').value = ''\n\n\t\tdropdown.appendChild(room)\n\t\tdropdown.className = 'dropdown closed'\n\t}","function setRoom(name) {\r\n $('#createRoom').remove();\r\n $('h1').text(name);\r\n // $('#subTitle').text(name + \" || link: \"+ location.href);\r\n $('body').addClass('active');\r\n}","function addRoom(room){\n $outer.append(Mustache.render(roomTemplate, room));\n }","function populateRoomListView(user) {\n var name = document.getElementById(\"roomName\");\n var desc = document.getElementById(\"roomDesc\");\n var destroydate = document.getElementById(\"roomDest\");\n //var privacy = document.getElementById(\"privacy\");\n name.innerHTML = \"\"+room.Name+\"\";\n desc.innerHTML = room.Description;\n}","function setRoom(name) {\n $('form').remove();\n $('h1').text(name);\n $('#subTitle').text('Link to join: ' + location.href);\n $('body').addClass('active');\n }","function createRoomButton(roomInfo) {\n var header = roomInfo.name.charAt(0);\n\n var id = roomInfo.id;\n var room = `
  • \n \n \n
    \n
    \n
    \n \n ` + header.toUpperCase() + `\n \n
    \n
    \n
    \n
    ` + roomInfo.name + `
    \n

    Hey! there I'm available

    \n
    \n
    \n
    \n
  • `;\n\n return room;\n}","function createRoomElement(room){\n\tvar room_li = \n\t$(document.createElement(\"li\"))\n\t.attr(\"class\",\"\")\n\t.attr(\"room_id\", room.roomID)\n\t.append(\n\t\t\t$(document.createElement(\"a\"))\n\t\t\t.attr(\"data-toggle\", \"tab\")\n\t\t\t.text(room.name + \" (\" + room.userCount + \")\" )\n\t\t\t.click(function (event){\n\t\t\t\t//Pauses message fetching, joins the room\n\t\t\t\tjoinRoom($(event.target).parent().attr(\"room_id\"), true);\n\t\t\t})\n\t);\n\treturn room_li;\n}","room({id, title}) {\n return $('')\n .attr({\n title: id,\n href: '#' + id,\n 'data-room': id,\n })\n .text(title || id)\n .addClass((id == xmpp.room.current) && 'xmpp-room-current');\n }","function writeNameNE() {\n\t\tvar namesp = document.createElement(\"span\");\n\t\tnamesp.setAttribute(\"id\", this.id + \"name\");\n\t\tvar elem = document.getElementById(this.id).appendChild(namesp);\n\t\telem.style.position = \"absolute\";\n\t\tif (this.nameLocation == NAME_UP) {\n\t\t\telem.style.top = 0;\n\t\t\telem.style.paddingTop = \"1px\";\n\t\t} else if (this.nameLocation == NAME_DOWN) {\n\t\t\telem.style.top = this.height - 20;\n\t\t\telem.style.paddingTop = \"7px\";\n\t\t} else if (this.nameLocation == NAME_CENTER) {\n\t\t\telem.style.top = this.height / 2 - 10;\n\t\t\telem.style.paddingTop = \"5px\";\n\t\t}\n\t\telem.style.left = 0;\n\t\telem.style.width = this.width;\n\t\telem.style.height = 20;\n\t\telem.style.zIndex = 7;\n\t\telem.style.cursor = \"move\";\n\t\telem.style.color = this.textColor;\n\t\telem.style.textAlign = \"center\";\n\t\telem.style.fontFamily = \"Arial\";\n\t\telem.style.fontSize = \"10px\";\n\t\telem.innerText = this.name;\n\t\telem.parentObj = this;\n\t}","function generateNewRoom(name) {\n\t\n\t//send the request to the server\n\tvar posting = $.post(roomsURI + \"/add\", {\n\t\tname : name\n\t});\n\t\n\t//Send new room to server\n\tposting.done(function(data) {\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\t//$(\"#chat-rooms-list\").children(\"li[room_id!=2]\").remove(); //remove the last room\n\t\t//$(\"#chat-rooms-list\").append(createRoomElement(room)); //add this in it's place\n\t\t$(\"#chat-rooms-dropdown-list\").append(createRoomElement(room));\n\t\troom_id_list.push(room.roomID);\n\t\tjoinRoom(room.roomID,true);\n\t});\n}","function addUNameToDom(name) {\r\n\tconst paraElement = document.createElement('p')\r\n\tparaElement.innerHTML = 'From user: ' + name\r\n\treturn paraElement\r\n}","function user_name(){\n\t\tvar name = document.createElement(\"div\");\n\t\tname.textContent = \"NAME\";\n\t\tname.setAttribute(\"class\", \"user_name\");\n\t\tdiv.appendChild(name);\n\t}","function createRoomEntry(room) {\n\t\tvar roomHtml = creationRoomWidgetHeader(room.name);\n\t\troomHtml += createImageWidget(room.images);\n\t\troomHtml += createRoomWidgetFooter(room.price);\n\t\t// create room HTML\n\n\n\t\treturn roomHtml;\n\t}","function addPersonToRoom (room_name, id, person_name) {\n \t// we store the person name in the socket session as people of the current room\n\t// e.g. { socket.id: nameOfThePerson }\n \tfor (var i=0; i' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' ');\n roomSelector.find(\".room-book\").hide();\n roomSelector.find(\".room-confirm\").show();\n}","function displayRoom (room) {\n let occupantMsg = ''\n if (room.character === '') {\n occupantMsg = ''\n } else {\n occupantMsg = room.character.describe() + '. '\n }\n\n const textContent = room.describe() +\n '

    ' + '

    ' + occupantMsg + '

    ' + '

    ' + room.getDetails() + '

    '\n\n document.getElementById('textarea').innerHTML = textContent\n document.getElementById('ui').focus()\n}","function displayRoomInfo(room) {\r\n document.body.style.background = room.background;\r\n document.body.style.backgroundSize = `cover`;\r\n document.getElementById(`errors`).style.display = `none`;\r\n document.getElementById(`items`).style.display = `none`;\r\n document.getElementById(`health`).style.display = `none`;\r\n document.getElementById(\r\n `title`\r\n ).innerHTML = `

    ${room.name.toUpperCase()}

    `;\r\n document.getElementById(`location`).innerHTML = room.location();\r\n document.getElementById(`description`).innerHTML = `${room.description}`;\r\n document.getElementById(`directions`).innerHTML = `${room.directions}`;\r\n document.getElementById(`buttonarea`).style.display = `none`;\r\n document.getElementById(`health-area`).style.display = `inline-block`;\r\n document.getElementById(`inventory-area`).style.display = `inline-block`;\r\n document.getElementById(`userinput`).style.display = `inline-block`;\r\n document.getElementById(`usertext`).focus();\r\n}","function appendName(identity, container) {\n const name = document.createElement(\"p\");\n name.id = `participantName-${identity}`;\n name.className = \"instructions\";\n name.textContent = identity;\n container.appendChild(name);\n}","function updateName1OnDOM() {\n db.ref('Names/player1').once('value', function (snapshot) {\n name = snapshot.val();\n if (name !== null) {\n var a = $('

    ').html(name).addClass('center-block');\n $('.player1-name').empty().append(a);\n }\n });\n }","function getNewContactHtml(jid, name) {\n var jid_id = XMPP_client.jid_to_id(jid);\n\n return $(\"
  • \"\n + \"
    \" +\n \"
    \" +\n name +\n \"
    \"\n + \" \"\n + \"
    \" +\n \"
  • \");\n}","function showRoomList(data) {\n\tvar $room = $(data).find(\"room\");\n\n\tvar roomlist = \"\";\n\n\t$room.each(function () {\n\t\troomlist += \"
    \";\n\t});\n\t\n\tif (roomlist == \"\") { roomlist = \"Ei aktiivisia huoneita.\"; }\n\t\n\t$(\"#roomlist\").html(roomlist);\n}","function updateName2OnDOM() {\n db.ref('Names/player2').once('value', function (snapshot) {\n name = snapshot.val();\n if (name !== null) {\n var a = $('

    ').html(name).addClass('center-block');\n $('.player2-name').empty().append(a);\n }\n });\n }","function assignName() {\n var locationNameHolder = scope.querySelectorAll(\"[data-vf-js-location-nearest-name]\");\n if (!locationNameHolder) {\n // exit: container not found\n return;\n }\n if (locationNameHolder.length == 0) {\n // exit: content not found\n return;\n }\n // console.log('assignName','pushing the active location to the dom')\n locationNameHolder[0].innerHTML = locationName;\n }","function buildRoomInfoHtmlBlock() {\n var roomHtml = \"
  • Adults\";\n roomHtml += \"
  • \";\n roomHtml += \"
  • Children\";\n roomHtml += \"
  • \";\n return roomHtml;\n }","function addRoomList(data) {\r\n let room = createElement('li', data);\r\n room.class('rooms');\r\n room.id(data);\r\n rooms.push(room);\r\n roomsName.push(data);\r\n room.parent(\"#activeRooms\");\r\n}","function joinUserRoom(name) {\r\n divHome.hide();\r\n divRoom.show();\r\n socket.emit(\"joinRoom\", name);\r\n currentRoom = name;\r\n}","function createNameNode(newName){\n var nameDiv = document.createElement(\"div\");\n nameDiv.setAttribute(\"class\", \"col-lg-2\");\n //console.log(\"nameDiv: \", nameDiv);\n var nameSpan = document.createElement(\"span\");\n nameSpan.setAttribute(\"class\", \"product-name\");\n nameSpan.innerHTML = newName;\n nameDiv.appendChild(nameSpan);\n \n return nameDiv\n }","function createName(name) {\n const nameElement = createElement({ tagName: 'span', className: 'name' });\n nameElement.innerText = name;\n \n return nameElement;\n }","EnterRoom(id, name, room, img){\n var roomName = {id, name, room, img}; //object disractury \n this.globalRoom.push(roomName);\n return roomName;\n }","function getRoom(){\n\tvar chatName = document.getElementById(\"chatName\");\n\tif(!chatName)\n\t\treturn null;\n\treturn chatName.innerText;\n}","function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}","function makeName(role) {\n\tlet title = getTitle(role);\n\tif (role == \"default\") { role = \"Committee\"; }\n\tlet member = document.createElement(\"p\");\n\tmember.setAttribute(\"style\", \"font-weight: bold\");\n\tlet memberText = document.createTextNode(title);\n\tmember.setAttribute(\"class\", \"member\");\n\tmember.appendChild(memberText);\n\t\n\treturn member;\n}","function create_game_room_card(name, players_in_game, max_players) {\r\n\r\n const card = document.createElement(\"div\");\r\n card.setAttribute('class', 'room-card');\r\n\r\n const room_name = document.createElement(\"h2\");\r\n room_name.innerText = name;\r\n card.appendChild(room_name);\r\n\r\n const ctj_text = document.createElement(\"h5\");\r\n ctj_text.innerText = \"Click to join!\"\r\n card.appendChild(ctj_text);\r\n\r\n const player_in_room = document.createElement(\"p\");\r\n player_in_room.innerText = \"Players: \" + players_in_game + \"/\" + max_players;\r\n player_in_room.setAttribute(\"class\", \"numOfPlayers\");\r\n card.appendChild(player_in_room);\r\n\r\n\r\n card.classList.add(\"room-card\");\r\n\r\n room_card_container.appendChild(card);\r\n\r\n}","function characterName() {\n var characterName = document.getElementById('characterName');\n if (characterName) {\n characterName.innerHTML = userName + ' the ' + avatarClass;\n }\n}","function append(location, name, value) {\n\tdocument.querySelector('.' + location + ' .' + name).innerHTML += value;\n}","function Shopper(shopperName){\n document.getElementById(\"shopperName\").appendChild(document.createTextNode(shopperName))\n}","function add_room(creator, name){\n const room = {creator, name};\n // save room info to room list\n rooms.push(room);\n}","function renderName (name, level, icon) {\n\tconst result = \n\t`\n\t
    \n\t\t

    Player Icon ${name} Level: ${level}

    \n\t
    \n\t`;\n\t$('div.player-name').html(result);\n}","function appendNewDoor(tap) {\n \n appendNewElement(tap, doorstrings, DoorsConfiguration);\n \n \n \n \n \n // var newListItem = createElement(\"div\",{\"id\":\"name\"},tap.Name);\n \n \n /*\n
    \n \n
    \n \n
    \n */\n}","function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}","function enterRoom(name)\n{\n document.getElementById('classSearchResults').style.display = 'none';\n document.getElementById('classSearch').value = '';\n setClassSearchBoxValue(); //reset the search box to say \"Search Classes\"\n name = name.split(' - '); \n pfc.sendRequest('/join ' + name[0]); //name the room {DEP} {Class#} Sec. {Section#}\n}","function addRoom(room) {\n\n // Get a handle to the room list with the new room's information\n //var users = room.users || [];\n //var numUsers = users.length;\n var option = $('');\n\n // Add the new

    \n
    \n
    \n )\n }","render() {\n image(this.g, 0, 0, this.w, this.h);\n }","render() {\n const imgURL = this.props.item.img;\n return (\n
    \n
    \n \n \n {this.state.hasDescription ? (\n this.buildDescriptionSpan()}\n onMouseOut={() => this.removeDescriptionSpan()}\n >\n !\n \n ) : null}\n
    \n
    \n
    \n \n {this.buildTableHeaders()}\n \n \n \n \n \n \n
    \n
    \n );\n }","function render(id, title, imgUrl, height, width, prev, next) {\n var imgContainer = \"
    \";\n document.getElementById(\"container\").innerHTML += imgContainer;\n }","renderImage() {\n\n const imageContainer = document.getElementById(\"image-container\")\n const div = document.createElement('div')\n div.className = 'container-fluid'\n imageContainer.append(div)\n const img = document.createElement('img')\n img.setAttribute('id', 'img')\n img.className = 'img-fluid'\n img.src = `${this.url}`\n\n const p1 = document.createElement('p1')\n p1.setAttribute('id', 'p1')\n\n p1.innerText = `${this.caption}`\n div.append(img, p1)\n\n }","render(){\n return(\n
    \n \"\"\n
    \n )\n }","renderList() { \n \n return this.props.products.map(product => { \n \n return (\n
    \n
    \n
    {product.product_name}
    \n
    {product.description}
    \n
    {product.price}
    \n\n
    \n\n
    \n \n
    \n )\n\n }); \n \n }","render() {\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\n }","function Render(image) {\n selectedImage = image;\n //setup canvas for paper API\n setupPaperCanvas();\n //setup and fill image\n setupPaperImage();\n //setup and fill texts\n setupPaperTexts();\n}","function Product(props){\n return(\n
    \n \n\t
    {props.name}

    {props.amount}
    \n
    \n );\n}","render() {\n return (\n
    \n \n \n \n
    \n );\n }","display() {\n if (this.isDrank === false) {\n //Display\n image(this.image, this.x, this.y, this.size, this.size);\n }\n }","render() {\n\t\treturn (\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t
    Name
    \n\t\t\t\t\t
    {this.props.name}
    \n\t\t\t\t\t
    Brand
    \n\t\t\t\t\t
    {this.props.brand}
    \n\t\t\t\t\t
    Category
    \n\t\t\t\t\t
    {this.props.category}
    \n\t\t\t\t\t
    Price
    \n\t\t\t\t\t
    {this.props.price}
    \n\t\t\t\t\t}>\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\tProduct Link\n\t\t\t
    \n\t\t);\n\t}","render() {\n const { name, price, image_url, id } = this.props.data;\n return (\n \n \n \n {name}\n \n {`Price: ${price}`}\n {this.props.renderQuantity ?\n

    Quantity: {this.props.data.quantity}

    :\n null\n }\n
    \n \n \n
    \n
    \n );\n }","function displayProduct(item){\r\n if(item.id == 1\r\n || item.id == 2 \r\n || item.id == 3\r\n || item.id == 4\r\n || item.id == 5\r\n || item.id == 6){\r\n return `\r\n
    \r\n \r\n \r\n
    \r\n

    ${item.title}

    \r\n
    $${item.price}
    \r\n
    \r\n\r\n

    ${item.text}

    \r\n\r\n
    \r\n
    Rating: ${item.rating} out of 5
    \r\n Reviews (${item.reviews})\r\n
    \r\n
    \r\n `\r\n }\r\n}","render(){\nconst {container,titleConatiner,title,body,productContainer,productImage,productName,productPrice} = styles;\n\n\n//Product Images\n return(\n\n\nTop Products \n\n\n \n\n {this.props.topProducts.map(e => (\n this.gotoDetails(e)} key={e.id} >\n\n \n\n {e.name.toUpperCase()}\n\n {e.price}$\n \n ))}\n\n\n\n\n\n );\n}","render() {\n push();\n translate(this.pos.x + this.xOff, this.pos.y);\n rotate(this.angle);\n imageMode(CENTER);\n image(this.design, 0, 0, this.r, this.r);\n pop();\n }","show() {\n // applyTextTheme\n image(this.image, this.x, this.y, this.width, this.height)\n }","render() {\n return (\n
    \n \n
    \n )\n }","function imageDisplay() {\n var color = imageColor();\n var captionColor = color;\n captionColor = color.replace(/_/g, \" \").replace('solid', '');\n var captionProduct = name.replace('
    ', '&nbsp;');\n var caption = (captionColor+\" \"+captionProduct).replace(/(^|\\s)\\S/g, function(match) {\n return match.toUpperCase();\n });\n var img_source = \"../../images/products/\"+img+color+\".gif\";\n var lightbox_img = \"../../images/products/large/\"+img+color+\".gif\";\n var lightbox_img_back = \"../../images/products/back/large/\"+img+color+\".gif\";\n $('#product_img_front').attr('src', img_source);\n $('#product_img_front_large').attr('src', lightbox_img);\n $('#product_img_back_large').attr('src', lightbox_img_back);\n $('#product_img_front').parent().attr('href', lightbox_img).attr('data-lightbox', img+color).attr('title', caption);\n $('#product_img_back').attr('href', lightbox_img_back).attr('data-lightbox', img+color).attr('title', caption+' (Back)');\n}","renderGallery() {\n\t\tconst {data, container, currentPhoto} = this.props,\n\t\t\timageWrapper = this.createElement('div', 'gallery__general-image'),\n\t\t\timage = this.createElement('img', 'gallery__photo');\n\t\tcontainer.innerText = '';\n\n\t\timageWrapper.append(image);\n\t\tcontainer.append(imageWrapper, this.renderPhotoList());\n\t\tthis.changeGeneralPhoto(currentPhoto);\n\t}","renderImage( img, i ) {\n\t\tconst {\n\t\t\timageFilter,\n\t\t\timages,\n\t\t\tisSave,\n\t\t\tlinkTo,\n\t\t\tlayoutStyle,\n\t\t\tonRemoveImage,\n\t\t\tonSelectImage,\n\t\t\tselectedImage,\n\t\t\tsetImageAttributes,\n\t\t} = this.props;\n\n\t\t/* translators: %1$d is the order number of the image, %2$d is the total number of images. */\n\t\tconst ariaLabel = sprintf(\n\t\t\t__( 'image %1$d of %2$d in gallery', 'jetpack' ),\n\t\t\ti + 1,\n\t\t\timages.length\n\t\t);\n\t\tconst Image = isSave ? GalleryImageSave : GalleryImageEdit;\n\n\t\tconst { src, srcSet } = photonizedImgProps( img, { layoutStyle } );\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}","function updateProductImageHeight() {\n let productImageWidth = $('.product-image').width();\n $('.product-image').css({'height': productImageWidth + 'px'});\n }","render(){\n return (\n
    \n . \n
    \n \n \n
    \n
    \n );\n }","render() {\n return (\n
    \n
    \n

    Products

    \n\n \n
    \n
    \n );\n }","render() {\n return (\n\t\t\n\t\t{this.state.products.map((item, i) => \n\t\t\t\n\t\t\t\t{ item.title }\n\t\t\t\t\n\t\t\t\t $ { item.variants[0].price * 0.75 }\n\t\t\t\t\n \n \n
    \n
    \n { currentImage + 1 } of { images.length }\n
    \n
    {image.title}
    \n
    \n
    \n )\n }","function showProduct() {\n const title = el('products').value;\n const product = products[title];\n if (product) {\n el('title').innerHTML = title;\n el('price').innerHTML = 'Price: ' + currencyFormatter.format(product.price);\n el('image').src = product.image;\n }\n el('quantity-container').style.display = product ? 'block' : 'none';\n}","renderLayout() {\n\t let self = this;\t \n\t let photoListWrapper = document.querySelector('#photos');\t \n imagesLoaded(photoListWrapper, function() { \t \n\t\t\tself.msnry = new Masonry( photoListWrapper, {\n\t\t\t\titemSelector: '.photo'\n\t\t\t}); \n\t\t\t[...document.querySelectorAll('#photos .photo')].forEach(el => el.classList.add('in-view'));\n });\n }","render () {\n let {src, alt, ...props} = this.props;\n src = src?.src || src; // image passed through import will return an object\n return {alt}/\n }","render() {\n return (\n \n );\n }","function Home() {\n return (\n
    \n
    \n \n\n
    \n \n \n
    \n
    \n \n \n
    \n \n\n
    \n \n \n \n
    \n \n\n
    \n \n \n
    \n
    \n \n \n
    \n
    \n
    \n );\n}","render() {\n\n return (\n \n
    \n \n
    \n
    \n );\n }","render() {\n const { products, page, productInfo} = this.state; //desistruturando\n //aonde era this.state.products.map, fica agr apenas products.map, vale o mesmo para os demais\n\n //a key no h2 e passada, pq o react pede que tenha uma key unica pra cada item da iteracao\n return (\n
    \n
    \n

    Sua Lista de Produtos:

    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\n Imagem Novo Produto \n
    \n {//aqui codigo javascript, apos \"=> (\" volta a ser html\n products.map(product => (\n
    \n {product.title}\n

    {product.description}

    \n Acessar\n
    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\n Imagem Editar Produto\n \n
    \n
    \n ))}\n
    \n \n \n
    \n
    \n\n \n )\n }","render() {\n return (\n
    \n
    \n

    Remember All

    \n
    \n {/*
    */}\n {/* \"Goldfish\"; */}\n \n {/* */}\n
    \n //
    \n\n ) }","render() {\r\n return html`\r\n ${SharedStyles}\r\n \r\n\r\n
    \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    ${this.item ? this.item.name : \"\"}
    \r\n
    ${this._computeIngredients(this.item)}
    \r\n
    ${this.item ? this.item.description : \"\"}
    \r\n\r\n
    \r\n
    ${this.item ? this.item.price : \"\"}
    \r\n this._onAddToCartClick(this.item, this.quantity)}\" raised>add to cart\r\n
    \r\n
    \r\n
    \r\n \r\n `;\r\n }","function displayProduct(product) {\n document.getElementById('product').innerHTML = renderHTMLProduct(product, 'single');\n}","render() {\n return(\n \n

    \n {this.props.title}\n

    \n
    \n \"\"\n
    \n

    \n \n
    \n );\n }","render() {\n console.log('rerendering product page');\n return (\n
    \n
    \n
    \n
    &#128296;
    \n
    \n
    \n
    \n
    \n
    \n );\n }","render(){\n\n /*\n * FIXME: get jpegs for product images\n */\n\n return (\n \n \n {this.state.categories.map(function(c, i){\n return (\n \n \n \n {c.name}\n \n \n )\n })}\n \n )\n }","function Product({\n product\n}) {\n var _product$photo, _product$photo$image;\n\n return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().root),\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"img\", {\n // className={classesItemStyles.itemImg}\n src: product === null || product === void 0 ? void 0 : (_product$photo = product.photo) === null || _product$photo === void 0 ? void 0 : (_product$photo$image = _product$photo.image) === null || _product$photo$image === void 0 ? void 0 : _product$photo$image.publicUrlTransformed,\n alt: product.name\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_Title_module_css__WEBPACK_IMPORTED_MODULE_6___default().title),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\n href: `/product/${product.id}`,\n children: product.name\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_PriceTag_module_css__WEBPACK_IMPORTED_MODULE_7___default().priceTag),\n children: (0,_lib_util_formatMoney__WEBPACK_IMPORTED_MODULE_2__.default)(product.price)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: product.description\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().buttonList),\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\n href: {\n pathname: \"update\",\n query: {\n id: product.id\n }\n },\n children: \"Edit\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 9\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_DeleteProduct__WEBPACK_IMPORTED_MODULE_3__.default, {\n id: product.id,\n children: \"Delete\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_AddToCart__WEBPACK_IMPORTED_MODULE_4__.default, {\n id: product.id\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 5\n }, this);\n}","_renderThumbnail($$) {\n let node = this.props.node\n // TODO: Make this work with tables as well\n let contentNode = node.find('graphic')\n let el = $$('div').addClass('se-thumbnail')\n if (contentNode) {\n el.append(\n $$(this.getComponent(contentNode.type), {\n node: contentNode,\n disabled: this.props.disabled\n })\n )\n } else {\n el.append('No thumb')\n }\n return el\n }","display() {\n this.move();\n imageMode(CENTER);\n image(this.axeImg, this.x + bgLeft, this.y, this.w, this.h);\n }","function renderProducts() {\n const promotionalProductsPart = document.querySelector(\".promotion-list\");\n let html = \"\";\n for (const product of productsList) {\n if (product.category === \"promotionalProducts\") {\n html += ``;\n }\n }\n promotionalProductsPart.innerHTML = html;\n}","function render() {\n var state = store.getState()\n document.getElementById('value').innerHTML = state.count.result;\n document.getElementById('value2').innerHTML = state.sum;\n\n if(state.count.loading){\n document.getElementById('status').innerHTML = \"is loading...\";\n }else{\n document.getElementById('status').innerHTML = \"loaded\";\n }\n // image\n document.getElementById('imagesStatus').innerHTML = state.images.loading;\n if(state.images.loading ==\"loading…\"){\n $('#imagesList').text(\"\");\n }\n else if(state.images.loading ==\"loaded\"){\n for(var i=0; i< state.images.data.length; i++){\n $('#imagesList').append(\n \"\");\n }\n }\n\n}","render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_background = {\n width: '100%',\n height: '100%',\n };\n const style_background_outer = {\n backgroundColor: '#f6f6f6',\n pointerEvents: 'none',\n };\n const style_image = {\n backgroundImage: 'url('+img_elImage+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_image2 = {\n backgroundImage: 'url('+img_elImage2+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n };\n const style_image2_outer = {\n pointerEvents: 'none',\n };\n \n return (\n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n )\n }","function printProducts(){\n for (var i = 0; i <= products.length; i++){ \n if (i < products.length-1){\n var clone = productDiv.cloneNode(true);\n productDiv.parentNode.insertBefore(clone, productDiv);\n };\n productDiv.style.display = \"block\";\n productName.innerHTML = products[i].name;\n productDescription.innerHTML = products[i].description;\n price.innerHTML = products[i].price;\n image.setAttribute(\"src\", products[i].url); \n \n }\n \n }","render() {\n\n return (\n
    \n \n
    \n );\n }","render() {\n console.log(\"Rendering ArtBlock...\");\n let paintings = this.state.paintings;\n const ArtBlocks = [];\n for (var i = 0; i < paintings.length; i++) {\n ArtBlocks.push(\n {Paintings[i].name}\n\n )\n }\n return (\n
    \n
    Score: {this.state.currentScore} | High Score: {this.state.highScore}
    \n
    \n {Modal}\n
    \n
    \n {ArtBlocks}\n
    \n
    \n )\n }","function renderGallery(image) {\n let gallery = document.getElementById('gallery');\n if (gallery != null)\n updateGallery(gallery, image);\n else\n createGallery(image);\n }","renderProduct(product) {\n return (
    \n {product.name}\n
    );\n }","function render() {\n\n\t\t\t}","function renderImg() \n{\n leftIndex = randomImage();\n midIndex = randomImage();\n rightIndex = randomImage();\n\n randControl();\n while (leftIndex === rightIndex || leftIndex === midIndex) \n {\n leftIndex = randomImage();\n }\n while(rightIndex === midIndex)\n {\n rightIndex = randomImage();\n }\n randControl();\n usedImg.splice(0, usedImg.length);\n\n leftImg.setAttribute('src', products[leftIndex].productImg);\n midImg.setAttribute('src', products[midIndex].productImg);\n rightImg.setAttribute('src', products[rightIndex].productImg);\n products[leftIndex].views++;\n products[midIndex].views++;\n products[rightIndex].views++;\n\n usedImg.push(leftIndex);\n usedImg.push(midIndex);\n usedImg.push(rightIndex);\n}","render () {\n return (\n
    \n
    \n \n
    \n
    \n this.onSearchSubmit(term)}/>\n \n
    \n
    \n );\n }","function ItemImage(props) {\n return \n}"],"string":"[\n \"function renderProduct() {\\n logger.info('renderProduct start');\\n var imageGroups = currentProduct.getHeroImageGroups();\\n var altImagesInfo = [],\\n imageViews = [];\\n\\n currentProduct.ensureImagesLoaded('altImages').done(function() {\\n var imageGroup,\\n imageGroupImages,\\n image,\\n imageContainer,\\n variationValue,\\n valuePrefix,\\n altContainer,\\n altImages,\\n commonNumber,\\n smallImage,\\n counter = -1,\\n imageGroupsLength = imageGroups ? imageGroups.length : 0;\\n\\n if (imageGroupsLength == 0) {\\n logger.error('product/components/images: heroImage group empty for product id ' + currentProduct.getId());\\n }\\n\\n for (var i = 0, ii = imageGroupsLength; i < ii; i++) {\\n // make the first large image visible\\n imageGroup = imageGroups[i];\\n\\n variationValue = determineImageVariationValue(imageGroup);\\n valuePrefix = variationValue || 'default';\\n\\n // If there a bunch of colors ... then skip the first one\\n if (ii > 1 && !variationValue) {\\n continue;\\n }\\n counter++;\\n imageGroupImages = imageGroup.getImages();\\n image = imageGroupImages[0].getLink();\\n\\n imageContainer = Alloy.createController('product/images/imageContainer');\\n\\n imageContainer.init(valuePrefix, image);\\n imageContainer.number = counter;\\n\\n altContainer = imageContainer.getAltContainer();\\n\\n altImages = currentProduct.getAltImages(valuePrefix);\\n commonNumber = imageGroupImages.length > altImages.length ? altImages.length : imageGroupImages.length;\\n // create the small images to put in the alternate view\\n for (var j = 0; j < commonNumber; j++) {\\n smallImage = Alloy.createController('product/images/alternateImage');\\n smallImagesControllers.push(smallImage);\\n\\n smallImage.init({\\n largeImageView : imageContainer.getLargeImageView(),\\n largeImage : imageGroupImages[j].getLink(),\\n image : altImages[j].getLink(),\\n altImageNumber : j,\\n imageContainerNumber : imageContainer.number\\n });\\n altContainer.add(smallImage.getView());\\n\\n smallImagesViews.push(smallImage.getView());\\n\\n }\\n\\n addVideos({\\n videoURL : 'http://assets.appcelerator.com.s3.amazonaws.com/video/media.m4v',\\n imageContainerNumber : imageContainer.number,\\n altImageNumber : commonNumber,\\n videoPlayer : imageContainer.getVideoPlayer(),\\n altContainer : altContainer\\n\\n });\\n\\n _.each(smallImagesViews, function(view) {\\n view.addEventListener('alt_image_selected', altImageSelectedEventHandler);\\n });\\n\\n imageViews.push(imageContainer.getView());\\n $.pdp_image_scroller[COLOR_CONTAINER_ID_PREFIX + valuePrefix] = imageContainer.getColorContainer();\\n imageContainers[counter] = imageContainer;\\n imageContainer.selectedImage = 0;\\n }\\n $.pdp_image_scroller.setViews(imageViews);\\n });\\n\\n logger.info('renderProduct end');\\n}\",\n \"function renderTheProducts() {\\n leftProduct.renderProduct(leftProductImgElem, leftProductH2Elem);\\n centerProduct.renderProduct(centerProductImgElem, centerProductH2Elem); \\n rightProduct.renderProduct(rightProductImgElem, rightProductH2Elem); \\n}\",\n \"function display() {\\n var content = this.getContent();\\n var root = Freemix.getTemplate(\\\"thumbnail-view-template\\\");\\n\\n content.empty();\\n content.append(root);\\n this._setupViewForm();\\n this._setupLabelEditor();\\n\\n var images = Freemix.property.getPropertiesWithType(\\\"image\\\");\\n\\n var image = content.find(\\\"#image_property\\\");\\n\\n // Set up image property selector\\n this._setupPropertySelect(image, \\\"image\\\", images);\\n this._setupTitlePropertyEditor();\\n this._setupMultiPropertySortEditor();\\n\\n image.change();\\n }\",\n \"render() {\\n\\n if(this.state.isLoaded == true){\\n console.log(\\\"----------- Rendering product in ProductDetails.Render()---------\\\"+ this.state.product.product_Id);\\n console.log(\\\"************ 4.0 started ProductDetails.Render() method gets called ****************\\\");\\n var imgBasUrl = \\\"https://s3.amazonaws.com/instadelibucket/\\\";\\n let productV = this.state.product;\\n var that = this; \\n //let productImages = this.state.product.productImagesSet;\\n var count = 0;\\n return (\\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n {/* This div is responsible for products extra images */} \\n
    \\n
    \\n
    \\n
      \\n
    • \\n
      \\n
      this.displayImage(imgBasUrl + this.state.product.imageUrl)} \\n onMouseOver={() => this.displayImage(imgBasUrl + this.state.product.imageUrl)}>\\n
      \\n
      \\n
    • \\n {this.state.product.productImagesSet.map((productOthImages,index) =>\\n
    • \\n
      \\n
      that.displayImage(imgBasUrl + productOthImages.productImageUrl)} \\n onMouseOver={() => that.displayImage(imgBasUrl + productOthImages.productImageUrl)} >
      \\n
      \\n
    • )}\\n
    \\n
    \\n
    \\n \\n \\n \\n \\n
    \\n
    \\n \\n \\n \\n \\n
    \\n
    \\n
    \\n {/* This div is responsible to show selected product image */}\\n
    \\n
    \\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n \\n \\n \\n
    \\n
    \\n
    \\n
    \\n {/*This div is responsible for product details */}\\n
    \\n
    \\n
    \\n
    \\n

    \\n {this.state.product.name}\\n

    \\n
    \\n

    \\n
    \\n {this.state.product.cost}\\n
    \\n \\n \\n
    \\n
    \\n {/*This div is responsible for product Variants */} \\n \\n {that.state.variantKeys.length > 0 && \\n
    \\n {that.state.product.variantKeys.map((variantKey,index) => \\n \\n (function() {\\n count = count + 1;\\n switch(variantKey) {\\n case 'Color': return ;break;\\n // case 'Size': return ;break;\\n //case 'Material': return ;break;\\n default: return

    {variantKey}

    ;break;\\n }\\n })())\\n \\n }\\n
    \\n \\n \\n }\\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n );\\n }else{\\n return null;\\n }\\n \\n \\n }\",\n \"render() {\\n return (\\n
    \\n
    \\n {/*

    {title}

    */}\\n

    Chosen Product:

    \\n {/* */}\\n
    \\n \\n \\n \\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n image(this.image, this.x, this.y, this.width, this.height);\\n }\",\n \"render () {\\r\\n\\t\\tconst { description, urls } = this.props.image;\\r\\n\\r\\n\\t\\treturn (\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t);\\r\\n\\t}\",\n \"function renderProductPage (productId) {\\n if (!productId) {\\n return false;\\n }\\n\\n return client.entries({\\n content_type: ContentTypes.Product,\\n 'sys.id': productId\\n }).then(function (products) {\\n var product = products[0];\\n if (!product) {\\n return false;\\n }\\n product.allImages = [product.fields.mainImage, product.fields.hoverImage].concat(product.fields.images).filter(Boolean);\\n return Templates.ProductPage(product);\\n });\\n }\",\n \"function render(){\\n leftEl.src = Product.allProducts[randomLeft].filepath; //current\\n leftEl.alt = Product.allProducts[randomLeft].name;\\n\\n centerEl.src = Product.allProducts[randomCenter].filepath;\\n centerEl.alt = Product.allProducts[randomCenter].name;\\n\\n rightEl.src = Product.allProducts[randomRight].filepath;\\n rightEl.alt = Product.allProducts[randomRight].name;\\n\\n //increment the number of times each image was shown\\n Product.allProducts[randomLeft].timesDisplayed += 1;\\n Product.allProducts[randomCenter].timesDisplayed += 1;\\n Product.allProducts[randomRight].timesDisplayed += 1;\\n\\n //keep track of these as the previously displayed products\\n Product.lastDisplayed[0] = randomLeft;\\n Product.lastDisplayed[1] = randomCenter;\\n Product.lastDisplayed[2] = randomRight;\\n}\",\n \"function renderProducts(productsArray) {\\n\\tproductsArray.forEach((product) => {\\n\\n\\t\\tconst newProduct = document.createElement(\\\"div\\\");\\n\\t\\tnewProduct.classList.add(\\\"productsContainer\\\");\\n\\t\\t\\n\\t\\tconst link = getProductLink(product);\\n\\n\\t\\tconst img = getProductImg(product);\\n\\n\\t\\tconst description = getProductDescription(product);\\n\\n\\t\\tlink.appendChild(img);\\n\\t\\tlink.appendChild(description);\\n newProduct.appendChild(link);\\n\\t\\t\\n\\t\\t\\n\\t document.getElementById('productsMainContainer').appendChild(newProduct);\\n\\t});\\n}\",\n \"function renderProduct(product) {\\n var images = document.getElementById('images');\\n var imgEl = document.createElement('img');\\n\\n var att = document.createAttribute('id');\\n att.value = product.name;\\n imgEl.setAttributeNode(att); // W3Schools\\n\\n imgEl.src = product.filepath;\\n images.appendChild(imgEl);\\n\\n imgEl.addEventListener('click', clickEvent);\\n}\",\n \"render() {\\n if (!this.props.product) {\\n return
    Select a product to view profile.
    ;\\n }\\n\\n return (\\n
    \\n\\n
    Product details
    \\n {/* Field name */}\\n \\n \\n \\n \\n \\n {this.props.product.name}\\n \\n \\n\\n {/* Field color */}\\n \\n \\n :\\n \\n \\n {this.props.product.color}\\n \\n \\n \\n {/* Field price */}\\n \\n \\n :\\n \\n \\n {this.props.product.price}\\n \\n \\n\\n {/* Field category */}\\n \\n \\n :\\n \\n \\n {this.props.product.category}\\n \\n \\n\\n {/* Field Image field */}\\n \\n \\n :\\n \\n \\n
    \\n \\n
    \\n
    \\n
    \\n {/* Field description */}\\n \\n \\n :\\n \\n \\n

    {this.props.product.description}

    \\n
    \\n
    \\n\\n
    \\n );\\n }\",\n \"function Products(props) {\\n return (\\n
    \\n
    \\n
    \\n
    \\n
    { props.brand }
    \\n
    \\n
    {props.category}: { props.productName }
    \\n
    Ingredients: \\n {props.ingredients}\\n
    \\n
    {props.description}
    \\n
    \\n
    \\n
    \\n placeholder\\n
    \\n
    \\n
    \\n
    \\n );\\n}\",\n \"function ProductManagementImage(_ref) {\\n var size = _ref.size;\\n\\n var widths = {\\n 1: 300,\\n 2: 200,\\n 3: 150\\n };\\n return _react2.default.createElement(_Image2.default, { src: _catalogue_image2.default, width: '100%' });\\n}\",\n \"function Product(props) {\\n return (\\n
    \\n
      \\n
    • \\n \\n

      {props.product.name}

      \\n

      Price: {props.product.price}

      \\n

      Product description: {props.product.productDescription}

      \\n
    • \\n
    \\n
    \\n )\\n}\",\n \"render() {\\n\\t\\treturn (\\n\\t\\t\\t\\n\\t\\t);\\n\\t}\",\n \"function renderProducts(productName, productId, productImg, productPrice) {\\r\\n const products = document.getElementById('cameras');\\r\\n const article = document.createElement('article'); // Récupère la div qui contiendra les différents articles\\r\\n article.classList.add('product-general');\\r\\n article.innerHTML = `\\r\\n \\\"${productName}\\\"\\r\\n

    ${productName}

    \\r\\n

    ${productPrice / 100}€

    \\r\\n Développez-moi
    \\r\\n `;\\r\\n\\r\\n products.append(article);\\r\\n}\",\n \"render() {\\n\\t\\tconst product = this.props.product;\\n\\n\\t\\treturn (\\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t{ this.state.clicked ? __( 'Added' ) : product.name }\\n\\t\\t\\t\\t\\n\\t\\t\\t
    \\n\\t\\t);\\n\\t}\",\n \"render(listProducts) {\\n for (const product of listProducts) {\\n const divProduct = document.createElement('div');\\n divProduct.classList.add('product');\\n divProduct.setAttribute('id', product.id);\\n\\n const image = document.createElement('img');\\n image.classList.add('product-image');\\n image.src = product.image;\\n image.setAttribute('alt', product.name);\\n divProduct.append(image);\\n\\n const title = document.createElement('span');\\n title.classList.add('product-title');\\n title.innerText = product.name;\\n divProduct.append(title);\\n\\n const price = document.createElement('span');\\n price.classList.add('product-price');\\n price.innerText = `$ ${product.price}`;\\n divProduct.append(price);\\n\\n this.containerProducts.append(divProduct);\\n }\\n }\",\n \"function ibpsRenderProduct(index) {\\n\\t// Check to make our index is within actual data range\\n\\tif ((index < 0) || (index > (_ibpsProductCount - 1))) {\\n\\t\\talert (\\\"Invalid product index: ibpsRenderProduct(\\\" + index + \\\")\\\");\\n\\t}\\n\\t\\n\\t// Get the values needed to display\\n\\tvar productImage = _ibpsData[index].image1;\\n\\tvar productName = _ibpsData[index].name;\\n\\tvar productURL = _ibpsData[index].product_url;\\n\\tvar companyName = _ibpsData[index].company_name;\\n\\t\\n\\t// Erase current product\\n\\t$('div.ibps-product').empty();\\n\\t\\n\\t// Convert data to HTML and display it in the product div\\n\\t$('div.ibps-product').append(\\n\\t\\t' ' +\\n\\t\\t' ' +\\n\\t\\t' ' +\\n\\t\\t' ' + productName + '
    ' + \\n\\t\\t' ' + companyName + ''\\n\\t);\\n}\",\n \"render() {\\n\\t\\tconst product = this.props.product;\\n\\t\\t//let icon = this.props.selected ? : null;\\n//\\t{ icon }\\n\\t\\treturn (\\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t{ product.name }\\n\\t\\t\\t
    \\n\\t\\t);\\n\\t}\",\n \"function Home() {\\n return (\\n
    \\n {/**Image */}\\n \\\"Cover\\n {/**Products */}\\n
    \\n \\n \\n
    \\n
    \\n\\n )\\n}\",\n \"render() {\\n return (\\n
    \\n \\n \\n
    {this.props.price}
    \\n \\n
    \\n )\\n }\",\n \"render () {\\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\\n }\",\n \"function Product(props){\\r\\n\\r\\n return (\\r\\n
    \\r\\n
    \\r\\n \\t
    \\r\\n \\t\\t\\\"\\\"\\r\\n \\t\\t
    \\r\\n \\t\\t\\t

    \\r\\n\\t\\t\\t\\t{props.children}\\r\\n\\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t\\t{props.price} VNĐ\\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t\\tAction\\r\\n \\t\\t\\t\\tAction\\r\\n \\t\\t\\t

    \\r\\n \\t\\t
    \\r\\n \\t
    \\r\\n
    \\r\\n
    \\r\\n );\\r\\n}\",\n \"render() {\\n return (\\n
    \\n
    \\n
    \\n \\\"Placeholder\\n
    \\n
    \\n
    \\n

    {this.props.product.name}

    \\n\\n
    \\n {this.props.product.short_description}\\n

    \\n
    \\n \\n More Details\\n \\n
    \\n
    \\n )\\n }\",\n \"render() {\\n let { url, selectColor, selected, mouseEnter, mouseOut } = this.props;\\n return (\\n \\n
    \\n {/*

    {addCross ? \\\"Cross\\\" : null }

    */}\\n {/* \\\"glases\\\" */}\\n \\\"glasses\\\"\\n\\n
    \\n
    \\n\\n\\n );\\n }\",\n \"display() {\\n push();\\n // Centering image for easier image placement\\n imageMode(CENTER);\\n image(this.image, this.x, this.y, 1500, 300);\\n pop();\\n }\",\n \"function displayImage() {\\n let image = document.createElement('img');\\n image.setAttribute(\\\"src\\\", product.imageUrl);\\n image.setAttribute(\\\"alt\\\", product.name);\\n image.classList.add(\\\"img-thumbnail\\\",\\\"border-dark\\\");\\n imageContainer.appendChild(image);\\n}\",\n \"render() {\\n return(\\n
    \\n
    \\n
    \\n

    All Products

    \\n
    \\n
    \\n
    \\n
    \\n
      \\n { this.renderProducts() }\\n
    \\n
    \\n
    \\n \\n
    \\n \\n
    \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\\n }\",\n \"function renderImages() {\\n //if ( viewSkins ) { renderSkins(); } // disabled here so plants can be rendered sequentially in plants.js\\n if ( viewSpans ) { renderSpans(); }\\n if ( viewPoints ) { renderPoints(); }\\n if ( viewScaffolding ) { renderScaffolding(); }\\n}\",\n \"function buildMyProduct(myProduct) {\\n var html = \\\"\\\";\\n html += \\\"
    \\\";\\n html += \\\"

    \\\" + myProduct.title + \\\"

    \\\";\\n html += \\\"
    \\\";\\n html += \\\"
    \\\" + myProduct.price +\\\"
    \\\"+ myProduct.model +\\\"
    \\\"+ \\\"
    \\\"+\\\"
    \\\"+myProduct.description + \\\"
    \\\";\\n html += \\\"
    \\\";\\n html += \\\"
    \\\";\\n $.each(myProduct.ProductImage, function (element, obj) {\\n html += \\\"\\\";\\n });\\n html += \\\"
    \\\";\\n\\n\\n\\n $(\\\"#MyDynamicProductDetail\\\").append(html);\\n}\",\n \"function logoLayout() {\\n layout('logo');\\n next();\\n}\",\n \"render() {\\n const productData = this.props.productData;\\n // const productInfo = productData['prod_serial'];\\n const imageData = productData['image_data'];\\n const prod_hash = imageData.prod_id;\\n const key = prod_hash + Math.floor(Math.random() * 1000);\\n const shop = imageData.shop;\\n const brand = imageData.brand;\\n const img_url = imageData.img_url;\\n const name = imageData.name;\\n const prod_url = imageData.prod_url;\\n const currency = '£';\\n const price = imageData.price.toFixed(2);\\n const sale = imageData.sale;\\n const saleprice = imageData.saleprice;\\n const fst_img_hash = imageData.img_hash;\\n const fst_img_color = imageData.color_1;\\n\\n const ImageCarousel = () => {\\n return (\\n \\n (\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'open outfit',\\n label: prod_hash\\n });\\n history.push(`/outfit-page?id=${prod_hash}&sex=${imageData.sex}`)\\n }}\\n />\\n
    \\n )}/>\\n
    \\n )\\n };\\n\\n const ColorPicker = () => {\\n let image = imageData;\\n let color_1 = image['color_1'];\\n let color_2 = image['color_2'];\\n let color_3 = image['color_3'];\\n let color_1_hex = image['color_1_hex'];\\n let color_2_hex = image['color_2_hex'];\\n let color_3_hex = image['color_3_hex'];\\n let img_hash = image['img_hash'];\\n\\n // Dynamic CSS for image color choice modal\\n if(color_1_hex.length > 0){\\n var colorStyle1 = {\\n width: '42px',\\n height: '42px',\\n borderRadius: '21px',\\n backgroundColor: color_1_hex,\\n margin: '2px',\\n marginRight: '0px',\\n display: 'inline-block',\\n cursor: 'pointer'\\n };\\n var colorStyle2 = {\\n width: '42px',\\n height: '42px',\\n borderRadius: '21px',\\n backgroundColor: color_2_hex,\\n margin: '2px',\\n marginRight: '0px',\\n display: 'inline-block',\\n cursor: 'pointer'\\n };\\n var colorStyle3 = {\\n width: '42px',\\n height: '42px',\\n borderRadius: '21px',\\n backgroundColor: color_3_hex,\\n margin: '2px',\\n marginRight: '0px',\\n display: 'inline-block',\\n cursor: 'pointer'\\n };\\n }\\n let rgbSum = eval(image['color_1'].join('+'));\\n var pickerBgUrl;\\n\\n if (rgbSum > 400) {\\n pickerBgUrl = 'url(\\\"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzIwMCcgIGZpbGw9IiMw'\\n + 'MDAwMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3Jn'\\n + 'LzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBzdHlsZT0i'\\n + 'ZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDAgMTAwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTk0Ljks'\\n + 'MTcuNmMtMC44LTUuNy00LTguNi02LjYtMTAuNWMtMi45LTIuMS02LjYtMi42LTkuOS0xLjNjLTMuNSwxLjMtNiwzLjktOC42L'\\n + 'DYuNWMtMywzLjItNi4yLDYuMi05LjMsOS4zICBjLTMuMS0yLTQuOC0xLjgtNy4zLDAuNmMtMS41LDEuNS0zLDIuOS00LjQsN'\\n + 'C40Yy0xLjUsMS42LTEuNyw0LjItMC4yLDUuOGMwLjcsMC44LDEuNywxLjMsMi43LDJjLTEuMSwwLjktMS42LDEuMy0yLDEuN'\\n + 'yAgQzM4LDQ3LjQsMjYuNiw1OC44LDE1LjIsNzAuMWMtMi42LDIuNi00LjcsNS40LTUuNyw5LjFjLTAuNSwyLTEuNywzLjktM'\\n + 'i44LDUuNmMtMC4yLDAuMy0wLjQsMC41LTAuNiwwLjhjLTEuNywyLjMtMS42LDUuNCwwLjQsNy40ICBjMC4xLDAuMSwwLjIsM'\\n + 'C4yLDAuMiwwLjJjMiwyLDUsMi4xLDcuMywwLjVjMCwwLDAsMCwwLjEsMGMxLjctMS4yLDMuMy0yLjgsNS4yLTMuMWM0LjItM'\\n + 'C45LDcuNS0zLDEwLjQtNkM0MS4zLDczLjQsNTIuNiw2Miw2NCw1MC43ICBjMC41LTAuNSwxLTAuOSwxLjgtMS43YzAuNSwwL'\\n + 'jcsMC44LDEuMywxLjMsMS44YzIuMiwyLjMsNC42LDIuMiw2LjksMGMxLjItMS4yLDIuNC0yLjQsMy42LTMuNmMyLjktMi45L'\\n + 'DMuNy00LjMsMS4xLTcuOCAgYzIuNC0yLjQsNC44LTQuNyw3LjItNy4xYzMuMy0zLjQsNy4yLTYuMyw4LjctMTEuMUM5NSwyM'\\n + 'Cw5NS4xLDE4LjgsOTQuOSwxNy42eiBNNjEuNiw0Ny4yQzQ5LjksNTguOSwzOC4yLDcwLjYsMjYuNSw4Mi4yICBjLTIuMiwyL'\\n + 'jItNC43LDMuNi03LjcsNC40Yy0yLjMsMC42LTQuMywyLjItNi40LDMuM2MtMC4yLDAuMS0wLjQsMC4zLTAuNiwwLjRjLTAuN'\\n + 'iwwLjUtMS41LDAuNC0yLTAuMWMwLDAsMCwwLDAsMCAgYy0wLjUtMC42LTAuNi0xLjQtMC4xLTJjMC43LTAuOSwxLjQtMS44L'\\n + 'DItMi43YzAuOC0xLjMsMS41LTIuOCwxLjgtNC4zYzAuNi0yLjksMS45LTUuMywzLjktNy4zYzEyLjEtMTIuMSwyNC4yLTI0L'\\n + 'jIsMzYuMS0zNi4xICBjMi45LDIuOCw1LjcsNS43LDguNyw4LjdDNjIuMiw0Ni41LDYxLjksNDYuOSw2MS42LDQ3LjJ6Ij48L'\\n + '3BhdGg+PC9zdmc+\\\")';\\n } else {\\n pickerBgUrl = 'url(\\\"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzIwMCcgIGZpbGw9IiNmZ'\\n + 'mZmZmYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnL'\\n + 'zE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBzdHlsZT0iZ'\\n + 'W5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDAgMTAwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTk0LjksM'\\n + 'TcuNmMtMC44LTUuNy00LTguNi02LjYtMTAuNWMtMi45LTIuMS02LjYtMi42LTkuOS0xLjNjLTMuNSwxLjMtNiwzLjktOC42L'\\n + 'DYuNWMtMywzLjItNi4yLDYuMi05LjMsOS4zICBjLTMuMS0yLTQuOC0xLjgtNy4zLDAuNmMtMS41LDEuNS0zLDIuOS00LjQsN'\\n + 'C40Yy0xLjUsMS42LTEuNyw0LjItMC4yLDUuOGMwLjcsMC44LDEuNywxLjMsMi43LDJjLTEuMSwwLjktMS42LDEuMy0yLDEuN'\\n + 'yAgQzM4LDQ3LjQsMjYuNiw1OC44LDE1LjIsNzAuMWMtMi42LDIuNi00LjcsNS40LTUuNyw5LjFjLTAuNSwyLTEuNywzLjktM'\\n + 'i44LDUuNmMtMC4yLDAuMy0wLjQsMC41LTAuNiwwLjhjLTEuNywyLjMtMS42LDUuNCwwLjQsNy40ICBjMC4xLDAuMSwwLjIsM'\\n + 'C4yLDAuMiwwLjJjMiwyLDUsMi4xLDcuMywwLjVjMCwwLDAsMCwwLjEsMGMxLjctMS4yLDMuMy0yLjgsNS4yLTMuMWM0LjItM'\\n + 'C45LDcuNS0zLDEwLjQtNkM0MS4zLDczLjQsNTIuNiw2Miw2NCw1MC43ICBjMC41LTAuNSwxLTAuOSwxLjgtMS43YzAuNSwwL'\\n + 'jcsMC44LDEuMywxLjMsMS44YzIuMiwyLjMsNC42LDIuMiw2LjksMGMxLjItMS4yLDIuNC0yLjQsMy42LTMuNmMyLjktMi45L'\\n + 'DMuNy00LjMsMS4xLTcuOCAgYzIuNC0yLjQsNC44LTQuNyw3LjItNy4xYzMuMy0zLjQsNy4yLTYuMyw4LjctMTEuMUM5NSwyM'\\n + 'Cw5NS4xLDE4LjgsOTQuOSwxNy42eiBNNjEuNiw0Ny4yQzQ5LjksNTguOSwzOC4yLDcwLjYsMjYuNSw4Mi4yICBjLTIuMiwyL'\\n + 'jItNC43LDMuNi03LjcsNC40Yy0yLjMsMC42LTQuMywyLjItNi40LDMuM2MtMC4yLDAuMS0wLjQsMC4zLTAuNiwwLjRjLTAuN'\\n + 'iwwLjUtMS41LDAuNC0yLTAuMWMwLDAsMCwwLDAsMCAgYy0wLjUtMC42LTAuNi0xLjQtMC4xLTJjMC43LTAuOSwxLjQtMS44L'\\n + 'DItMi43YzAuOC0xLjMsMS41LTIuOCwxLjgtNC4zYzAuNi0yLjksMS45LTUuMywzLjktNy4zYzEyLjEtMTIuMSwyNC4yLTI0L'\\n + 'jIsMzYuMS0zNi4xICBjMi45LDIuOCw1LjcsNS43LDguNyw4LjdDNjIuMiw0Ni41LDYxLjksNDYuOSw2MS42LDQ3LjJ6Ij48L'\\n + '3BhdGg+PC9zdmc+\\\")';\\n }\\n\\n let pickerStyle = {\\n width: '46px',\\n height: '46px',\\n backgroundColor: color_1_hex,\\n backgroundImage: pickerBgUrl,\\n backgroundRepeat: 'no-repeat',\\n backgroundPosition: 'center',\\n backgroundSize: '28px 28px',\\n borderRadius: '23px',\\n position: 'absolute',\\n right: '113px',\\n cursor: 'pointer'\\n };\\n\\n var pickerDrawerHeight;\\n\\n if (this.state.pickerExpanded === img_hash){\\n pickerDrawerHeight = '190px';\\n } else {\\n pickerDrawerHeight = '44px';\\n }\\n\\n let pickerDrawerStyle = {\\n width: '46px',\\n transition: 'width 300ms ease-in-out',\\n height: pickerDrawerHeight,\\n borderRadius: '23px',\\n backgroundColor: '#FFFFFF',\\n bottom: '5px',\\n right: '113px',\\n position: 'absolute',\\n textAlign: 'left',\\n overflow: 'hidden'\\n };\\n\\n return (\\n
    \\n
    \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar color',\\n label: `img_hash: ${img_hash}, color: ${color_1}`\\n });\\n this.setColorPosTags({'color_rgb': color_1, 'cat':''});\\n this.searchSimilarImages(img_hash, color_1);\\n }} />\\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar color',\\n label: `img_hash: ${img_hash}, color: ${color_2}`\\n });\\n this.setColorPosTags({'color_rgb': color_2, 'cat':''});\\n this.searchSimilarImages(img_hash, color_2);\\n }} />\\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar color',\\n label: `img_hash: ${img_hash}, color: ${color_3}`\\n });\\n this.setColorPosTags({'color_rgb': color_3, 'cat':''});\\n this.searchSimilarImages(img_hash, color_3);\\n }} />\\n
    \\n \\n {this.expandDrawer(img_hash, this.state.pickerExpanded);}}\\n />\\n \\n
    \\n )\\n };\\n\\n const ExploreOptions = () => {\\n let exploreOptsStyle = {\\n position: this.state.device === 'desktop' ? 'absolute' : 'fixed',\\n height: '55px',\\n width: '215px',\\n zIndex: '10',\\n backgroundColor: this.state.device === 'mobile' ? '#FFFFFF' : 'rgba(255,255,255,0.7)',\\n paddingTop: '5px'\\n };\\n if (this.state.device === 'desktop') {\\n exploreOptsStyle['bottom'] = '0';\\n exploreOptsStyle['right'] = '0';\\n exploreOptsStyle['borderRadius'] = '27px 0px 0px 0px';\\n } else {\\n const bottom = document.getElementById(prod_hash).getBoundingClientRect().bottom;\\n exploreOptsStyle['top'] = `${bottom - 35}px`;\\n exploreOptsStyle['left'] = 'calc((100vw - 215px) / 2)';\\n exploreOptsStyle['boxShadow'] = '0px 0px 5px 0 rgba(0, 0, 0, 0.6)';\\n exploreOptsStyle['borderRadius'] = '27px';\\n }\\n\\n return (\\n \\n\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar',\\n label: fst_img_hash\\n });\\n this.setColorPosTags({'color_rgb': fst_img_color, 'cat':''});\\n this.searchSimilarImages(fst_img_hash, fst_img_color);\\n }}\\n />\\n \\n \\n \\n \\n {/**/}\\n {(this.state.isAuth === \\\"true\\\") ? (\\n \\n
    {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'add outfit',\\n label: fst_img_hash\\n });\\n this.props.showLookList(fst_img_hash);\\n }} />\\n \\n ) : (\\n (\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'add outfit',\\n label: fst_img_hash\\n });\\n history.push(`/register-from-result?id=${fst_img_hash}`);\\n }}\\n />\\n \\n )}/>\\n )}\\n \\n
    {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'buy now',\\n label: prod_url\\n });\\n this.buyNow(prod_url);\\n }}/>\\n \\n
    \\n )\\n };\\n\\n const CardTagList = () => {\\n const prodTagList = imageData['all_cats'].filter(this.getUniqueArr).map(cat => {\\n return (\\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'set tag',\\n label: cat\\n });\\n this.props.setPosNegButtonTag(cat);\\n }}\\n >\\n {cat}\\n
    \\n )\\n });\\n return (\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'set brand',\\n label: brand\\n });\\n this.props.addBrandFilter(brand, false);\\n }}\\n >\\n {brand}\\n
    \\n {prodTagList}\\n
    \\n\\n )\\n };\\n\\n const priceStyle = sale ? {\\n textDecoration: 'line-through',\\n fontWeight: 'bold',\\n display: 'inline-block'\\n } : {\\n textDecoration: 'none',\\n fontWeight: 'bold',\\n };\\n\\n return (\\n \\n \\n \\n {(this.state.showExplore || this.state.device === 'desktop') && (\\n \\n )}\\n {this.state.device === 'mobile' && (\\n \\n {\\n this.setState({\\n showExplore: true\\n })\\n }}\\n />\\n \\n )}\\n
    \\n {this.state.showTagList && (\\n \\n )}\\n\\n \\n \\n \\n \\n {brand}\\n \\n {name}

    \\n
    \\n
    \\n £{price}\\n
    \\n {(sale) && (\\n
    \\n £{saleprice}\\n
    \\n )}\\n
    \\n
    \\n \\n )\\n }\",\n \"render() {\\n image(this.g, 0, 0, this.w, this.h);\\n }\",\n \"render() {\\n const imgURL = this.props.item.img;\\n return (\\n
    \\n
    \\n \\n \\n {this.state.hasDescription ? (\\n this.buildDescriptionSpan()}\\n onMouseOut={() => this.removeDescriptionSpan()}\\n >\\n !\\n \\n ) : null}\\n
    \\n
    \\n
    \\n \\n {this.buildTableHeaders()}\\n \\n \\n \\n \\n \\n \\n
    \\n \\n );\\n }\",\n \"function render(id, title, imgUrl, height, width, prev, next) {\\n var imgContainer = \\\"
    \\\";\\n document.getElementById(\\\"container\\\").innerHTML += imgContainer;\\n }\",\n \"renderImage() {\\n\\n const imageContainer = document.getElementById(\\\"image-container\\\")\\n const div = document.createElement('div')\\n div.className = 'container-fluid'\\n imageContainer.append(div)\\n const img = document.createElement('img')\\n img.setAttribute('id', 'img')\\n img.className = 'img-fluid'\\n img.src = `${this.url}`\\n\\n const p1 = document.createElement('p1')\\n p1.setAttribute('id', 'p1')\\n\\n p1.innerText = `${this.caption}`\\n div.append(img, p1)\\n\\n }\",\n \"render(){\\n return(\\n
    \\n \\\"\\\"\\n
    \\n )\\n }\",\n \"renderList() { \\n \\n return this.props.products.map(product => { \\n \\n return (\\n
    \\n
    \\n
    {product.product_name}
    \\n
    {product.description}
    \\n
    {product.price}
    \\n\\n
    \\n\\n
    \\n \\n
    \\n )\\n\\n }); \\n \\n }\",\n \"render() {\\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\\n }\",\n \"function Render(image) {\\n selectedImage = image;\\n //setup canvas for paper API\\n setupPaperCanvas();\\n //setup and fill image\\n setupPaperImage();\\n //setup and fill texts\\n setupPaperTexts();\\n}\",\n \"function Product(props){\\n return(\\n
    \\n \\n\\t
    {props.name}

    {props.amount}
    \\n
    \\n );\\n}\",\n \"render() {\\n return (\\n
    \\n \\n \\n \\n
    \\n );\\n }\",\n \"display() {\\n if (this.isDrank === false) {\\n //Display\\n image(this.image, this.x, this.y, this.size, this.size);\\n }\\n }\",\n \"render() {\\n\\t\\treturn (\\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t
    Name
    \\n\\t\\t\\t\\t\\t
    {this.props.name}
    \\n\\t\\t\\t\\t\\t
    Brand
    \\n\\t\\t\\t\\t\\t
    {this.props.brand}
    \\n\\t\\t\\t\\t\\t
    Category
    \\n\\t\\t\\t\\t\\t
    {this.props.category}
    \\n\\t\\t\\t\\t\\t
    Price
    \\n\\t\\t\\t\\t\\t
    {this.props.price}
    \\n\\t\\t\\t\\t\\t}>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t
    \\n\\t\\t\\t\\tProduct Link\\n\\t\\t\\t
    \\n\\t\\t);\\n\\t}\",\n \"render() {\\n const { name, price, image_url, id } = this.props.data;\\n return (\\n \\n \\n \\n {name}\\n \\n {`Price: ${price}`}\\n {this.props.renderQuantity ?\\n

    Quantity: {this.props.data.quantity}

    :\\n null\\n }\\n
    \\n \\n \\n
    \\n
    \\n );\\n }\",\n \"function displayProduct(item){\\r\\n if(item.id == 1\\r\\n || item.id == 2 \\r\\n || item.id == 3\\r\\n || item.id == 4\\r\\n || item.id == 5\\r\\n || item.id == 6){\\r\\n return `\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n

    ${item.title}

    \\r\\n
    $${item.price}
    \\r\\n
    \\r\\n\\r\\n

    ${item.text}

    \\r\\n\\r\\n
    \\r\\n
    Rating: ${item.rating} out of 5
    \\r\\n Reviews (${item.reviews})\\r\\n
    \\r\\n
    \\r\\n `\\r\\n }\\r\\n}\",\n \"render(){\\nconst {container,titleConatiner,title,body,productContainer,productImage,productName,productPrice} = styles;\\n\\n\\n//Product Images\\n return(\\n\\n\\nTop Products \\n\\n\\n \\n\\n {this.props.topProducts.map(e => (\\n this.gotoDetails(e)} key={e.id} >\\n\\n \\n\\n {e.name.toUpperCase()}\\n\\n {e.price}$\\n \\n ))}\\n\\n\\n\\n\\n\\n );\\n}\",\n \"render() {\\n push();\\n translate(this.pos.x + this.xOff, this.pos.y);\\n rotate(this.angle);\\n imageMode(CENTER);\\n image(this.design, 0, 0, this.r, this.r);\\n pop();\\n }\",\n \"show() {\\n // applyTextTheme\\n image(this.image, this.x, this.y, this.width, this.height)\\n }\",\n \"render() {\\n return (\\n
    \\n \\n
    \\n )\\n }\",\n \"function imageDisplay() {\\n var color = imageColor();\\n var captionColor = color;\\n captionColor = color.replace(/_/g, \\\" \\\").replace('solid', '');\\n var captionProduct = name.replace('
    ', '&nbsp;');\\n var caption = (captionColor+\\\" \\\"+captionProduct).replace(/(^|\\\\s)\\\\S/g, function(match) {\\n return match.toUpperCase();\\n });\\n var img_source = \\\"../../images/products/\\\"+img+color+\\\".gif\\\";\\n var lightbox_img = \\\"../../images/products/large/\\\"+img+color+\\\".gif\\\";\\n var lightbox_img_back = \\\"../../images/products/back/large/\\\"+img+color+\\\".gif\\\";\\n $('#product_img_front').attr('src', img_source);\\n $('#product_img_front_large').attr('src', lightbox_img);\\n $('#product_img_back_large').attr('src', lightbox_img_back);\\n $('#product_img_front').parent().attr('href', lightbox_img).attr('data-lightbox', img+color).attr('title', caption);\\n $('#product_img_back').attr('href', lightbox_img_back).attr('data-lightbox', img+color).attr('title', caption+' (Back)');\\n}\",\n \"renderGallery() {\\n\\t\\tconst {data, container, currentPhoto} = this.props,\\n\\t\\t\\timageWrapper = this.createElement('div', 'gallery__general-image'),\\n\\t\\t\\timage = this.createElement('img', 'gallery__photo');\\n\\t\\tcontainer.innerText = '';\\n\\n\\t\\timageWrapper.append(image);\\n\\t\\tcontainer.append(imageWrapper, this.renderPhotoList());\\n\\t\\tthis.changeGeneralPhoto(currentPhoto);\\n\\t}\",\n \"renderImage( img, i ) {\\n\\t\\tconst {\\n\\t\\t\\timageFilter,\\n\\t\\t\\timages,\\n\\t\\t\\tisSave,\\n\\t\\t\\tlinkTo,\\n\\t\\t\\tlayoutStyle,\\n\\t\\t\\tonRemoveImage,\\n\\t\\t\\tonSelectImage,\\n\\t\\t\\tselectedImage,\\n\\t\\t\\tsetImageAttributes,\\n\\t\\t} = this.props;\\n\\n\\t\\t/* translators: %1$d is the order number of the image, %2$d is the total number of images. */\\n\\t\\tconst ariaLabel = sprintf(\\n\\t\\t\\t__( 'image %1$d of %2$d in gallery', 'jetpack' ),\\n\\t\\t\\ti + 1,\\n\\t\\t\\timages.length\\n\\t\\t);\\n\\t\\tconst Image = isSave ? GalleryImageSave : GalleryImageEdit;\\n\\n\\t\\tconst { src, srcSet } = photonizedImgProps( img, { layoutStyle } );\\n\\n\\t\\treturn (\\n\\t\\t\\t\\n\\t\\t);\\n\\t}\",\n \"function updateProductImageHeight() {\\n let productImageWidth = $('.product-image').width();\\n $('.product-image').css({'height': productImageWidth + 'px'});\\n }\",\n \"render(){\\n return (\\n
    \\n . \\n
    \\n \\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n return (\\n
    \\n
    \\n

    Products

    \\n\\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n return (\\n\\t\\t\\n\\t\\t{this.state.products.map((item, i) => \\n\\t\\t\\t\\n\\t\\t\\t\\t{ item.title }\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t $ { item.variants[0].price * 0.75 }\\n\\t\\t\\t\\t\\n \\n \\n
    \\n
    \\n { currentImage + 1 } of { images.length }\\n
    \\n
    {image.title}
    \\n
    \\n \\n )\\n }\",\n \"function showProduct() {\\n const title = el('products').value;\\n const product = products[title];\\n if (product) {\\n el('title').innerHTML = title;\\n el('price').innerHTML = 'Price: ' + currencyFormatter.format(product.price);\\n el('image').src = product.image;\\n }\\n el('quantity-container').style.display = product ? 'block' : 'none';\\n}\",\n \"renderLayout() {\\n\\t let self = this;\\t \\n\\t let photoListWrapper = document.querySelector('#photos');\\t \\n imagesLoaded(photoListWrapper, function() { \\t \\n\\t\\t\\tself.msnry = new Masonry( photoListWrapper, {\\n\\t\\t\\t\\titemSelector: '.photo'\\n\\t\\t\\t}); \\n\\t\\t\\t[...document.querySelectorAll('#photos .photo')].forEach(el => el.classList.add('in-view'));\\n });\\n }\",\n \"render () {\\n let {src, alt, ...props} = this.props;\\n src = src?.src || src; // image passed through import will return an object\\n return {alt}/\\n }\",\n \"render() {\\n return (\\n \\n );\\n }\",\n \"function Home() {\\n return (\\n
    \\n
    \\n \\n\\n
    \\n \\n \\n
    \\n
    \\n \\n \\n
    \\n \\n\\n
    \\n \\n \\n \\n
    \\n \\n\\n
    \\n \\n \\n
    \\n
    \\n \\n \\n
    \\n
    \\n
    \\n );\\n}\",\n \"render() {\\n\\n return (\\n \\n
    \\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n const { products, page, productInfo} = this.state; //desistruturando\\n //aonde era this.state.products.map, fica agr apenas products.map, vale o mesmo para os demais\\n\\n //a key no h2 e passada, pq o react pede que tenha uma key unica pra cada item da iteracao\\n return (\\n
    \\n
    \\n

    Sua Lista de Produtos:

    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\\n Imagem Novo Produto \\n
    \\n {//aqui codigo javascript, apos \\\"=> (\\\" volta a ser html\\n products.map(product => (\\n
    \\n {product.title}\\n

    {product.description}

    \\n Acessar\\n
    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\\n Imagem Editar Produto\\n \\n
    \\n
    \\n ))}\\n
    \\n \\n \\n
    \\n
    \\n\\n \\n )\\n }\",\n \"render() {\\n return (\\n
    \\n
    \\n

    Remember All

    \\n
    \\n {/*
    */}\\n {/* \\\"Goldfish\\\"; */}\\n \\n {/* */}\\n
    \\n //
    \\n\\n ) }\",\n \"render() {\\r\\n return html`\\r\\n ${SharedStyles}\\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    ${this.item ? this.item.name : \\\"\\\"}
    \\r\\n
    ${this._computeIngredients(this.item)}
    \\r\\n
    ${this.item ? this.item.description : \\\"\\\"}
    \\r\\n\\r\\n
    \\r\\n
    ${this.item ? this.item.price : \\\"\\\"}
    \\r\\n this._onAddToCartClick(this.item, this.quantity)}\\\" raised>add to cart\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n `;\\r\\n }\",\n \"function displayProduct(product) {\\n document.getElementById('product').innerHTML = renderHTMLProduct(product, 'single');\\n}\",\n \"render() {\\n return(\\n \\n

    \\n {this.props.title}\\n

    \\n
    \\n \\\"\\\"\\n
    \\n

    \\n \\n
    \\n );\\n }\",\n \"render() {\\n console.log('rerendering product page');\\n return (\\n
    \\n
    \\n
    \\n
    &#128296;
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n );\\n }\",\n \"render(){\\n\\n /*\\n * FIXME: get jpegs for product images\\n */\\n\\n return (\\n \\n \\n {this.state.categories.map(function(c, i){\\n return (\\n \\n \\n \\n {c.name}\\n \\n \\n )\\n })}\\n \\n )\\n }\",\n \"function Product({\\n product\\n}) {\\n var _product$photo, _product$photo$image;\\n\\n return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().root),\\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"img\\\", {\\n // className={classesItemStyles.itemImg}\\n src: product === null || product === void 0 ? void 0 : (_product$photo = product.photo) === null || _product$photo === void 0 ? void 0 : (_product$photo$image = _product$photo.image) === null || _product$photo$image === void 0 ? void 0 : _product$photo$image.publicUrlTransformed,\\n alt: product.name\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 14,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_Title_module_css__WEBPACK_IMPORTED_MODULE_6___default().title),\\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\\n href: `/product/${product.id}`,\\n children: product.name\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 20,\\n columnNumber: 9\\n }, this)\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 19,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_PriceTag_module_css__WEBPACK_IMPORTED_MODULE_7___default().priceTag),\\n children: (0,_lib_util_formatMoney__WEBPACK_IMPORTED_MODULE_2__.default)(product.price)\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 22,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"p\\\", {\\n children: product.description\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 25,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().buttonList),\\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\\n href: {\\n pathname: \\\"update\\\",\\n query: {\\n id: product.id\\n }\\n },\\n children: \\\"Edit\\\"\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 27,\\n columnNumber: 9\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_DeleteProduct__WEBPACK_IMPORTED_MODULE_3__.default, {\\n id: product.id,\\n children: \\\"Delete\\\"\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 30,\\n columnNumber: 9\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_AddToCart__WEBPACK_IMPORTED_MODULE_4__.default, {\\n id: product.id\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 31,\\n columnNumber: 9\\n }, this)]\\n }, void 0, true, {\\n fileName: _jsxFileName,\\n lineNumber: 26,\\n columnNumber: 7\\n }, this)]\\n }, void 0, true, {\\n fileName: _jsxFileName,\\n lineNumber: 13,\\n columnNumber: 5\\n }, this);\\n}\",\n \"_renderThumbnail($$) {\\n let node = this.props.node\\n // TODO: Make this work with tables as well\\n let contentNode = node.find('graphic')\\n let el = $$('div').addClass('se-thumbnail')\\n if (contentNode) {\\n el.append(\\n $$(this.getComponent(contentNode.type), {\\n node: contentNode,\\n disabled: this.props.disabled\\n })\\n )\\n } else {\\n el.append('No thumb')\\n }\\n return el\\n }\",\n \"display() {\\n this.move();\\n imageMode(CENTER);\\n image(this.axeImg, this.x + bgLeft, this.y, this.w, this.h);\\n }\",\n \"function renderProducts() {\\n const promotionalProductsPart = document.querySelector(\\\".promotion-list\\\");\\n let html = \\\"\\\";\\n for (const product of productsList) {\\n if (product.category === \\\"promotionalProducts\\\") {\\n html += ``;\\n }\\n }\\n promotionalProductsPart.innerHTML = html;\\n}\",\n \"function render() {\\n var state = store.getState()\\n document.getElementById('value').innerHTML = state.count.result;\\n document.getElementById('value2').innerHTML = state.sum;\\n\\n if(state.count.loading){\\n document.getElementById('status').innerHTML = \\\"is loading...\\\";\\n }else{\\n document.getElementById('status').innerHTML = \\\"loaded\\\";\\n }\\n // image\\n document.getElementById('imagesStatus').innerHTML = state.images.loading;\\n if(state.images.loading ==\\\"loading…\\\"){\\n $('#imagesList').text(\\\"\\\");\\n }\\n else if(state.images.loading ==\\\"loaded\\\"){\\n for(var i=0; i< state.images.data.length; i++){\\n $('#imagesList').append(\\n \\\"\\\");\\n }\\n }\\n\\n}\",\n \"render() {\\n // eslint-disable-next-line no-unused-vars\\n let baseStyle = {};\\n // eslint-disable-next-line no-unused-vars\\n let layoutFlowStyle = {};\\n \\n const style_background = {\\n width: '100%',\\n height: '100%',\\n };\\n const style_background_outer = {\\n backgroundColor: '#f6f6f6',\\n pointerEvents: 'none',\\n };\\n const style_image = {\\n backgroundImage: 'url('+img_elImage+')',\\n backgroundRepeat: 'no-repeat',\\n backgroundPosition: '50% 50%',\\n backgroundSize: 'cover',\\n pointerEvents: 'none',\\n };\\n const style_image2 = {\\n backgroundImage: 'url('+img_elImage2+')',\\n backgroundRepeat: 'no-repeat',\\n backgroundPosition: '50% 50%',\\n backgroundSize: 'cover',\\n };\\n const style_image2_outer = {\\n pointerEvents: 'none',\\n };\\n \\n return (\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n \\n
    \\n
    \\n )\\n }\",\n \"function printProducts(){\\n for (var i = 0; i <= products.length; i++){ \\n if (i < products.length-1){\\n var clone = productDiv.cloneNode(true);\\n productDiv.parentNode.insertBefore(clone, productDiv);\\n };\\n productDiv.style.display = \\\"block\\\";\\n productName.innerHTML = products[i].name;\\n productDescription.innerHTML = products[i].description;\\n price.innerHTML = products[i].price;\\n image.setAttribute(\\\"src\\\", products[i].url); \\n \\n }\\n \\n }\",\n \"render() {\\n\\n return (\\n
    \\n \\n
    \\n );\\n }\",\n \"render() {\\n console.log(\\\"Rendering ArtBlock...\\\");\\n let paintings = this.state.paintings;\\n const ArtBlocks = [];\\n for (var i = 0; i < paintings.length; i++) {\\n ArtBlocks.push(\\n {Paintings[i].name}\\n\\n )\\n }\\n return (\\n
    \\n
    Score: {this.state.currentScore} | High Score: {this.state.highScore}
    \\n
    \\n {Modal}\\n
    \\n
    \\n {ArtBlocks}\\n
    \\n
    \\n )\\n }\",\n \"function renderGallery(image) {\\n let gallery = document.getElementById('gallery');\\n if (gallery != null)\\n updateGallery(gallery, image);\\n else\\n createGallery(image);\\n }\",\n \"renderProduct(product) {\\n return (
    \\n {product.name}\\n
    );\\n }\",\n \"function render() {\\n\\n\\t\\t\\t}\",\n \"function renderImg() \\n{\\n leftIndex = randomImage();\\n midIndex = randomImage();\\n rightIndex = randomImage();\\n\\n randControl();\\n while (leftIndex === rightIndex || leftIndex === midIndex) \\n {\\n leftIndex = randomImage();\\n }\\n while(rightIndex === midIndex)\\n {\\n rightIndex = randomImage();\\n }\\n randControl();\\n usedImg.splice(0, usedImg.length);\\n\\n leftImg.setAttribute('src', products[leftIndex].productImg);\\n midImg.setAttribute('src', products[midIndex].productImg);\\n rightImg.setAttribute('src', products[rightIndex].productImg);\\n products[leftIndex].views++;\\n products[midIndex].views++;\\n products[rightIndex].views++;\\n\\n usedImg.push(leftIndex);\\n usedImg.push(midIndex);\\n usedImg.push(rightIndex);\\n}\",\n \"render () {\\n return (\\n
    \\n
    \\n \\n
    \\n
    \\n this.onSearchSubmit(term)}/>\\n \\n
    \\n
    \\n );\\n }\",\n \"function ItemImage(props) {\\n return \\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.68119514","0.6711578","0.6438905","0.6103812","0.60803235","0.6068057","0.6055299","0.6051518","0.60464317","0.6000089","0.5971422","0.5937545","0.5921839","0.5915895","0.5908995","0.5892216","0.5871162","0.5831915","0.5831691","0.5806436","0.5787973","0.57657754","0.5723944","0.57129925","0.5702852","0.5682741","0.5650505","0.56426615","0.5623197","0.56102717","0.5601003","0.5577978","0.5572669","0.5572513","0.5555633","0.5544983","0.55292237","0.5525613","0.5514523","0.54971385","0.54679453","0.5461438","0.5459829","0.5453033","0.5450901","0.54484975","0.54419714","0.54289126","0.5426699","0.5410413","0.5410205","0.5402377","0.53943425","0.53930783","0.53771937","0.537474","0.5373132","0.5360696","0.53596926","0.5355597","0.53539884","0.5352578","0.534132","0.53304535","0.5323526","0.5321553","0.5316722","0.53084445","0.53056943","0.5296578","0.529359","0.5290114","0.5285622","0.5281973","0.52797747","0.5279625","0.52736443","0.5272152","0.52692217","0.52649915","0.52584916","0.5240445","0.5238457","0.5234438","0.5228368","0.52258617","0.52176255","0.5216038","0.5215461","0.52150077","0.5201484","0.5188266","0.51865","0.5186379","0.5185892","0.51790893","0.5173505","0.5166844","0.51662284","0.5164953"],"string":"[\n \"0.68119514\",\n \"0.6711578\",\n \"0.6438905\",\n \"0.6103812\",\n \"0.60803235\",\n \"0.6068057\",\n \"0.6055299\",\n \"0.6051518\",\n \"0.60464317\",\n \"0.6000089\",\n \"0.5971422\",\n \"0.5937545\",\n \"0.5921839\",\n \"0.5915895\",\n \"0.5908995\",\n \"0.5892216\",\n \"0.5871162\",\n \"0.5831915\",\n \"0.5831691\",\n \"0.5806436\",\n \"0.5787973\",\n \"0.57657754\",\n \"0.5723944\",\n \"0.57129925\",\n \"0.5702852\",\n \"0.5682741\",\n \"0.5650505\",\n \"0.56426615\",\n \"0.5623197\",\n \"0.56102717\",\n \"0.5601003\",\n \"0.5577978\",\n \"0.5572669\",\n \"0.5572513\",\n \"0.5555633\",\n \"0.5544983\",\n \"0.55292237\",\n \"0.5525613\",\n \"0.5514523\",\n \"0.54971385\",\n \"0.54679453\",\n \"0.5461438\",\n \"0.5459829\",\n \"0.5453033\",\n \"0.5450901\",\n \"0.54484975\",\n \"0.54419714\",\n \"0.54289126\",\n \"0.5426699\",\n \"0.5410413\",\n \"0.5410205\",\n \"0.5402377\",\n \"0.53943425\",\n \"0.53930783\",\n \"0.53771937\",\n \"0.537474\",\n \"0.5373132\",\n \"0.5360696\",\n \"0.53596926\",\n \"0.5355597\",\n \"0.53539884\",\n \"0.5352578\",\n \"0.534132\",\n \"0.53304535\",\n \"0.5323526\",\n \"0.5321553\",\n \"0.5316722\",\n \"0.53084445\",\n \"0.53056943\",\n \"0.5296578\",\n \"0.529359\",\n \"0.5290114\",\n \"0.5285622\",\n \"0.5281973\",\n \"0.52797747\",\n \"0.5279625\",\n \"0.52736443\",\n \"0.5272152\",\n \"0.52692217\",\n \"0.52649915\",\n \"0.52584916\",\n \"0.5240445\",\n \"0.5238457\",\n \"0.5234438\",\n \"0.5228368\",\n \"0.52258617\",\n \"0.52176255\",\n \"0.5216038\",\n \"0.5215461\",\n \"0.52150077\",\n \"0.5201484\",\n \"0.5188266\",\n \"0.51865\",\n \"0.5186379\",\n \"0.5185892\",\n \"0.51790893\",\n \"0.5173505\",\n \"0.5166844\",\n \"0.51662284\",\n \"0.5164953\"\n]"},"document_score":{"kind":"string","value":"0.5530093"},"document_rank":{"kind":"string","value":"36"}}},{"rowIdx":59,"cells":{"query":{"kind":"string","value":"Displays users name and a button, starts game when clicked."},"document":{"kind":"string","value":"function introWelcome() {\n title.innerText = \"Welcome, \" + username;\n subTitle.innerText = \"\";\n\n firstButton.classList.remove(\"hidden\");\n firstButton.innerText = \"Click to start!\"\n firstButton.onclick = function() {\n startFunction();\n }\n\n userInput.classList.add(\"hidden\");\n submitButton.classList.add(\"hidden\");\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 showGamificationButton(names, urls) {\n\n //////////////////////////\n // REMOVE OLD BUTTONS\n /////////////////////////\n const old_gameStartButton = document.getElementById('start_game_button'),\n old_gameButton = document.getElementById('guess_game_button');\n if (old_gameStartButton !== null && old_gameButton !== null) {\n removeElements([old_gameStartButton]);\n removeElements([old_gameButton]);\n }\n \n // create a button\n const gameButton = document.createElement('div'),\n gameStartButton = document.createElement('div');\n \n gameStartButton.innerHTML = 'START';\n gameStartButton.id = 'start_game_button';\n entry_info.parentNode.insertBefore(gameStartButton, entry_info.nextSibling);\n\n // assign an id to it\n gameButton.id = 'guess_game_button';\n\n // insert text\n gameButton.innerHTML = 'Guess The Plants';\n\n // append it next to the pages div tag as a next sibling element\n pages.parentNode.insertBefore(gameButton, pages.nextSibling);\n\n // add a mouseup event listener to the buttons\n gameButton.addEventListener('mouseup', () => {\n \n showGameEntry(urls);\n });\n gameStartButton.addEventListener('mouseup', () => {\n\n // if the text field for username input is not empty\n if (username.value !== '') {\n\n // hide the game start button\n gameStartButton.style.visibility = 'hidden';\n \n // set the container to be fullscreen\n game_entry.style.setProperty('transform', 'translate(0, 0)', 'important');\n game_entry.style.setProperty('width', '100%', 'important');\n game_entry.style.setProperty('height', '100%', 'important');\n\n turns++;\n init(names, urls);\n }\n });\n}","function renderGame (){\n\n //setup new instructions\n var newInst = $(\"

    \");\n newInst.text(\"Welcome back, \"+username);\n newInst.addClass(\"col s12 center-align\");\n $(\"#instructions\").html(newInst);\n \n $(\"#game\").show();\n\n $(\"#yourName\").text(username);\n\n\n if(oppChoice){\n $(\"#opponentChoice\").css(\"opacity\", \"1\");\n } \n // if you haven't chosen, set instructions to say choose\n if (yourChoice){\n $(\"#yourChoice\").css(\"background-image\", \"url('assets/images/\"+yourChoice+\".png')\");\n $(\"#yourChoice\").css(\"opacity\", \"1\");\n \n // if you haven't chosen, show buttons \n } else {\n renderButtons();\n }\n\n updateStatus();\n}","function useNewButton() {\r\n createUser();\r\n startPage()\r\n}","function startGame(playerCount) {\r\n\t\r\n\tGC.initalizeGame(playerCount);\r\n\t\r\n\tUI.setConsoleHTML(\"The game is ready to begin! There will be a total of \" + GC.playerCount + \" players.
    Click to begin!\");\r\n\tUI.clearControls();\r\n\tUI.addControl(\"begin\",\"button\",\"Begin\",\"takeTurn()\");\r\n\t\r\n\tGC.drawPlayersOnBoard();\r\n}","function startGame() {\n\tvar userName = $(\"#enterName\").val();\n\t$(\"#name\").text(userName);\n\t$(\"#startScreen\").addClass('hide');\n\tif($(\"#enterName\").val() != \"\") {\n\t\tsetQuestion();\n\t} else {\n\t\t$(\"#hint\").removeClass('initialHide');\n\t\t$(\"#hint\").text(\"Please enter your username!\")\n\t}\n\n}","function startGame(){\r\n var UserData;\r\n var userName = document.getElementById('nameEntry').value\r\n UserData = checkCookie(userName);\r\n updateTables(UserData);\r\n $('#Load').html(\"\");\r\n $('#saveGame').prop('disabled',false);\r\n enableTravel();\r\n}","function startGame() {\n $(\".landing-menu\").hide();\n $(\".game-section\").show();\n $(\".userButtons\").show();\n }","display(){\r\n var title = createElement('h1')\r\n title.html(\"car racing game!\")\r\n title.position(380,100)\r\n\r\n var input = createInput(\"Name\")\r\n var button = createButton(\"Play\")\r\n var greeting = createElement('h2')\r\n input.position(380,240)\r\n button.position(440,300)\r\n//when player pressed over the button player count is increased and updated\r\n//button and input is hidden\r\n//greeting message to the player is displayed\r\n\r\n button.mousePressed(function(){\r\n input.hide()\r\n button.hide()\r\n //.value()- gives the value that was passed inside the input\r\n var name = input.value()\r\n\r\n playerCount+=1\r\n player.update(name)\r\n player.updateCount(playerCount)\r\n\r\n greeting.html(\"hellow \"+name)\r\n greeting.position(380,250)\r\n\r\n })\r\n\r\n }","function showTheGame () {\n\t$(\".game\").show();\n\t$(\".startNowButton\").hide();\n\trun();\n}","startGame() {\n document.getElementById('homemenu-interface').style.display = 'none';\n document.getElementById('character-selection-interface').style.display = 'block';\n this.interface.displayCharacterChoice();\n this.characterChoice();\n }","function onClickGameName() {\n stopGame();\n\n socket.send({action: \"exit_game\"});\n $(\"#game\").hide(); \n $(\"#game_choose\").show(); \n\n initHome();\n }","function startGame() {\n\n $(\"#questionPage\").hide();\n \n $(\"#start\").show();\n\n var startButton = $(\"\").click(hostNewGame);\n}","function startGame(){\n document.querySelector('.menu').style.display = \"none\";\n addClicks();\n score.querySelector('h2').innerText = ('Game Ready. Player 1 turn.');\n}","function startGame() {\n gameState.active = true;\n resetBoard();\n gameState.resetBoard();\n\n var activePlayer = rollForTurn();\n \n // Game has started: enable/disable control buttons accordingly.\n btnDisable(document.getElementById('btnStart'));\n btnEnable(document.getElementById('btnStop'));\n\n var showPlayer = document.getElementById('showPlayer');\n showPlayer.innerHTML = activePlayer;\n showPlayer.style.color = (activePlayer === \"Player 1\") ? \"blue\" : \"red\";\n // The above line, doing anything more would require a pretty sizeable refactor.\n // I guess I could name \"Player 1\" with a constant.\n}","function showLobby() {\n battlefield.innerHTML = '';\n gamesList.classList.remove('hidden');\n updateBtn(actionBtn, ACTION_BTN.CREATE_GAME);\n resetHeader();\n }","function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}","function start(){\n c.style.display = \"none\"\n d.style.display = \"block\"\n document.querySelector(\"#user\").innerHTML= name + \" :\"\n}","function initiateGame(){\n\n\t$( document ).ready( function() {\n\t\t\n\t\t$( '#display' ).html('');\n\t\t$( '#display' ).attr('start', 'start');\n\t\t$( '#display' ).on( 'click', function() {\n\t\t\trenderGame();\n\t\t})\n\t\t\n\t});\n}","static startGameOnClick(){\n $('#imageIndex').on('click', function(event){\n var imageId = parseInt(event.target.id.replace(\"image\", \"\"))\n let userName = $('#username').val()\n userName === \"\" ? userName = \"Guest\" : userName\n startGame(imageId, userName)\n })\n }","function newGameUser() {\n var btn = document.getElementById(\"testName\");\n btn.addEventListener(\"click\", function() {\n userName = this.form.username.value;\n changeUserText(userName);\n this.form.username.value = \"\";\n testLocal();\n });\n}","function startGame()\r\n{\r\n // alert(\"The last straw \");\r\n\r\n isGameEnded = false ;\r\n playerName = prompt (\"What's your name ? \",\"Paul Tibbets\");\r\n statusMessage = \"Welcome, \"+playerName+\"!\" ;\r\n updateStatusMessage(statusMessage, 1) ;\r\n document.getElementById(\"name1\").innerHTML = playerName+\"'s Caption\" ;\r\n /* Empty the board contents */\r\n emptyBoard();\r\n\r\n /* Place the board at random for both computer and player */\r\n placeBoard();\r\n\r\n statusMessage = \"Hit me with your best shot, \"+playerName;\r\n updateStatusMessage(statusMessage, 2) ;\r\n\r\n}","function GameUI() {}","function screenPlayers()\n{\n\tshowScreen(\"players_choice\", \"Choix des joueurs\", function()\n\t{\n\t\tnbPlayers = 0;\n\n\t\tplayersList = [];\n\n\t\tdelete teamId;\n\n\t\tshowNext(\"Comptage\", function()\n\t\t{\n\t\t\tconsole.log(\"Go vers le comptage !!!\");\n\t\t});\n\n\t\t$.ajax(\n\t\t{\n\t\t\turl: serverUrl + \"queries.php\",\n\t\t\ttype: \"POST\",\n\t\t\tcache: false,\n\t\t\tdata:\n\t\t\t{\n\t\t\t\tfunc: \"get_user\"\n\t\t\t}\n\t\t}).done(function(data)\n\t\t{\n\t\t\tvar users = eval(data);\n\n\t\t\tvar slide = $(\"
    \").attr(\"id\", \"users_slide\");\n\n\t\t\tvar currentDiv = $(\"
    \");\n\n\t\t\tfor(var user in users)\n\t\t\t{\n\t\t\t\tif(user % 6 == 0 && user != 0)\n\t\t\t\t{\n\t\t\t\t\tslide.append(currentDiv);\n\n\t\t\t\t\tcurrentDiv = $(\"
    \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentDiv.append(userSwitch(users[user]));\n\t\t\t}\n\n\t\t\tslide.append(currentDiv);\n\n\t\t\t$(\".wrapper\").append(slide);\n\n\t\t\t$(\"#users_slide\").slick(\n\t\t\t{\n\t\t\t\tdots: true,\n\t\t\t\tinfinite: false\n\t\t\t});\n\n\t\t\taddUserClickAction();\n\n\t\t\tvar usersChoiceButtons = $(\"
    \").attr(\"id\", \"users_choice_buttons\");\n\n\t\t\tvar ajouterButton = button(\"\").addClass(\"invisible\");\n\n\t\t\tvar commencerButton = button(\"Commencer\").attr(\"id\", \"commencer\").addClass(\"disable\");\n\n\t\t\tusersChoiceButtons.append($(\"
    \").append(ajouterButton));\n\n\t\t\tusersChoiceButtons.append($(\"
    \").append(commencerButton));\n\n\t\t\t$(\".wrapper\").append(usersChoiceButtons);\n\n\t\t\thideLoader();\n\t\t});\n\t});\n}","function gamestart() {\n\t\tshowquestions();\n\t}","function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}","startGame() {\r\n\t\tthis.board.drawHTMLBoard();\r\n\t\tthis.activePlayer.activeToken.drawHTMLToken();\r\n\t\tthis.ready = true;\r\n\t}","function playersOnClick () {\n module.exports.internal.stateManager.showState('main-branch', 'pick-a-player')\n}","function startGame() {\n showGuessesRemaining();\n showWins();\n}","function startGame() {\n console.log('start button clicked')\n $('.instructions').hide();\n $('.title').show();\n $('.grid_container').show();\n $('.score_container').show();\n $('#timer').show();\n // soundIntro('sound/Loading_Loop.wav');\n }","function startGame() {\n //hide the deal button\n hideDealButton();\n //show the player and dealer's card interface\n showCards();\n //deal the player's cards\n getPlayerCards();\n //after brief pause, show hit and stay buttons\n setTimeout(displayHitAndStayButtons, 2000);\n }","function start_game(){\r\n if(name_input.value==\"\"){\r\n enter_name_alert.style=\"visibility: visible;\"\r\n }\r\n else{\r\n enter_name_alert.style=\"visibility: hidden;\"\r\n first_layer.style.display=\"none\"\r\n user_name.innerHTML=name_input.value+' '\r\n }\r\n}","function startGame() {\n setMessage(player1 + ' gets to start.');\n}","function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}","function changeUser() {\n var choice = Math.floor(Math.random() * name.length);\n document.getElementById(\"user\").innerHTML = name[choice];\n document.getElementById(\"userBtn\").innerHTML = name[choice];\n document.getElementById(\"userDrop\").innerHTML = name[choice];\n drawTextAndResize(name[choice]);\n}","function showButtons() {\n // when users are not connected, we want start game button disabled\n // document.getElementById('start-game').style.display = 'inline';\n\n document.getElementById('button-invite').style.display = 'inline';\n // document.getElementById('button-preview').style.display = 'inline';\n document.getElementById('grab-username').style.display = 'inline';\n document.getElementById('username').style.display = 'inline';\n document.getElementById('invite-to').style.display = 'inline';\n\n // document.getElementById('end-call').style.display = 'none';\n\n // ensure that local media removes on firefox\n $('#local-media > video').remove();\n }","function startGame() {\n createButtons();\n const cards = createCardsArray();\n appendCardsToDom(cards);\n}","function startGame() {\n setMessage(\"Select an opponent above\");\n}","function menu() {\n\t\n // Title of Game\n title = new createjs.Text(\"Poker Room\", \"50px Bembo\", \"#FF0000\");\n title.x = width/3.1;\n title.y = height/4;\n\n // Subtitle of Game\n subtitle = new createjs.Text(\"Let's Play Poker\", \"30px Bembo\", \"#FF0000\");\n subtitle.x = width/2.8;\n subtitle.y = height/2.8;\n\n // Creating Buttons for Game\n addToMenu(title);\n addToMenu(subtitle);\n startButton();\n howToPlayButton();\n\n // update to show title and subtitle\n stage.update();\n}","function win () { \n style = { font: \"65px Arial\", fill: \"#fff\", align: \"center\" };\n game.add.text(game.camera.x+325, game.camera.y+150, \"You Win!\", style);\n button = game.add.button(game.camera.x+275, game.camera.y+250, 'reset-button', actionOnResetClick, this);\n button = game.add.button(game.camera.x+475, game.camera.y+250, 'contact-button', actionOnContactClick, this); \n // The following lines kill the players movement before disabling keyboard inputs\n player.body.velocity.x = 0;\n setTimeout(game.input.keyboard.disabled = true, 1000); \n // Plays the victory song \n victory.play('');\n // When the Reset button is clicked, it calls this function, which in turn calls the game to be reloaded.\n // Here we display the contact and replay button options, calling either respective function\n function actionOnResetClick () {\n gameRestart();\n }\n\n // When the contact button is clicked it redirects through to contact form\n function actionOnContactClick () {\n\n window.location = (\"/contacts/\" + lastName)\n \n } \n }","function startGame(){\n\t$( \"#button_game0\" ).click(function() {selectGame(0)});\n\t$( \"#button_game1\" ).click(function() {selectGame(1)});\n\t$( \"#button_game2\" ).click(function() {selectGame(2)});\n\tloadRound();\n}","function displayStart(){\n\t// Display game start button again\n\t$('#game').append(\"
    \");\n\t$(\"#start\").unbind();\n\t$(\"#start\").click(startGame);\n\t// Play main theme song again\n\tmarioGame.audMainTheme.play();\n}","function switchToGameBoard(){\n\t\tif(userlist.length === 0){\n\t\t\tturnService.showWaitingAlert();\n\t\t}\n\t\t$userLoginArea.hide();\n\t\t$pageWrapper.show();\n\t\t$currentPhrase.hide();\n\t}","function startGame() {\n \n $(\"#start-button\").html(\"\");\n $(\"#start-button\").on('click', function () {\n $(\"#start-button\").remove();\n startTimer();\n getQuestion();\n });\n }","function startScreen() {\n\tdraw();\n\tif(usuario_id !== -1)\n\t\tstartBtn.draw();\n}","function startGame() {\n\t\ttheBoxes.innerText = turn;\n\t\twinner = null;\n\t}","function startGame() {\n\tvar serverMsg = document.getElementById('serverMsg');\n\tdocument.getElementById('print').disabled = false;\n\tserverMsg.value += \"\\n> all players have joined, starting game, wait for your turn...\"\n\tdocument.getElementById('rigger').style.display = \"none\";\n}","function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}","function startGame() {\n\n game.updateDisplay();\n game.randomizeShips();\n $(\"#resetButton\").toggleClass(\"hidden\");\n $(\"#startButton\").toggleClass(\"hidden\");\n game.startGame();\n game.updateDisplay();\n saveGame();\n}","function updateStartGameButtonVisibility() {\n //find out if current user is the creator\n var isCreator = (gameInfo.username === gameInfo.gameID);\n //get number of players\n var numPlayers = gameInfo.currentPlayers.length;\n\n if (isCreator && (numPlayers >= minNumberOfPlayers)) {\n //this is the game creator and there are enough players. Show start game option\n $(\"#startGameButton\").show();\n } else {\n //hide or keep hidden the startGameButton in all other cases\n $(\"#startGameButton\").hide();\n }\n}","function startNewGame(text){\n\n\t//console.log('start new game!');\n\n\ttext.destroy();\n\n\t//not very elegant but it does the job\n\tvar playerName = prompt(\"What's your name?\", \"Cloud\");\n\n\t//store player name in cache to be shown on in-game HUD\n\tlocalStorage.setItem(\"playerName\", playerName);\n\n\tthis.game.state.start('Game');\n}","function startGameButton() {\r\n\tif(table != undefined) {\r\n\t\ttable.startGame();\r\n\t}\r\n}","function login() {\n Player.name = $(\"#login_name\").val();\n $(\"#console\").hide();\n start_game();\n}","function beginApp() {\n console.log('Please build your team');\n newMemberChoice();\n}","function getFirstPlayer(){\n var firstRound = (Math.floor(Math.random() * 10) + 1)%2;\n turnsPlayer = turnsPlayer + firstRound;\n //display the current turn:\n if (turnsPlayer%2 == 0){\n currentPlayer = user.userx.name;\n } else {\n currentPlayer = user.usero.name;}\n $(\"#button2\").on(\"click\", function(){\n $(\"p\").text(\"Player \" + currentPlayer + \"'s turn\");\n });\n }","function populatepage(){\n \n document.getElementById('signedNamePlace').innerHTML = \"User: \";\n document.getElementById('signedName').innerHTML = username;\n document.getElementById('firstbtn').style.visibility = \"visible\";\n document.getElementById('simplebtn').style.visibility = \"visible\";\n}","function handleStartClick() {\n toggleButtons(true); // disable buttons\n resetPanelFooter(); // reset panel/footer\n\n for (let id of ['player-panel', 'ai-panel', 'enemyboard', 'ai-footer', 'player-footer']) {\n document.getElementById(id).classList.remove(\"hidden\");\n }\n\n game = new Game(settings.difficulty, settings.playerBoard);\n game.start();\n}","update() {\n this.nameText.text = 'Submit Name to Leaderboard:\\n ' + this.userName + '\\n(Submits on New Game)';\n\n }","function initializeGame(){\n if (typeof playerOne === \"undefined\"){\n $(\"section#game-section .game .game-wrapper\").text(\"Player One to Sign Up\");\n\n }else if(typeof playerTwo === \"undefined\") {\n $(\"section#game-section .game .game-wrapper\").text(\"Player Two to Sign Up\");\n }else{\n $(\"section#game-section .game .game-wrapper\").text(\"Game will start shortly \");\n $(\"section#game-section .game .game-wrapper\").append(playerTwo.name+' vs '+playerOne.name);\n startGame();\n assignStartTurn();\n }\n}","function aboutGame(){\n\tvar temp=\"\";\n\tvar img=\"\";\n\tvar Title=\"\";\n\t/// if we clicked on about the game formate about game text \n\tif(this.id === 'abutBtn'){\n\t\ttemp =window.gameInformation['abutBtn'];\n\t\timg='\\rrecources\\\\AF005415_00.gif';\n\t\tTitle=\" Game General Information \";\n\n\t}////// if we clicked on about the game formate about auther text \n\telse if(this.id === 'abouMe'){\n\t\ttemp =window.gameInformation['abouMe'];\n\t\timg='\\rrecources\\\\viber_image_2019-09-26_23-29-08.jpg';\n\t\tTitle=\" About The Auther\";\n\t}// formatting Text For Instructions\n\telse if(this.id === 'Instructions')\n\t{\n\t\ttemp =window.gameInformation['Instructions'];\n\t\timg='\\rrecources\\\\keyboard-arrows-512.png';\n\t\tTitle=\" Instructions\";\n\t}\n\n\t// create the dialog for each button alone\n\tcreatDialog(Title , temp ,img,300 );\n\t\n}","function startGame() {\n const usernameField = document.querySelector(\".username-field\");\n playerName = usernameField.value;\n hideGameIntroModal();\n fetch(\"headlines.json\")\n .then(response => response.json())\n .then(data => selectStories(data));\n}","function main() {\r\n rock_div.addEventListener(\"click\", () => {\r\n game(\"r\");\r\n resetUserRPS();\r\n showUserRock_div.style.display = \"block\";\r\n checkWhoWon();\r\n });\r\n paper_div.addEventListener(\"click\", () => {\r\n game(\"p\");\r\n resetUserRPS();\r\n showUserPaper_div.style.display = \"block\";\r\n checkWhoWon();\r\n });\r\n scissors_div.addEventListener(\"click\", () => {\r\n game(\"s\");\r\n resetUserRPS();\r\n showUserScissors_div.style.display = \"block\";\r\n checkWhoWon();\r\n });\r\n\r\n}","function display() {\n\n doSanityCheck();\n initButtons();\n}","function initialize() {\n $(\"#begin-btn\").html(\"\");\n\n }","function startGame() {\n startButton.classList.add(\"hide-content\");\n resetButton.classList.remove(\"hide-content\");\n $(\"#turnsTaken\").text(\"0\");\n originalColor();\n beginGame();\n}","function selectTypeGame(){\r\n\r\n inputs.forEach(input => input.value = \"\");//clean all imputs\r\n //if the user want to play with other user\r\n if(this.id === '2user'){\r\n //run the btnGame's logic\r\n containerModeGame.style.display = 'none';\r\n containerForm.style.display = 'block';\r\n\r\n //if the user want to play with the computer\r\n }else if(this.id === 'computerUser'){\r\n const userSelects = document.querySelectorAll('.userSelect');//btns X or O\r\n const userPrime = document.getElementById('userPrime');// input user name\r\n \r\n containerModeGame.style.display = 'none';\r\n containerPlayWithComputer.style.display = 'block'\r\n\r\n \r\n userSelects.forEach(userSelect => userSelect.addEventListener('click',(e)=>{\r\n \r\n if(userPrime.value.length === 0){//checks if the input is empty\r\n \r\n userPrime.parentNode.lastElementChild.textContent = 'User name cannot be empty';// write the message in the div\r\n //input.parentNode.lastElementChild.classList.add('alert');//add the alert class to the div\r\n\r\n userPrime.classList.add('input-alert');//add the input-alert class to the input\r\n\r\n } else {\r\n \r\n value1 = e.target.id === 'userX'? 'X':'O';\r\n value2 = value1 === 'X'? 'O':'X';\r\n\r\n //creating the user objects\r\n user1V = Object.assign(user1V,newUser(userPrime.value,true,value1));\r\n user2V = Object.assign(user2V,newUser('Computer',false,value2));\r\n\r\n \r\n containerPlayWithComputer.style.display = 'none';\r\n containerGame.style.display = 'block';\r\n\r\n //call the game; gameTicTacToe it's a module now \r\n const gameTicTacToe = game();\r\n\r\n\r\n gameTicTacToe.newGrid();\r\n gameTicTacToe.renderGrid();\r\n \r\n }\r\n\r\n \r\n }))\r\n\r\n }\r\n}","function initGame() {\n correctGuesses = 0;\n incorrectGuesses = 0;\n gameInProgress = false;\n $(\"#gameStart\").html(\"\")\n .click(playGame);\n}","function game() {\n document.querySelector(\"#gameStartModal\").style.display = \"none\";\n document.querySelector(\"#header section#level\").style.display = \"block\";\n document.querySelector(\"#header section#start\").style.display = \"block\";\n init();\n // The game loop.\n update();\n}","function startGame() {\r\n\r\n\tvar playerName = document.getElementById(\"playername\").value;\r\n\t\r\n\tif (playerName == \"\") {\r\n\t\treturn false;\r\n\t}else{\r\n\t\r\n\t\t// Store player name in pName variable\r\n\t\tpName = playerName;\r\n\t\t// Remove display of the intro screen\r\n\t\tdocument.getElementById(\"intro\").style.display = \"none\";\r\n\t\t// Add event listeners controls\r\n\t\taddControls();\r\n\t\t//Sounds.moon.play();\r\n\t}\r\n\r\n\r\n}","function startGame() {\n currentScoreDisplay.textContent = 0;\n player1Score.textContent = 0;\n player2Score.textContent = 0;\n player = Math.floor(Math.random() * 2) + 1;\n gameStarted = true;\n showPlayer(player);\n displayScores();\n}","function startNewGame(evt) {\n 'use strict';\n document.getElementById(\"gameDiv\").innerHTML = \"\";\n var menuDiv = document.getElementById(\"menuControls\");\n \n /* Variables for current player & last play to reset */\n var lastPlayDisplay = document.getElementById(\"lastPlayMade\");\n var currentPlayerDisp = document.getElementById('currentPlayer');\n lastPlayDisplay.innerHTML = \"\";\n currentPlayerDisp.innerHTML = \"\";\n \n menuDiv.innerHTML = \"\";\n document.getElementById(\"gameStatus\").style.display = \"none\";\n \n var newGameEntry = document.getElementById(\"userEntry\");\n newGameEntry.innerHTML = \"Player One Designation:
    \";\n newGameEntry.innerHTML += \"Player Two Designation:
    \";\n \n var plyrOneName = document.getElementById(\"plyrOneName\");\n var plyrTwoName = document.getElementById(\"plyrTwoName\");\n addHandler(plyrOneName, 'input', playerNameChange);\n addHandler(plyrTwoName, 'input', playerNameChange);\n \n var startGameBtn = document.getElementById(\"startGameBtn\");\n addHandler(startGameBtn, 'click', generateGameGrid);\n}","function startGame() {\n\t$(\"#start-button\", \"#menu\").click(function(){\n\t\tif (sess_token == null) {\n\t\t\treturn;\n\t\t}\n\t\tbutton_lock = true;\n\t\tdocument.getElementById(\"question-answer-container\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"stats\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"menu\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"reset-button\").style.visibility = \"visible\";\n\t\tgetQuestion(\"easy\");\n\t}); \n}","function startGame() {\n let gameBoard = document.getElementById('gameBoard');\n let tutorial = document.getElementById('tutorial');\n gameBoard.style.display = \"block\";\n tutorial.style.display = \"none\";\n addGround();\n addTree(treeCenter, trunkHeight);\n addBush(bushStart);\n addStones(stoneStart);\n addCloud(cloudStartX, cloudStartY);\n addingEventListenersToGame();\n addingEventListenersToTools();\n addInventoryEventListeners()\n}","function NewGame() {\n\t// Your code goes here for starting a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}","function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }","function createUser (){\n\t//create user and get names from the user\n\tuser.townName = document.getElementById('townName').value;\n\tuser.character = document.getElementById('charName').value;\n\n\t//hide the user creation div and show the output div\n\t\n\tdocument.getElementById('outputDiv').style.display='block';\n\tdocument.getElementById('descriptionDiv').style.display='block';\n\tdocument.getElementById('textEntryDiv').style.display='block';\n\tdocument.getElementById('inputDiv').style.display='none';\n \n\t//Inititalize stuff\n\tclear();\n\tcreateItems();\n\tcreatePeople();\n\tcreateLocations();\n\tconnectLocations();\n\tgoTo(downtown); //Start the user in this location\n\t\n\t//Welcome the user\n\tdocument.getElementById('outputDiv').innerHTML=\n\t'Welcome to ' + user.townName + ', have fun playing our game ' + user.character + '! ' + user.townName + ' is divided into three sections Uptown, the Shopping District, and Downtown.';\n }","function startGame(){\n\t\tfor (var i=1; i<=9; i=i+1){\n\t\t\tclearBox(i);\n\t\t}\n\t\tdocument.turn = \"X\";\n\t\tif (Math.random()<0.5) {\n\t\t\tdocument.turn = \"O\";\n\t\t}\n\t\tdocument.winner = null;\n\t// This uses the \"setMessage\" function below in order to update the message with the contents from this function\n\t\tsetMessage(document.turn + \" gets to start.\");\n\t}","function displayUI() {\n /*\n * Be sure to remove any old instance of the UI, in case the user\n * reloads the script without refreshing the page (updating.)\n */\n $('#plugbot-ui').remove();\n\n /*\n * Generate the HTML code for the UI.\n */\n $('#chat').prepend('
    ');\n var cWoot = autowoot ? \"#3FFF00\" : \"#ED1C24\";\n var cQueue = autoqueue ? \"#3FFF00\" : \"#ED1C24\";\n var cHideVideo = hideVideo ? \"#3FFF00\" : \"#ED1C24\";\n var cUserList = userList ? \"#3FFF00\" : \"#ED1C24\";\n $('#plugbot-ui').append(\n '

    auto-woot

    auto-queue

    hide video

    userlist

    Custom Username FX:

    + add new

    ');\n}","function renderPlayer(){\n console.log('in renderPlayer')\n let text;\n if (!state.players[0] || !state.players[1]){\n text = `\n \n \n \n `\n } else {\n text = `${state.getCurrentPlayer()} place a token!`\n }\n playerTurn.innerHTML= text;\n }","static showGame() {\n document.getElementById('js-player-selection').style.display = 'none';\n document.getElementById('js-game-info').style.display = 'block';\n }","showStartButton() {\n let startButton = document.createElement(\"button\");\n startButton.innerHTML = \"Start\";\n startButton.addEventListener(\"click\", function () {\n game.deleteStartButton();\n game.showTitle();\n game.showReply();\n game.showForm();\n });\n startButton.classList.add(\"start\");\n this.main.appendChild(startButton);\n }","function startGame(player1Name, player2Name, difficultySetting) {\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \n window.gameboard = new Gameboard(difficultySetting); \n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\n $('#grid-container-body').removeClass('hide');\n setTimeout(hideWelcomeModal, 500);\n }","function beginGame() {\n gameConsole.innerHTML = \"\";\n\n// Prompt player name\nplayer1Name = prompt('Please input your name');\n\n// and change it in the HTML\n document.getElementById('player-1-name').innerHTML = player1Name;\n\n// explain the rules for the opening puzzle\n gameConsole.innerHTML = 'Thanks ' + player1Name + '. The opening puzzle will begin. There will be one word up above that will fill in slowly. Click the buzzer of the opportunity to guess correctly. A correct guess will net you 50 points, and control of the first board. Guessing incorrectly will give the opponent the points and control. Good luck, and click the start button to begin.';\n\n// modify the start button to initialize the pizzle as oppose to beginning the game\n\tappendOutputConsole('div', '', 'flex-container justify-center');\n}","function startGame() {\n printStats();\n console.log(\"Game Started\");\n getGamePick();\n console.log(gPick);\n document.getElementById('Title').innerHTML=\"Great, now it is you turn pick a letter a-z\"; \n }","function clickToStart(){\n if (gameStarted === false) {\n $(\"#win-count\").text(wins);\n $(\"#loss-count\").text(wins);\n $(\"#win-header\").text(\"wins\");\n $(\"#loss-header\").text(\"losses\");\n $(\"#number-to-guess\").text(targetNumber);\n $(\"#userCounter\").text(counter);\n $(\"#clickToStart\").addClass(\"isHidden\");\n generateRupees();\n gameStarted = true;\n } \n \n }","function gameStart(){\n\t\tplayGame = true;\n\t\tmainContentRow.style.visibility = \"visible\";\n\t\tscoreRow.style.visibility = \"visible\";\n\t\tplayQuitButton.style.visibility = \"hidden\";\n\t\tquestionPool = getQuestionPool(answerPool,hintPool);\n\t\tcurrentQuestion = nextQuestion();\n}","function displayPlayer(turn, player) {\n turn.html('It is player '+player+'\\'s turn');\n }","function displayPlayers() {\n $('#userNameBox').text(human.name)\n $('#userSymbolBox').text(human.symbol)\n $('#compNameBox').text(ai.name)\n $('#compSymbolBox').text(ai.symbol)\n}","displayBoard(message) {\n $('.menu').css('display', 'none');\n $('.gameBoard').css('display', 'block');\n $('#userHello').html(message);\n this.createGameBoard();\n }","function start(){\n //hide game and error message\n document.getElementById(\"error-message\").classList.add(\"hidden\");\n document.getElementById(\"game\").classList.add(\"hidden\");\n\n //add event listener to start button to trigger game\n\tvar start = document.getElementById(\"intro\").firstChild.nextSibling;\n start.addEventListener('click', game);\n}","function showLoggedInUser(user) {\n login_status.text(\"Logged in as: \" + user.profile.name);\n login_button.text(\"Logout\");\n }","function startGame() {\n $controls.addClass(\"hide\");\n $questionWrapper.removeClass(\"hide\");\n showQuestion(0, \"n\");\n points();\n}","create () {\n var background = this.game.add.sprite(0, 0, 'space');\n background.height = this.game.height;\n var button = this.game.add.button(this.game.world.centerX - 100, 100, 'start', start,this);\n button.angle = -30;\n\n this.userName = ''; //Initializes name\n \n \n var scoreText = this.game.add.text(0, 500, 'You Lost!', {fontsize: '32px', fill: '#ffffff', boundsAlignH: \"center\"});\n scoreText.text = \"You Lost! Score: \" + this.scoreValue + \"\\n(Click Alex's face or \\npress enter to play again)\";\n scoreText.setTextBounds(0, 100, 800);\n\n this.nameText = this.game.add.text(200, 800, 'Submit Name to Leaderboard: \\n(Enter to Submit)', {fontsize: '32px', fill: '#ffffff'});\n //Retrieve keyboard presses from the player\n this.game.input.keyboard.addCallbacks(this, null, null, keyPress);\n this.textInput = this.game.add.text(this.game.world.centerX + 5, 575, \"\", {\n font: \"28px Arial\",\n fill: \"#000\",\n align: \"center\"\n });\n this.textInput.setText(this.textInput.text);\n this.textInput.anchor.setTo(0.5, 0.5);\n\n function keyPress(char) {\n this.userName += char;\n }\n\n //Keys for backspace and enter\n this.deleteKey = this.game.input.keyboard.addKey(Phaser.Keyboard.BACKSPACE);\n this.enterKey = this.game.input.keyboard.addKey(Phaser.Keyboard.ENTER);\n this.game.input.keyboard.addKeyCapture([ Phaser.Keyboard.BACKSPACE, Phaser.Keyboard.ENTER ]);\n\n //Detect backspaces when typing the name\n this.deleteKey.onDown.add(deleteText, this);\n\n //allows user to delete characters\n function deleteText() {\n if (this.userName !== '') {\n this.userName = this.userName.slice(0, this.userName.length - 1);\n }\n }\n\n //Detect Enter when typing the name\n this.enterKey.onDown.add(start, this);\n\n\n //Send to Firebase Here\n function start() {\n if (this.userName === '') {\n this.userName = 'Alex';\n }\n var newScore = {ScoreValue: this.scoreValue, UserName: this.userName};\n scoresData.push(newScore);\n\n this.userName = '';\n this.state.start('Game');\n }\n }","function startGame()\n{\n\tcreateDeck();\n\tshuffleDeck();\n\tcreatePlayers(2);\n\n\tdrawCard(0, 0);\n\tdrawCard(1, 0);\n\tdrawCard(0, 0);\n\tdrawCard(1, 0);\n\n\n\n\tdisplayCards();\n\tdisplayOptions();\n}","display(title) {\r\n this.title.html(title);\r\n this.title.position(130, 0);\r\n if (this.playButton, this.inputbox) {\r\n this.inputbox.position(130, 160);\r\n\r\n this.playButton.position(250, 200);\r\n\r\n this.playButton.mousePressed(() => {\r\n this.inputbox.hide();\r\n this.playButton.hide();\r\n playerObj.name = this.inputbox.value();\r\n gameState = 1;\r\n this.greeting.html(\"Welcome \" + playerObj.name);\r\n this.greeting.position(200, 250);\r\n });\r\n }\r\n }","function startGame() {\n\tdisplayCharacterStats(null);\n\n\treturn;\n}","function startGame() {\n createButtons();\n createCards();\n}","function startGame() {\n createButtons();\n createCards();\n}"],"string":"[\n \"function showGamificationButton(names, urls) {\\n\\n //////////////////////////\\n // REMOVE OLD BUTTONS\\n /////////////////////////\\n const old_gameStartButton = document.getElementById('start_game_button'),\\n old_gameButton = document.getElementById('guess_game_button');\\n if (old_gameStartButton !== null && old_gameButton !== null) {\\n removeElements([old_gameStartButton]);\\n removeElements([old_gameButton]);\\n }\\n \\n // create a button\\n const gameButton = document.createElement('div'),\\n gameStartButton = document.createElement('div');\\n \\n gameStartButton.innerHTML = 'START';\\n gameStartButton.id = 'start_game_button';\\n entry_info.parentNode.insertBefore(gameStartButton, entry_info.nextSibling);\\n\\n // assign an id to it\\n gameButton.id = 'guess_game_button';\\n\\n // insert text\\n gameButton.innerHTML = 'Guess The Plants';\\n\\n // append it next to the pages div tag as a next sibling element\\n pages.parentNode.insertBefore(gameButton, pages.nextSibling);\\n\\n // add a mouseup event listener to the buttons\\n gameButton.addEventListener('mouseup', () => {\\n \\n showGameEntry(urls);\\n });\\n gameStartButton.addEventListener('mouseup', () => {\\n\\n // if the text field for username input is not empty\\n if (username.value !== '') {\\n\\n // hide the game start button\\n gameStartButton.style.visibility = 'hidden';\\n \\n // set the container to be fullscreen\\n game_entry.style.setProperty('transform', 'translate(0, 0)', 'important');\\n game_entry.style.setProperty('width', '100%', 'important');\\n game_entry.style.setProperty('height', '100%', 'important');\\n\\n turns++;\\n init(names, urls);\\n }\\n });\\n}\",\n \"function renderGame (){\\n\\n //setup new instructions\\n var newInst = $(\\\"

    \\\");\\n newInst.text(\\\"Welcome back, \\\"+username);\\n newInst.addClass(\\\"col s12 center-align\\\");\\n $(\\\"#instructions\\\").html(newInst);\\n \\n $(\\\"#game\\\").show();\\n\\n $(\\\"#yourName\\\").text(username);\\n\\n\\n if(oppChoice){\\n $(\\\"#opponentChoice\\\").css(\\\"opacity\\\", \\\"1\\\");\\n } \\n // if you haven't chosen, set instructions to say choose\\n if (yourChoice){\\n $(\\\"#yourChoice\\\").css(\\\"background-image\\\", \\\"url('assets/images/\\\"+yourChoice+\\\".png')\\\");\\n $(\\\"#yourChoice\\\").css(\\\"opacity\\\", \\\"1\\\");\\n \\n // if you haven't chosen, show buttons \\n } else {\\n renderButtons();\\n }\\n\\n updateStatus();\\n}\",\n \"function useNewButton() {\\r\\n createUser();\\r\\n startPage()\\r\\n}\",\n \"function startGame(playerCount) {\\r\\n\\t\\r\\n\\tGC.initalizeGame(playerCount);\\r\\n\\t\\r\\n\\tUI.setConsoleHTML(\\\"The game is ready to begin! There will be a total of \\\" + GC.playerCount + \\\" players.
    Click to begin!\\\");\\r\\n\\tUI.clearControls();\\r\\n\\tUI.addControl(\\\"begin\\\",\\\"button\\\",\\\"Begin\\\",\\\"takeTurn()\\\");\\r\\n\\t\\r\\n\\tGC.drawPlayersOnBoard();\\r\\n}\",\n \"function startGame() {\\n\\tvar userName = $(\\\"#enterName\\\").val();\\n\\t$(\\\"#name\\\").text(userName);\\n\\t$(\\\"#startScreen\\\").addClass('hide');\\n\\tif($(\\\"#enterName\\\").val() != \\\"\\\") {\\n\\t\\tsetQuestion();\\n\\t} else {\\n\\t\\t$(\\\"#hint\\\").removeClass('initialHide');\\n\\t\\t$(\\\"#hint\\\").text(\\\"Please enter your username!\\\")\\n\\t}\\n\\n}\",\n \"function startGame(){\\r\\n var UserData;\\r\\n var userName = document.getElementById('nameEntry').value\\r\\n UserData = checkCookie(userName);\\r\\n updateTables(UserData);\\r\\n $('#Load').html(\\\"\\\");\\r\\n $('#saveGame').prop('disabled',false);\\r\\n enableTravel();\\r\\n}\",\n \"function startGame() {\\n $(\\\".landing-menu\\\").hide();\\n $(\\\".game-section\\\").show();\\n $(\\\".userButtons\\\").show();\\n }\",\n \"display(){\\r\\n var title = createElement('h1')\\r\\n title.html(\\\"car racing game!\\\")\\r\\n title.position(380,100)\\r\\n\\r\\n var input = createInput(\\\"Name\\\")\\r\\n var button = createButton(\\\"Play\\\")\\r\\n var greeting = createElement('h2')\\r\\n input.position(380,240)\\r\\n button.position(440,300)\\r\\n//when player pressed over the button player count is increased and updated\\r\\n//button and input is hidden\\r\\n//greeting message to the player is displayed\\r\\n\\r\\n button.mousePressed(function(){\\r\\n input.hide()\\r\\n button.hide()\\r\\n //.value()- gives the value that was passed inside the input\\r\\n var name = input.value()\\r\\n\\r\\n playerCount+=1\\r\\n player.update(name)\\r\\n player.updateCount(playerCount)\\r\\n\\r\\n greeting.html(\\\"hellow \\\"+name)\\r\\n greeting.position(380,250)\\r\\n\\r\\n })\\r\\n\\r\\n }\",\n \"function showTheGame () {\\n\\t$(\\\".game\\\").show();\\n\\t$(\\\".startNowButton\\\").hide();\\n\\trun();\\n}\",\n \"startGame() {\\n document.getElementById('homemenu-interface').style.display = 'none';\\n document.getElementById('character-selection-interface').style.display = 'block';\\n this.interface.displayCharacterChoice();\\n this.characterChoice();\\n }\",\n \"function onClickGameName() {\\n stopGame();\\n\\n socket.send({action: \\\"exit_game\\\"});\\n $(\\\"#game\\\").hide(); \\n $(\\\"#game_choose\\\").show(); \\n\\n initHome();\\n }\",\n \"function startGame() {\\n\\n $(\\\"#questionPage\\\").hide();\\n \\n $(\\\"#start\\\").show();\\n\\n var startButton = $(\\\"\\\").click(hostNewGame);\\n}\",\n \"function startGame(){\\n document.querySelector('.menu').style.display = \\\"none\\\";\\n addClicks();\\n score.querySelector('h2').innerText = ('Game Ready. Player 1 turn.');\\n}\",\n \"function startGame() {\\n gameState.active = true;\\n resetBoard();\\n gameState.resetBoard();\\n\\n var activePlayer = rollForTurn();\\n \\n // Game has started: enable/disable control buttons accordingly.\\n btnDisable(document.getElementById('btnStart'));\\n btnEnable(document.getElementById('btnStop'));\\n\\n var showPlayer = document.getElementById('showPlayer');\\n showPlayer.innerHTML = activePlayer;\\n showPlayer.style.color = (activePlayer === \\\"Player 1\\\") ? \\\"blue\\\" : \\\"red\\\";\\n // The above line, doing anything more would require a pretty sizeable refactor.\\n // I guess I could name \\\"Player 1\\\" with a constant.\\n}\",\n \"function showLobby() {\\n battlefield.innerHTML = '';\\n gamesList.classList.remove('hidden');\\n updateBtn(actionBtn, ACTION_BTN.CREATE_GAME);\\n resetHeader();\\n }\",\n \"function getName() {\\n applicationState.user = userName.value;\\n document.getElementById(\\n \\\"userinfo\\\"\\n ).innerHTML = `welcome ${applicationState.user}`;\\n applicationState.gameStart = true;\\n startTime = Date.now();\\n}\",\n \"function start(){\\n c.style.display = \\\"none\\\"\\n d.style.display = \\\"block\\\"\\n document.querySelector(\\\"#user\\\").innerHTML= name + \\\" :\\\"\\n}\",\n \"function initiateGame(){\\n\\n\\t$( document ).ready( function() {\\n\\t\\t\\n\\t\\t$( '#display' ).html('');\\n\\t\\t$( '#display' ).attr('start', 'start');\\n\\t\\t$( '#display' ).on( 'click', function() {\\n\\t\\t\\trenderGame();\\n\\t\\t})\\n\\t\\t\\n\\t});\\n}\",\n \"static startGameOnClick(){\\n $('#imageIndex').on('click', function(event){\\n var imageId = parseInt(event.target.id.replace(\\\"image\\\", \\\"\\\"))\\n let userName = $('#username').val()\\n userName === \\\"\\\" ? userName = \\\"Guest\\\" : userName\\n startGame(imageId, userName)\\n })\\n }\",\n \"function newGameUser() {\\n var btn = document.getElementById(\\\"testName\\\");\\n btn.addEventListener(\\\"click\\\", function() {\\n userName = this.form.username.value;\\n changeUserText(userName);\\n this.form.username.value = \\\"\\\";\\n testLocal();\\n });\\n}\",\n \"function startGame()\\r\\n{\\r\\n // alert(\\\"The last straw \\\");\\r\\n\\r\\n isGameEnded = false ;\\r\\n playerName = prompt (\\\"What's your name ? \\\",\\\"Paul Tibbets\\\");\\r\\n statusMessage = \\\"Welcome, \\\"+playerName+\\\"!\\\" ;\\r\\n updateStatusMessage(statusMessage, 1) ;\\r\\n document.getElementById(\\\"name1\\\").innerHTML = playerName+\\\"'s Caption\\\" ;\\r\\n /* Empty the board contents */\\r\\n emptyBoard();\\r\\n\\r\\n /* Place the board at random for both computer and player */\\r\\n placeBoard();\\r\\n\\r\\n statusMessage = \\\"Hit me with your best shot, \\\"+playerName;\\r\\n updateStatusMessage(statusMessage, 2) ;\\r\\n\\r\\n}\",\n \"function GameUI() {}\",\n \"function screenPlayers()\\n{\\n\\tshowScreen(\\\"players_choice\\\", \\\"Choix des joueurs\\\", function()\\n\\t{\\n\\t\\tnbPlayers = 0;\\n\\n\\t\\tplayersList = [];\\n\\n\\t\\tdelete teamId;\\n\\n\\t\\tshowNext(\\\"Comptage\\\", function()\\n\\t\\t{\\n\\t\\t\\tconsole.log(\\\"Go vers le comptage !!!\\\");\\n\\t\\t});\\n\\n\\t\\t$.ajax(\\n\\t\\t{\\n\\t\\t\\turl: serverUrl + \\\"queries.php\\\",\\n\\t\\t\\ttype: \\\"POST\\\",\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdata:\\n\\t\\t\\t{\\n\\t\\t\\t\\tfunc: \\\"get_user\\\"\\n\\t\\t\\t}\\n\\t\\t}).done(function(data)\\n\\t\\t{\\n\\t\\t\\tvar users = eval(data);\\n\\n\\t\\t\\tvar slide = $(\\\"
    \\\").attr(\\\"id\\\", \\\"users_slide\\\");\\n\\n\\t\\t\\tvar currentDiv = $(\\\"
    \\\");\\n\\n\\t\\t\\tfor(var user in users)\\n\\t\\t\\t{\\n\\t\\t\\t\\tif(user % 6 == 0 && user != 0)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tslide.append(currentDiv);\\n\\n\\t\\t\\t\\t\\tcurrentDiv = $(\\\"
    \\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tcurrentDiv.append(userSwitch(users[user]));\\n\\t\\t\\t}\\n\\n\\t\\t\\tslide.append(currentDiv);\\n\\n\\t\\t\\t$(\\\".wrapper\\\").append(slide);\\n\\n\\t\\t\\t$(\\\"#users_slide\\\").slick(\\n\\t\\t\\t{\\n\\t\\t\\t\\tdots: true,\\n\\t\\t\\t\\tinfinite: false\\n\\t\\t\\t});\\n\\n\\t\\t\\taddUserClickAction();\\n\\n\\t\\t\\tvar usersChoiceButtons = $(\\\"
    \\\").attr(\\\"id\\\", \\\"users_choice_buttons\\\");\\n\\n\\t\\t\\tvar ajouterButton = button(\\\"\\\").addClass(\\\"invisible\\\");\\n\\n\\t\\t\\tvar commencerButton = button(\\\"Commencer\\\").attr(\\\"id\\\", \\\"commencer\\\").addClass(\\\"disable\\\");\\n\\n\\t\\t\\tusersChoiceButtons.append($(\\\"
    \\\").append(ajouterButton));\\n\\n\\t\\t\\tusersChoiceButtons.append($(\\\"
    \\\").append(commencerButton));\\n\\n\\t\\t\\t$(\\\".wrapper\\\").append(usersChoiceButtons);\\n\\n\\t\\t\\thideLoader();\\n\\t\\t});\\n\\t});\\n}\",\n \"function gamestart() {\\n\\t\\tshowquestions();\\n\\t}\",\n \"function initGame(){\\n gamemode = document.getElementById(\\\"mode\\\").checked;\\n \\n fadeForm(\\\"user\\\");\\n showForm(\\\"boats\\\");\\n \\n unlockMap(turn);\\n \\n player1 = new user(document.user.name.value);\\n player1.setGrid();\\n \\n turnInfo(player1.name);\\n bindGrid(turn);\\n}\",\n \"startGame() {\\r\\n\\t\\tthis.board.drawHTMLBoard();\\r\\n\\t\\tthis.activePlayer.activeToken.drawHTMLToken();\\r\\n\\t\\tthis.ready = true;\\r\\n\\t}\",\n \"function playersOnClick () {\\n module.exports.internal.stateManager.showState('main-branch', 'pick-a-player')\\n}\",\n \"function startGame() {\\n showGuessesRemaining();\\n showWins();\\n}\",\n \"function startGame() {\\n console.log('start button clicked')\\n $('.instructions').hide();\\n $('.title').show();\\n $('.grid_container').show();\\n $('.score_container').show();\\n $('#timer').show();\\n // soundIntro('sound/Loading_Loop.wav');\\n }\",\n \"function startGame() {\\n //hide the deal button\\n hideDealButton();\\n //show the player and dealer's card interface\\n showCards();\\n //deal the player's cards\\n getPlayerCards();\\n //after brief pause, show hit and stay buttons\\n setTimeout(displayHitAndStayButtons, 2000);\\n }\",\n \"function start_game(){\\r\\n if(name_input.value==\\\"\\\"){\\r\\n enter_name_alert.style=\\\"visibility: visible;\\\"\\r\\n }\\r\\n else{\\r\\n enter_name_alert.style=\\\"visibility: hidden;\\\"\\r\\n first_layer.style.display=\\\"none\\\"\\r\\n user_name.innerHTML=name_input.value+' '\\r\\n }\\r\\n}\",\n \"function startGame() {\\n setMessage(player1 + ' gets to start.');\\n}\",\n \"function startGame() {\\n\\t\\tstatus.show();\\n\\t\\tinsertStatusLife();\\n\\t\\tsetLife(100);\\n\\t\\tsetDayPast(1);\\n\\t}\",\n \"function changeUser() {\\n var choice = Math.floor(Math.random() * name.length);\\n document.getElementById(\\\"user\\\").innerHTML = name[choice];\\n document.getElementById(\\\"userBtn\\\").innerHTML = name[choice];\\n document.getElementById(\\\"userDrop\\\").innerHTML = name[choice];\\n drawTextAndResize(name[choice]);\\n}\",\n \"function showButtons() {\\n // when users are not connected, we want start game button disabled\\n // document.getElementById('start-game').style.display = 'inline';\\n\\n document.getElementById('button-invite').style.display = 'inline';\\n // document.getElementById('button-preview').style.display = 'inline';\\n document.getElementById('grab-username').style.display = 'inline';\\n document.getElementById('username').style.display = 'inline';\\n document.getElementById('invite-to').style.display = 'inline';\\n\\n // document.getElementById('end-call').style.display = 'none';\\n\\n // ensure that local media removes on firefox\\n $('#local-media > video').remove();\\n }\",\n \"function startGame() {\\n createButtons();\\n const cards = createCardsArray();\\n appendCardsToDom(cards);\\n}\",\n \"function startGame() {\\n setMessage(\\\"Select an opponent above\\\");\\n}\",\n \"function menu() {\\n\\t\\n // Title of Game\\n title = new createjs.Text(\\\"Poker Room\\\", \\\"50px Bembo\\\", \\\"#FF0000\\\");\\n title.x = width/3.1;\\n title.y = height/4;\\n\\n // Subtitle of Game\\n subtitle = new createjs.Text(\\\"Let's Play Poker\\\", \\\"30px Bembo\\\", \\\"#FF0000\\\");\\n subtitle.x = width/2.8;\\n subtitle.y = height/2.8;\\n\\n // Creating Buttons for Game\\n addToMenu(title);\\n addToMenu(subtitle);\\n startButton();\\n howToPlayButton();\\n\\n // update to show title and subtitle\\n stage.update();\\n}\",\n \"function win () { \\n style = { font: \\\"65px Arial\\\", fill: \\\"#fff\\\", align: \\\"center\\\" };\\n game.add.text(game.camera.x+325, game.camera.y+150, \\\"You Win!\\\", style);\\n button = game.add.button(game.camera.x+275, game.camera.y+250, 'reset-button', actionOnResetClick, this);\\n button = game.add.button(game.camera.x+475, game.camera.y+250, 'contact-button', actionOnContactClick, this); \\n // The following lines kill the players movement before disabling keyboard inputs\\n player.body.velocity.x = 0;\\n setTimeout(game.input.keyboard.disabled = true, 1000); \\n // Plays the victory song \\n victory.play('');\\n // When the Reset button is clicked, it calls this function, which in turn calls the game to be reloaded.\\n // Here we display the contact and replay button options, calling either respective function\\n function actionOnResetClick () {\\n gameRestart();\\n }\\n\\n // When the contact button is clicked it redirects through to contact form\\n function actionOnContactClick () {\\n\\n window.location = (\\\"/contacts/\\\" + lastName)\\n \\n } \\n }\",\n \"function startGame(){\\n\\t$( \\\"#button_game0\\\" ).click(function() {selectGame(0)});\\n\\t$( \\\"#button_game1\\\" ).click(function() {selectGame(1)});\\n\\t$( \\\"#button_game2\\\" ).click(function() {selectGame(2)});\\n\\tloadRound();\\n}\",\n \"function displayStart(){\\n\\t// Display game start button again\\n\\t$('#game').append(\\\"
    \\\");\\n\\t$(\\\"#start\\\").unbind();\\n\\t$(\\\"#start\\\").click(startGame);\\n\\t// Play main theme song again\\n\\tmarioGame.audMainTheme.play();\\n}\",\n \"function switchToGameBoard(){\\n\\t\\tif(userlist.length === 0){\\n\\t\\t\\tturnService.showWaitingAlert();\\n\\t\\t}\\n\\t\\t$userLoginArea.hide();\\n\\t\\t$pageWrapper.show();\\n\\t\\t$currentPhrase.hide();\\n\\t}\",\n \"function startGame() {\\n \\n $(\\\"#start-button\\\").html(\\\"\\\");\\n $(\\\"#start-button\\\").on('click', function () {\\n $(\\\"#start-button\\\").remove();\\n startTimer();\\n getQuestion();\\n });\\n }\",\n \"function startScreen() {\\n\\tdraw();\\n\\tif(usuario_id !== -1)\\n\\t\\tstartBtn.draw();\\n}\",\n \"function startGame() {\\n\\t\\ttheBoxes.innerText = turn;\\n\\t\\twinner = null;\\n\\t}\",\n \"function startGame() {\\n\\tvar serverMsg = document.getElementById('serverMsg');\\n\\tdocument.getElementById('print').disabled = false;\\n\\tserverMsg.value += \\\"\\\\n> all players have joined, starting game, wait for your turn...\\\"\\n\\tdocument.getElementById('rigger').style.display = \\\"none\\\";\\n}\",\n \"function joined(e) {\\n userId = e.id;\\n $('#controls').show();\\n startPrompts();\\n}\",\n \"function startGame() {\\n\\n game.updateDisplay();\\n game.randomizeShips();\\n $(\\\"#resetButton\\\").toggleClass(\\\"hidden\\\");\\n $(\\\"#startButton\\\").toggleClass(\\\"hidden\\\");\\n game.startGame();\\n game.updateDisplay();\\n saveGame();\\n}\",\n \"function updateStartGameButtonVisibility() {\\n //find out if current user is the creator\\n var isCreator = (gameInfo.username === gameInfo.gameID);\\n //get number of players\\n var numPlayers = gameInfo.currentPlayers.length;\\n\\n if (isCreator && (numPlayers >= minNumberOfPlayers)) {\\n //this is the game creator and there are enough players. Show start game option\\n $(\\\"#startGameButton\\\").show();\\n } else {\\n //hide or keep hidden the startGameButton in all other cases\\n $(\\\"#startGameButton\\\").hide();\\n }\\n}\",\n \"function startNewGame(text){\\n\\n\\t//console.log('start new game!');\\n\\n\\ttext.destroy();\\n\\n\\t//not very elegant but it does the job\\n\\tvar playerName = prompt(\\\"What's your name?\\\", \\\"Cloud\\\");\\n\\n\\t//store player name in cache to be shown on in-game HUD\\n\\tlocalStorage.setItem(\\\"playerName\\\", playerName);\\n\\n\\tthis.game.state.start('Game');\\n}\",\n \"function startGameButton() {\\r\\n\\tif(table != undefined) {\\r\\n\\t\\ttable.startGame();\\r\\n\\t}\\r\\n}\",\n \"function login() {\\n Player.name = $(\\\"#login_name\\\").val();\\n $(\\\"#console\\\").hide();\\n start_game();\\n}\",\n \"function beginApp() {\\n console.log('Please build your team');\\n newMemberChoice();\\n}\",\n \"function getFirstPlayer(){\\n var firstRound = (Math.floor(Math.random() * 10) + 1)%2;\\n turnsPlayer = turnsPlayer + firstRound;\\n //display the current turn:\\n if (turnsPlayer%2 == 0){\\n currentPlayer = user.userx.name;\\n } else {\\n currentPlayer = user.usero.name;}\\n $(\\\"#button2\\\").on(\\\"click\\\", function(){\\n $(\\\"p\\\").text(\\\"Player \\\" + currentPlayer + \\\"'s turn\\\");\\n });\\n }\",\n \"function populatepage(){\\n \\n document.getElementById('signedNamePlace').innerHTML = \\\"User: \\\";\\n document.getElementById('signedName').innerHTML = username;\\n document.getElementById('firstbtn').style.visibility = \\\"visible\\\";\\n document.getElementById('simplebtn').style.visibility = \\\"visible\\\";\\n}\",\n \"function handleStartClick() {\\n toggleButtons(true); // disable buttons\\n resetPanelFooter(); // reset panel/footer\\n\\n for (let id of ['player-panel', 'ai-panel', 'enemyboard', 'ai-footer', 'player-footer']) {\\n document.getElementById(id).classList.remove(\\\"hidden\\\");\\n }\\n\\n game = new Game(settings.difficulty, settings.playerBoard);\\n game.start();\\n}\",\n \"update() {\\n this.nameText.text = 'Submit Name to Leaderboard:\\\\n ' + this.userName + '\\\\n(Submits on New Game)';\\n\\n }\",\n \"function initializeGame(){\\n if (typeof playerOne === \\\"undefined\\\"){\\n $(\\\"section#game-section .game .game-wrapper\\\").text(\\\"Player One to Sign Up\\\");\\n\\n }else if(typeof playerTwo === \\\"undefined\\\") {\\n $(\\\"section#game-section .game .game-wrapper\\\").text(\\\"Player Two to Sign Up\\\");\\n }else{\\n $(\\\"section#game-section .game .game-wrapper\\\").text(\\\"Game will start shortly \\\");\\n $(\\\"section#game-section .game .game-wrapper\\\").append(playerTwo.name+' vs '+playerOne.name);\\n startGame();\\n assignStartTurn();\\n }\\n}\",\n \"function aboutGame(){\\n\\tvar temp=\\\"\\\";\\n\\tvar img=\\\"\\\";\\n\\tvar Title=\\\"\\\";\\n\\t/// if we clicked on about the game formate about game text \\n\\tif(this.id === 'abutBtn'){\\n\\t\\ttemp =window.gameInformation['abutBtn'];\\n\\t\\timg='\\\\rrecources\\\\\\\\AF005415_00.gif';\\n\\t\\tTitle=\\\" Game General Information \\\";\\n\\n\\t}////// if we clicked on about the game formate about auther text \\n\\telse if(this.id === 'abouMe'){\\n\\t\\ttemp =window.gameInformation['abouMe'];\\n\\t\\timg='\\\\rrecources\\\\\\\\viber_image_2019-09-26_23-29-08.jpg';\\n\\t\\tTitle=\\\" About The Auther\\\";\\n\\t}// formatting Text For Instructions\\n\\telse if(this.id === 'Instructions')\\n\\t{\\n\\t\\ttemp =window.gameInformation['Instructions'];\\n\\t\\timg='\\\\rrecources\\\\\\\\keyboard-arrows-512.png';\\n\\t\\tTitle=\\\" Instructions\\\";\\n\\t}\\n\\n\\t// create the dialog for each button alone\\n\\tcreatDialog(Title , temp ,img,300 );\\n\\t\\n}\",\n \"function startGame() {\\n const usernameField = document.querySelector(\\\".username-field\\\");\\n playerName = usernameField.value;\\n hideGameIntroModal();\\n fetch(\\\"headlines.json\\\")\\n .then(response => response.json())\\n .then(data => selectStories(data));\\n}\",\n \"function main() {\\r\\n rock_div.addEventListener(\\\"click\\\", () => {\\r\\n game(\\\"r\\\");\\r\\n resetUserRPS();\\r\\n showUserRock_div.style.display = \\\"block\\\";\\r\\n checkWhoWon();\\r\\n });\\r\\n paper_div.addEventListener(\\\"click\\\", () => {\\r\\n game(\\\"p\\\");\\r\\n resetUserRPS();\\r\\n showUserPaper_div.style.display = \\\"block\\\";\\r\\n checkWhoWon();\\r\\n });\\r\\n scissors_div.addEventListener(\\\"click\\\", () => {\\r\\n game(\\\"s\\\");\\r\\n resetUserRPS();\\r\\n showUserScissors_div.style.display = \\\"block\\\";\\r\\n checkWhoWon();\\r\\n });\\r\\n\\r\\n}\",\n \"function display() {\\n\\n doSanityCheck();\\n initButtons();\\n}\",\n \"function initialize() {\\n $(\\\"#begin-btn\\\").html(\\\"\\\");\\n\\n }\",\n \"function startGame() {\\n startButton.classList.add(\\\"hide-content\\\");\\n resetButton.classList.remove(\\\"hide-content\\\");\\n $(\\\"#turnsTaken\\\").text(\\\"0\\\");\\n originalColor();\\n beginGame();\\n}\",\n \"function selectTypeGame(){\\r\\n\\r\\n inputs.forEach(input => input.value = \\\"\\\");//clean all imputs\\r\\n //if the user want to play with other user\\r\\n if(this.id === '2user'){\\r\\n //run the btnGame's logic\\r\\n containerModeGame.style.display = 'none';\\r\\n containerForm.style.display = 'block';\\r\\n\\r\\n //if the user want to play with the computer\\r\\n }else if(this.id === 'computerUser'){\\r\\n const userSelects = document.querySelectorAll('.userSelect');//btns X or O\\r\\n const userPrime = document.getElementById('userPrime');// input user name\\r\\n \\r\\n containerModeGame.style.display = 'none';\\r\\n containerPlayWithComputer.style.display = 'block'\\r\\n\\r\\n \\r\\n userSelects.forEach(userSelect => userSelect.addEventListener('click',(e)=>{\\r\\n \\r\\n if(userPrime.value.length === 0){//checks if the input is empty\\r\\n \\r\\n userPrime.parentNode.lastElementChild.textContent = 'User name cannot be empty';// write the message in the div\\r\\n //input.parentNode.lastElementChild.classList.add('alert');//add the alert class to the div\\r\\n\\r\\n userPrime.classList.add('input-alert');//add the input-alert class to the input\\r\\n\\r\\n } else {\\r\\n \\r\\n value1 = e.target.id === 'userX'? 'X':'O';\\r\\n value2 = value1 === 'X'? 'O':'X';\\r\\n\\r\\n //creating the user objects\\r\\n user1V = Object.assign(user1V,newUser(userPrime.value,true,value1));\\r\\n user2V = Object.assign(user2V,newUser('Computer',false,value2));\\r\\n\\r\\n \\r\\n containerPlayWithComputer.style.display = 'none';\\r\\n containerGame.style.display = 'block';\\r\\n\\r\\n //call the game; gameTicTacToe it's a module now \\r\\n const gameTicTacToe = game();\\r\\n\\r\\n\\r\\n gameTicTacToe.newGrid();\\r\\n gameTicTacToe.renderGrid();\\r\\n \\r\\n }\\r\\n\\r\\n \\r\\n }))\\r\\n\\r\\n }\\r\\n}\",\n \"function initGame() {\\n correctGuesses = 0;\\n incorrectGuesses = 0;\\n gameInProgress = false;\\n $(\\\"#gameStart\\\").html(\\\"\\\")\\n .click(playGame);\\n}\",\n \"function game() {\\n document.querySelector(\\\"#gameStartModal\\\").style.display = \\\"none\\\";\\n document.querySelector(\\\"#header section#level\\\").style.display = \\\"block\\\";\\n document.querySelector(\\\"#header section#start\\\").style.display = \\\"block\\\";\\n init();\\n // The game loop.\\n update();\\n}\",\n \"function startGame() {\\r\\n\\r\\n\\tvar playerName = document.getElementById(\\\"playername\\\").value;\\r\\n\\t\\r\\n\\tif (playerName == \\\"\\\") {\\r\\n\\t\\treturn false;\\r\\n\\t}else{\\r\\n\\t\\r\\n\\t\\t// Store player name in pName variable\\r\\n\\t\\tpName = playerName;\\r\\n\\t\\t// Remove display of the intro screen\\r\\n\\t\\tdocument.getElementById(\\\"intro\\\").style.display = \\\"none\\\";\\r\\n\\t\\t// Add event listeners controls\\r\\n\\t\\taddControls();\\r\\n\\t\\t//Sounds.moon.play();\\r\\n\\t}\\r\\n\\r\\n\\r\\n}\",\n \"function startGame() {\\n currentScoreDisplay.textContent = 0;\\n player1Score.textContent = 0;\\n player2Score.textContent = 0;\\n player = Math.floor(Math.random() * 2) + 1;\\n gameStarted = true;\\n showPlayer(player);\\n displayScores();\\n}\",\n \"function startNewGame(evt) {\\n 'use strict';\\n document.getElementById(\\\"gameDiv\\\").innerHTML = \\\"\\\";\\n var menuDiv = document.getElementById(\\\"menuControls\\\");\\n \\n /* Variables for current player & last play to reset */\\n var lastPlayDisplay = document.getElementById(\\\"lastPlayMade\\\");\\n var currentPlayerDisp = document.getElementById('currentPlayer');\\n lastPlayDisplay.innerHTML = \\\"\\\";\\n currentPlayerDisp.innerHTML = \\\"\\\";\\n \\n menuDiv.innerHTML = \\\"\\\";\\n document.getElementById(\\\"gameStatus\\\").style.display = \\\"none\\\";\\n \\n var newGameEntry = document.getElementById(\\\"userEntry\\\");\\n newGameEntry.innerHTML = \\\"Player One Designation:
    \\\";\\n newGameEntry.innerHTML += \\\"Player Two Designation:
    \\\";\\n \\n var plyrOneName = document.getElementById(\\\"plyrOneName\\\");\\n var plyrTwoName = document.getElementById(\\\"plyrTwoName\\\");\\n addHandler(plyrOneName, 'input', playerNameChange);\\n addHandler(plyrTwoName, 'input', playerNameChange);\\n \\n var startGameBtn = document.getElementById(\\\"startGameBtn\\\");\\n addHandler(startGameBtn, 'click', generateGameGrid);\\n}\",\n \"function startGame() {\\n\\t$(\\\"#start-button\\\", \\\"#menu\\\").click(function(){\\n\\t\\tif (sess_token == null) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tbutton_lock = true;\\n\\t\\tdocument.getElementById(\\\"question-answer-container\\\").style.visibility = \\\"visible\\\";\\n\\t\\tdocument.getElementById(\\\"stats\\\").style.visibility = \\\"visible\\\";\\n\\t\\tdocument.getElementById(\\\"menu\\\").style.visibility = \\\"hidden\\\";\\n\\t\\tdocument.getElementById(\\\"reset-button\\\").style.visibility = \\\"visible\\\";\\n\\t\\tgetQuestion(\\\"easy\\\");\\n\\t}); \\n}\",\n \"function startGame() {\\n let gameBoard = document.getElementById('gameBoard');\\n let tutorial = document.getElementById('tutorial');\\n gameBoard.style.display = \\\"block\\\";\\n tutorial.style.display = \\\"none\\\";\\n addGround();\\n addTree(treeCenter, trunkHeight);\\n addBush(bushStart);\\n addStones(stoneStart);\\n addCloud(cloudStartX, cloudStartY);\\n addingEventListenersToGame();\\n addingEventListenersToTools();\\n addInventoryEventListeners()\\n}\",\n \"function NewGame() {\\n\\t// Your code goes here for starting a game\\n\\tprint(\\\"Complete this method in Singleplayer.js\\\");\\n}\",\n \"function onBoardClick() {\\n if (!hasStarted) {\\n startGame();\\n } else {\\n startPause();\\n }\\n }\",\n \"function createUser (){\\n\\t//create user and get names from the user\\n\\tuser.townName = document.getElementById('townName').value;\\n\\tuser.character = document.getElementById('charName').value;\\n\\n\\t//hide the user creation div and show the output div\\n\\t\\n\\tdocument.getElementById('outputDiv').style.display='block';\\n\\tdocument.getElementById('descriptionDiv').style.display='block';\\n\\tdocument.getElementById('textEntryDiv').style.display='block';\\n\\tdocument.getElementById('inputDiv').style.display='none';\\n \\n\\t//Inititalize stuff\\n\\tclear();\\n\\tcreateItems();\\n\\tcreatePeople();\\n\\tcreateLocations();\\n\\tconnectLocations();\\n\\tgoTo(downtown); //Start the user in this location\\n\\t\\n\\t//Welcome the user\\n\\tdocument.getElementById('outputDiv').innerHTML=\\n\\t'Welcome to ' + user.townName + ', have fun playing our game ' + user.character + '! ' + user.townName + ' is divided into three sections Uptown, the Shopping District, and Downtown.';\\n }\",\n \"function startGame(){\\n\\t\\tfor (var i=1; i<=9; i=i+1){\\n\\t\\t\\tclearBox(i);\\n\\t\\t}\\n\\t\\tdocument.turn = \\\"X\\\";\\n\\t\\tif (Math.random()<0.5) {\\n\\t\\t\\tdocument.turn = \\\"O\\\";\\n\\t\\t}\\n\\t\\tdocument.winner = null;\\n\\t// This uses the \\\"setMessage\\\" function below in order to update the message with the contents from this function\\n\\t\\tsetMessage(document.turn + \\\" gets to start.\\\");\\n\\t}\",\n \"function displayUI() {\\n /*\\n * Be sure to remove any old instance of the UI, in case the user\\n * reloads the script without refreshing the page (updating.)\\n */\\n $('#plugbot-ui').remove();\\n\\n /*\\n * Generate the HTML code for the UI.\\n */\\n $('#chat').prepend('
    ');\\n var cWoot = autowoot ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n var cQueue = autoqueue ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n var cHideVideo = hideVideo ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n var cUserList = userList ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n $('#plugbot-ui').append(\\n '

    auto-woot

    auto-queue

    hide video

    userlist

    Custom Username FX:

    + add new

    ');\\n}\",\n \"function renderPlayer(){\\n console.log('in renderPlayer')\\n let text;\\n if (!state.players[0] || !state.players[1]){\\n text = `\\n \\n \\n \\n `\\n } else {\\n text = `${state.getCurrentPlayer()} place a token!`\\n }\\n playerTurn.innerHTML= text;\\n }\",\n \"static showGame() {\\n document.getElementById('js-player-selection').style.display = 'none';\\n document.getElementById('js-game-info').style.display = 'block';\\n }\",\n \"showStartButton() {\\n let startButton = document.createElement(\\\"button\\\");\\n startButton.innerHTML = \\\"Start\\\";\\n startButton.addEventListener(\\\"click\\\", function () {\\n game.deleteStartButton();\\n game.showTitle();\\n game.showReply();\\n game.showForm();\\n });\\n startButton.classList.add(\\\"start\\\");\\n this.main.appendChild(startButton);\\n }\",\n \"function startGame(player1Name, player2Name, difficultySetting) {\\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \\n window.gameboard = new Gameboard(difficultySetting); \\n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\\n $('#grid-container-body').removeClass('hide');\\n setTimeout(hideWelcomeModal, 500);\\n }\",\n \"function beginGame() {\\n gameConsole.innerHTML = \\\"\\\";\\n\\n// Prompt player name\\nplayer1Name = prompt('Please input your name');\\n\\n// and change it in the HTML\\n document.getElementById('player-1-name').innerHTML = player1Name;\\n\\n// explain the rules for the opening puzzle\\n gameConsole.innerHTML = 'Thanks ' + player1Name + '. The opening puzzle will begin. There will be one word up above that will fill in slowly. Click the buzzer of the opportunity to guess correctly. A correct guess will net you 50 points, and control of the first board. Guessing incorrectly will give the opponent the points and control. Good luck, and click the start button to begin.';\\n\\n// modify the start button to initialize the pizzle as oppose to beginning the game\\n\\tappendOutputConsole('div', '', 'flex-container justify-center');\\n}\",\n \"function startGame() {\\n printStats();\\n console.log(\\\"Game Started\\\");\\n getGamePick();\\n console.log(gPick);\\n document.getElementById('Title').innerHTML=\\\"Great, now it is you turn pick a letter a-z\\\"; \\n }\",\n \"function clickToStart(){\\n if (gameStarted === false) {\\n $(\\\"#win-count\\\").text(wins);\\n $(\\\"#loss-count\\\").text(wins);\\n $(\\\"#win-header\\\").text(\\\"wins\\\");\\n $(\\\"#loss-header\\\").text(\\\"losses\\\");\\n $(\\\"#number-to-guess\\\").text(targetNumber);\\n $(\\\"#userCounter\\\").text(counter);\\n $(\\\"#clickToStart\\\").addClass(\\\"isHidden\\\");\\n generateRupees();\\n gameStarted = true;\\n } \\n \\n }\",\n \"function gameStart(){\\n\\t\\tplayGame = true;\\n\\t\\tmainContentRow.style.visibility = \\\"visible\\\";\\n\\t\\tscoreRow.style.visibility = \\\"visible\\\";\\n\\t\\tplayQuitButton.style.visibility = \\\"hidden\\\";\\n\\t\\tquestionPool = getQuestionPool(answerPool,hintPool);\\n\\t\\tcurrentQuestion = nextQuestion();\\n}\",\n \"function displayPlayer(turn, player) {\\n turn.html('It is player '+player+'\\\\'s turn');\\n }\",\n \"function displayPlayers() {\\n $('#userNameBox').text(human.name)\\n $('#userSymbolBox').text(human.symbol)\\n $('#compNameBox').text(ai.name)\\n $('#compSymbolBox').text(ai.symbol)\\n}\",\n \"displayBoard(message) {\\n $('.menu').css('display', 'none');\\n $('.gameBoard').css('display', 'block');\\n $('#userHello').html(message);\\n this.createGameBoard();\\n }\",\n \"function start(){\\n //hide game and error message\\n document.getElementById(\\\"error-message\\\").classList.add(\\\"hidden\\\");\\n document.getElementById(\\\"game\\\").classList.add(\\\"hidden\\\");\\n\\n //add event listener to start button to trigger game\\n\\tvar start = document.getElementById(\\\"intro\\\").firstChild.nextSibling;\\n start.addEventListener('click', game);\\n}\",\n \"function showLoggedInUser(user) {\\n login_status.text(\\\"Logged in as: \\\" + user.profile.name);\\n login_button.text(\\\"Logout\\\");\\n }\",\n \"function startGame() {\\n $controls.addClass(\\\"hide\\\");\\n $questionWrapper.removeClass(\\\"hide\\\");\\n showQuestion(0, \\\"n\\\");\\n points();\\n}\",\n \"create () {\\n var background = this.game.add.sprite(0, 0, 'space');\\n background.height = this.game.height;\\n var button = this.game.add.button(this.game.world.centerX - 100, 100, 'start', start,this);\\n button.angle = -30;\\n\\n this.userName = ''; //Initializes name\\n \\n \\n var scoreText = this.game.add.text(0, 500, 'You Lost!', {fontsize: '32px', fill: '#ffffff', boundsAlignH: \\\"center\\\"});\\n scoreText.text = \\\"You Lost! Score: \\\" + this.scoreValue + \\\"\\\\n(Click Alex's face or \\\\npress enter to play again)\\\";\\n scoreText.setTextBounds(0, 100, 800);\\n\\n this.nameText = this.game.add.text(200, 800, 'Submit Name to Leaderboard: \\\\n(Enter to Submit)', {fontsize: '32px', fill: '#ffffff'});\\n //Retrieve keyboard presses from the player\\n this.game.input.keyboard.addCallbacks(this, null, null, keyPress);\\n this.textInput = this.game.add.text(this.game.world.centerX + 5, 575, \\\"\\\", {\\n font: \\\"28px Arial\\\",\\n fill: \\\"#000\\\",\\n align: \\\"center\\\"\\n });\\n this.textInput.setText(this.textInput.text);\\n this.textInput.anchor.setTo(0.5, 0.5);\\n\\n function keyPress(char) {\\n this.userName += char;\\n }\\n\\n //Keys for backspace and enter\\n this.deleteKey = this.game.input.keyboard.addKey(Phaser.Keyboard.BACKSPACE);\\n this.enterKey = this.game.input.keyboard.addKey(Phaser.Keyboard.ENTER);\\n this.game.input.keyboard.addKeyCapture([ Phaser.Keyboard.BACKSPACE, Phaser.Keyboard.ENTER ]);\\n\\n //Detect backspaces when typing the name\\n this.deleteKey.onDown.add(deleteText, this);\\n\\n //allows user to delete characters\\n function deleteText() {\\n if (this.userName !== '') {\\n this.userName = this.userName.slice(0, this.userName.length - 1);\\n }\\n }\\n\\n //Detect Enter when typing the name\\n this.enterKey.onDown.add(start, this);\\n\\n\\n //Send to Firebase Here\\n function start() {\\n if (this.userName === '') {\\n this.userName = 'Alex';\\n }\\n var newScore = {ScoreValue: this.scoreValue, UserName: this.userName};\\n scoresData.push(newScore);\\n\\n this.userName = '';\\n this.state.start('Game');\\n }\\n }\",\n \"function startGame()\\n{\\n\\tcreateDeck();\\n\\tshuffleDeck();\\n\\tcreatePlayers(2);\\n\\n\\tdrawCard(0, 0);\\n\\tdrawCard(1, 0);\\n\\tdrawCard(0, 0);\\n\\tdrawCard(1, 0);\\n\\n\\n\\n\\tdisplayCards();\\n\\tdisplayOptions();\\n}\",\n \"display(title) {\\r\\n this.title.html(title);\\r\\n this.title.position(130, 0);\\r\\n if (this.playButton, this.inputbox) {\\r\\n this.inputbox.position(130, 160);\\r\\n\\r\\n this.playButton.position(250, 200);\\r\\n\\r\\n this.playButton.mousePressed(() => {\\r\\n this.inputbox.hide();\\r\\n this.playButton.hide();\\r\\n playerObj.name = this.inputbox.value();\\r\\n gameState = 1;\\r\\n this.greeting.html(\\\"Welcome \\\" + playerObj.name);\\r\\n this.greeting.position(200, 250);\\r\\n });\\r\\n }\\r\\n }\",\n \"function startGame() {\\n\\tdisplayCharacterStats(null);\\n\\n\\treturn;\\n}\",\n \"function startGame() {\\n createButtons();\\n createCards();\\n}\",\n \"function startGame() {\\n createButtons();\\n createCards();\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7060195","0.69904566","0.6753309","0.67526233","0.6736144","0.6704425","0.6685465","0.6605404","0.6598817","0.65951693","0.6560461","0.6552254","0.6488314","0.643916","0.6436459","0.64232516","0.6409647","0.64065343","0.63825643","0.6379045","0.63708436","0.6370226","0.636862","0.63607436","0.6357959","0.63534826","0.6349537","0.6348982","0.6348081","0.63307804","0.63221186","0.6312787","0.63052195","0.6274072","0.6273557","0.627056","0.626817","0.6258369","0.62577057","0.62523013","0.6245355","0.624461","0.6244116","0.62432176","0.6242727","0.6241053","0.62401044","0.6236445","0.62350374","0.62110585","0.62094885","0.62046367","0.6195412","0.6190015","0.6189687","0.61886764","0.618367","0.61740756","0.6170647","0.6169018","0.61642224","0.615962","0.6155498","0.6153345","0.61286783","0.61183363","0.6112383","0.6112109","0.60887426","0.6084684","0.60811573","0.6080434","0.6079071","0.60770404","0.60769236","0.60590094","0.6057191","0.6051124","0.6051035","0.604712","0.60445327","0.60384655","0.60379666","0.60320526","0.6031776","0.6028703","0.6027233","0.60203093","0.60193646","0.60178494","0.6015291","0.6013153","0.60045534","0.5992698","0.5986002","0.5985172","0.5981141","0.5979924","0.59776825","0.59776825"],"string":"[\n \"0.7060195\",\n \"0.69904566\",\n \"0.6753309\",\n \"0.67526233\",\n \"0.6736144\",\n \"0.6704425\",\n \"0.6685465\",\n \"0.6605404\",\n \"0.6598817\",\n \"0.65951693\",\n \"0.6560461\",\n \"0.6552254\",\n \"0.6488314\",\n \"0.643916\",\n \"0.6436459\",\n \"0.64232516\",\n \"0.6409647\",\n \"0.64065343\",\n \"0.63825643\",\n \"0.6379045\",\n \"0.63708436\",\n \"0.6370226\",\n \"0.636862\",\n \"0.63607436\",\n \"0.6357959\",\n \"0.63534826\",\n \"0.6349537\",\n \"0.6348982\",\n \"0.6348081\",\n \"0.63307804\",\n \"0.63221186\",\n \"0.6312787\",\n \"0.63052195\",\n \"0.6274072\",\n \"0.6273557\",\n \"0.627056\",\n \"0.626817\",\n \"0.6258369\",\n \"0.62577057\",\n \"0.62523013\",\n \"0.6245355\",\n \"0.624461\",\n \"0.6244116\",\n \"0.62432176\",\n \"0.6242727\",\n \"0.6241053\",\n \"0.62401044\",\n \"0.6236445\",\n \"0.62350374\",\n \"0.62110585\",\n \"0.62094885\",\n \"0.62046367\",\n \"0.6195412\",\n \"0.6190015\",\n \"0.6189687\",\n \"0.61886764\",\n \"0.618367\",\n \"0.61740756\",\n \"0.6170647\",\n \"0.6169018\",\n \"0.61642224\",\n \"0.615962\",\n \"0.6155498\",\n \"0.6153345\",\n \"0.61286783\",\n \"0.61183363\",\n \"0.6112383\",\n \"0.6112109\",\n \"0.60887426\",\n \"0.6084684\",\n \"0.60811573\",\n \"0.6080434\",\n \"0.6079071\",\n \"0.60770404\",\n \"0.60769236\",\n \"0.60590094\",\n \"0.6057191\",\n \"0.6051124\",\n \"0.6051035\",\n \"0.604712\",\n \"0.60445327\",\n \"0.60384655\",\n \"0.60379666\",\n \"0.60320526\",\n \"0.6031776\",\n \"0.6028703\",\n \"0.6027233\",\n \"0.60203093\",\n \"0.60193646\",\n \"0.60178494\",\n \"0.6015291\",\n \"0.6013153\",\n \"0.60045534\",\n \"0.5992698\",\n \"0.5986002\",\n \"0.5985172\",\n \"0.5981141\",\n \"0.5979924\",\n \"0.59776825\",\n \"0.59776825\"\n]"},"document_score":{"kind":"string","value":"0.59898114"},"document_rank":{"kind":"string","value":"94"}}},{"rowIdx":60,"cells":{"query":{"kind":"string","value":"Choose to eat at a fancy restaurant or a fastfood restaurant."},"document":{"kind":"string","value":"function startFunction() {\n title.innerText = \"\";\n subTitle.innerText = subTitleIntro;\n\n firstButton.innerText = \"fancy restaurant\";\n secondButton.classList.remove(\"hidden\");\n secondButton.innerHTML = \"fastfood restaurant\";\n\n firstButton.onclick = function() {\n regretFancyRestaurantOption(); \n }\n\n secondButton.onclick = function() {\n regretFastFoodRestaurantOption(); \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 handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function randomFood() {\n\n\t\tif (Math.random() > 0.5) {\n\t\t\treturn 'pizza';\n\t\t} \n\t\treturn 'ice cream';\n\t}","function whatDidYouEat(food) {\n var outcome;\n switch (food) {\n case \"beans\":\n outcome = \"gas attack\";\n break;\n case \"salad\":\n outcome = \"safe and sound\";\n break;\n case \"mexican\":\n outcome = \"diarrhea in 30 minutes\"\n break;\n default:\n outcome = \"please enter valid food\";\n }\n return outcome;\n}","function checkFood(food){\n\tvar food = [\"chicken\", \"beef\", \"fish\", \"lamb\", \"veal\"];\n\n\t//The first term starts with 0\n\n\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\n\t\talert(\"You are considered as meat\");\n\t}else{\n\t\talert(\"You may or may not be considered as meat\");\n\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \"You are considered as meat\"\n\t//if something else is entered, then a popup will appear saying \"you may or may not be considered as meat\"\t\n\t}\n}","function findTheCheese (foods) {\n\n for (var i = 0; i < foods.length; i++) {\n\n switch (foods[i]) {\n case \"cheddar\":\n return \"cheddar\"\n break;\n case \"gouda\":\n return \"gouda\"\n break;\n case \"camembert\":\n return \"camembert\"\n break;\n }\n }\n return \"no cheese!\"\n}","function eat(food)\n\t\t{\n\t\t\t// Add the food's HTML element to a queue of uneaten food elements.\n\t\t\tuneatenFood.push(food.element);\n\n\t\t\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\n\t\t\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\n\t\t\t// removes the food element.\n\t\t\tFish.swimTo(\n\t\t\t\tfood.position,\n\t\t\t\tFish.PathType.AppendPath,\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\tlet eatenFood = uneatenFood.shift();\n\t\t\t\t\teatenFood.parentNode.removeChild(eatenFood);\n\t\t\t\t\tgrow();\n\t\t\t\t});\n\t\t} // end eat()","function makeFood(beans, rice) {\n if (beans === 'y' && rice === 'y') {\n console.log('Burrito');\n }\n}","function setFoodType(type) {\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\n if(type === 'kebab') {\n $scope.hammered = 'chosen-emotion';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'cafe') {\n $scope.hammered = '';\n $scope.hungover = 'chosen-emotion';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'fastfood') {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = 'chosen-emotion';\n $scope.hardworking = '';\n } else {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = 'chosen-emotion';\n }\n vm.foodType = type;\n }","selectSoupTomato() {\n I.waitForElement(foodObjects.chooseCup);\n I.tap(foodObjects.chooseCup);\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\n I.waitForElement(foodObjects.tomatoSoup);\n I.tap(foodObjects.tomatoSoup);\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\n }","function randomFood() {\n\tfor(var i=0; i<3; i++) {\n\t\tvar rfood = Math.floor(Math.random()*food.length);\n\t\tfoods[i].className = 'food';\n\t\tfoods[i].classList.add(food[rfood]);\n\t\tfoods[i].style.top = randomPosition()+\"px\";\n\t\tfoods[i].style.left = randomPosition()+\"px\";\n\t\tcheckEat(pig, foods[i]);\n\t}\n}","function fruitOrVegetable(product) {\n switch (product) {\n case \"cucumber\":\n case \"pepper\":\n case \"carrot\":\n console.log(\"vegetable\");\n break;\n // TODO: Implement the other cases\n }\n}","eat() {\r\n let consume = this.food - 2\r\n if (consume > 1) {\r\n this.isHealthy = true\r\n return this.food = consume\r\n } if (consume <= 0) {\r\n this.isHealthy = false\r\n return this.food = 0\r\n }\r\n else if (consume <= 1) {\r\n return this.food = consume\r\n //alert(this.name + \" food supply reached to 0. It's time for a hunt\")\r\n //this.isHealthy = true\r\n }\r\n\r\n }","generateRestaurant(){\n// we want the user to input the zipcode they want to search, the food type they want to eat\n// and the rating (1-5) \n// getRestaurants()\n\n\n}","function eatingFood(eatingTime) {\n switch(eatingTime) {\n case 'Breakfast':\n return '07:00';\n case 'Lunch':\n return '13:00';\n default:\n return 'I do not eat';\n }\n}","pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }","function changeRestaurant() {\n if (selectedRestaurant < rRestaurants.length - 1) {\n const next = selectedRestaurant + 1;\n dispatch(setSelectedRestaurant(next));\n } else {\n dispatch(setSelectedRestaurant(0));\n }\n }","function getRandomMeal() {\n const getMeal = async () => {\n const singleMeal = await getRandom();\n if (singleMeal) setMeal(singleMeal);\n setStatus(true);\n };\n getMeal();\n }","function eatFood() {\n if (gameState.snakeStart === gameState.food) {\n gameState.snakeLength++;\n\n updateFoodCell(\"remove\", gameState.food);\n\n createFood();\n updateFoodCell(\"add\", gameState.food);\n gameState.score++;\n increaseSpeed();\n showScore();\n return true;\n }\n}","function eat(snake, food) {\n\tsnake.belly = food.value;\n\tresetFood();\n}","eat(){\n let head = this.state.snakeDots[this.state.snakeDots.length - 1];\n let food = this.state.food;\n if (head[0] === food[0] && head[1] === food[1]){\n this.setState({\n food : getRandomCo()\n })\n this.increaseB();\n this.SpeedIN();\n }\n }","function fastFoodMeal(sandwich, side, drink, dessert) {\n \n return {\n sandwich: sandwich,\n side: side,\n drink: drink,\n dessert: dessert,\n }\n}","function foodClickHandler(foodsitem) {\n setFood(foodsitem);\n }","function computeFood(inputFood) {\n if (inputFood) {\n inputFood = inputFood.toLowerCase();\n switch (inputFood) {\n case \"italian\": \n parseFood = \"cuisine=italian&\";\n break;\n case \"american\":\n parseFood = \"cuisine=american&\";\n break;\n case \"chicken\": \n parseFood = \"cuisine=chicken&\";\n break;\n case \"burgers\": \n parseFood = \"cuisine=burgers&\";\n break;\n case \"salads\": \n parseFood = \"cuisine=salads&\";\n break;\n case \"sandwiches\": \n parseFood = \"cuisine=sandwiches&\";\n break;\n case \"soups\": \n parseFood = \"cuisine=soups&\";\n break;\n case \"subs\": \n parseFood = \"cuisine=subs&\";\n break;\n case \"chinese\": \n parseFood = \"cuisine=chinese&\";\n break;\n case \"vietnamese\": \n parseFood = \"cuisine=vietnamese&\";\n break;\n case \"pizza\": \n parseFood = \"cuisine=pizza&\";\n break;\n case \"seafood\": \n parseFood = \"cuisine=seafood&\";\n break;\n case \"indian\": \n parseFood = \"cuisine=indian&\";\n break;\n case \"asian\": \n parseFood = \"cuisine=asian&\";\n break;\n case \"diner\": \n parseFood = \"cuisine=diner&\";\n break;\n case \"healthy\": \n parseFood = \"cuisine=healthy&\";\n break;\n case \"irish\": \n parseFood = \"cuisine=irish&\";\n break;\n case \"mediterranean\": \n parseFood = \"cuisine=mediterranean&\";\n break;\n case \"noodles\": \n parseFood = \"cuisine=noodles&\";\n break;\n case \"steak\": \n parseFood = \"cuisine=steak&\";\n break;\n case \"vegetarian\": \n parseFood = \"cuisine=vegetarian&\";\n break;\n }\n }\n}","function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}","async displayFoodChoice(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.food) {\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n } else {\n const user = await this.userProfile.get(step.context, {});\n\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\n\n if (step.context.activity.text == 1) {\n user.food = \"European\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 2) {\n user.food = \"Chinese\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 3) {\n user.food = \"American\";\n await this.userProfile.set(step.context, user);\n }else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\n return await step.beginDialog(WHICH_FOOD);\n }\n\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n }\n return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","function fightOrRun() {\n var choices = [\"Run\", \"Fight\"];\n var askPlayer = parseInt(readline.keyInSelect(choices, \"Do you want to fight like a shark or run like a shrimp???\\nThe next monster might be scarier.\\n \\n What are you going to do? Press 1 to run...Press 2 to fight.\"));\n if (choices === 1) {\n //call the function for deciding to run \n run();\n } else {\n //call the function for deciding to fight\n console.log('You decided to fight, bring it on!!.');\n fight();\n }\n }","onFood () {\r\n let tilePlants = this.tile.objs.filter(o => o.name === 'plant')\r\n if (tilePlants.length < 1) return false\r\n return tilePlants[0]\r\n }","function foodFunc() {\n\n var favFood = prompt('Guess one of the top four styles of foods that I enjoy eating.').toLowerCase();\n var foodStyles = ['mexican', 'italian', 'southern', 'japanese'];\n\n for (var i = 0; i < 5; i++) {\n if (favFood === foodStyles[0] || favFood === foodStyles[1] || favFood === foodStyles[2] || favFood === foodStyles[3]) {\n favFood = alert('Correct, ' + favFood + ' food is delicious!');\n score++;\n break;\n } else if (i !== 6) {\n favFood = prompt('That doesn\\'t make the top four. Please try again.');\n }\n }\n if (i === 5) {\n favFood = alert('My top four favorite styles of food are mexican, italian, southern, and japanese food!');\n }\n}","function makeEnemyChoice() {\n const choices = [\"horse\", \"hay\", \"sword\"];\n const choiceIndex = Math.floor(Math.random() * choices.length);\n selectItem(\"enemy\", choices[choiceIndex]);\n}","eat () {\n if (this.food === 0) {\n this.isHealthy = false;\n\n } else {\n this.food -= 1;\n }\n }","function makeChoise() {\n\tconsole.log('Func makeChoise');\n\tvar choise = 0;\n\tif(machina.countCoins == MINERAL_WATER) {\n\t\tchoise = prompt('Press 1 to choose Mineral water or add more coins to make another choise.', 0);\n\t\tif(choise == 1) {\n\t\t\tmachina.giveMineralWater();\n\t\t}\n\t\telse getCoins();\n\t}\n\telse if(machina.countCoins == SWEET_WATER ) {\n\t\tchoise = prompt('Press 1 to choose Mineral water or Press 2 to choose Sweet water.', 0);\n\t\tif(choise == 1) {\n\t\t\tmachina.giveMineralWater();\n\t\t}\n\t\telse machina.giveSweetWater();\n\t}\n}","function fightOrFlight() {\n var fightOrFlight = ask.question(\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\n\")\n if (fightOrFlight === \"f\") {\n fight();\n } else {\n run();\n }\n}","async eatEnergy() {\n await this.updateAvailableEat();\n let response = await this.sendRequest(\"foodSystem.php\", { \"whatneed\": \"eatFrmHldnk\" });\n debug(\"Eating...\", response);\n return response;\n }","setSelectedRestaurant(state, resto) {\n state.selectedRestaurant = resto;\n }","function pickFood() {\r\n\r\n\t\tdocument.getElementById(\"searchFood\").value = \"\";\r\n\t\tlet food = document.getElementById(this.id).innerHTML;\r\n\t\tlet foodName = \"\";\r\n\t\tlet foodSplit = food.split(/[ \\t\\n]+/);\r\n\r\n\t\tfor(let i = 0; i < foodSplit.length; i++) {\r\n\t\t\tfoodName += foodSplit[i];\r\n\t\t\tif(i + 1 < foodSplit.length) {\r\n\t\t\t\tfoodName += \"+\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet url = \"https://www.themealdb.com/api/json/v1/1/search.php?s=\"+foodName;\r\n\t\tfetch(url)\r\n\t\t\t.then(checkStatus)\r\n\t\t\t.then(function(responseText) {\r\n\t\t\t\tlet json = JSON.parse(responseText);\r\n\t\t\t\tclear();\r\n\t\t\t\taddTop(json);\r\n\t\t\t\taddIngredients(json);\r\n\t\t\t\taddDirections(json);\r\n\t\t\t\textras(json);\r\n\t\t\t\tdocument.getElementById(\"image\").style.visibility = \"visible\";\r\n\t\t\t})\r\n\t\t\t.catch(function(error) {\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t\tlet error1 = document.getElementById(\"error\");\r\n\t\t\t\terror1.innerHTML = \"Sorry a problem occurred with API, try another name\";\r\n\t\t\t});\r\n\t}","function findTheCheese (foods) {\n for (var i=0; i= 1) {\n\t\t\t\t\tadventure = \"restaurant\";\n\t\t\t\t}\n\t\t\t\telse if (activity == 1 && budget == 0) {\n\t\t\t\t\tadventure = \"shopping_mall\";\n\t\t\t\t} else if (activity == 1 && budget >= 1) {\n\t\t\t\t\tadventure = \"amusement_park\";\n\t\t\t\t} else if (activity == 2 && budget == 0) {\n\t\t\t\t\tadventure = \"bar\";\n\t\t\t\t} else if (activity == 2 && budget >= 1) {\n\t\t\t\t\tadventure = \"spa\";\n\t\t\t\t}\n\t\t\t}","function Traveler(food, name, isHealthy) {\n this.isHealthy = true; //setting as true to begin with\n this.food = food; // CB Note: can put this getRandomIntInclusive(1,0); --not best solution\n this.name = name;\n this.isHealthy = isHealthy;\n }","function chooseAction(me, opponent, t) {\n // This strategy uses the state variable 'evil'.\n // In every round, turn 'not angel' with 10% probability.\n // (And remain this way until the 200 rounds are over.)\n if (Math.random() < 0.1) {\n angel = false;\n }\n\n // If angel, recycle\n if (angel) return 1;\n\n return 0; // Waste otherwise\n }","async promptForFood(step) {\n if (step.result && step.result.value === 'yes') {\n\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\n {\n retryPrompt: 'Sorry, I do not understand or say cancel.'\n }\n );\n } else {\n return await step.next(-1);\n }\n}","function flavorBanana() {\n\t// flavor texts\n\tflavors = [\"Bananas are radioactive.\",\"Bananas are clones.\",\"Most types of banana are unpalatable.\",\"Bananas are technically a berry.\",\"A cluster of bananas is called a \\\"hand.\\\"\"];\n\t// pick a flavor text and return it\n\tflavor = Math.floor(Math.random() * flavors.length);\n\treturn flavors[flavor];\n}","function selectMeat(meat) {\n if($scope.model.selectedBurger.meat) {\n $scope.model.selectedBurger.meat.selected = false;\n }\n $scope.model.selectedBurger.meat = meat;\n $scope.model.selectedBurger.meat.selected = true;\n selectStep('cheese');\n }","function doChoice(e) {\n if (this.selectedIndex>0) {\n var c = favlist[this.options[this.selectedIndex].value];\n\t\tvar fail = false;\n if (c) {\n var i;\n setNotice('Loading fav ...');\n for (i=1;i<=c.length;i++) {\n fail |= setState(i,c[i-1]);\n }\n for (;i<=11;i++) {\n clearState(i);\n }\n }\n this.selectedIndex = 0;\n\t\tif (fail)\n\t\t\taddNotice('Item(s) not found!');\n\t\telse\n\t\t\taddNotice('Fav loaded!');\n }\n}","function findFood(post) {\n\t\tconsole.log(post);\n\t\trestaurantCheck(post);\n\t\tpost = filterPost(post); // filters posts\n\n\t\t// checks spoonacular API to find foods\n\t\tpost.forEach(function (element, index) {\n\t\t\tclassifyCuisine(element);\n\t\t\tingredientSearch(element);\n\t\t});\n\t}","function foodFactory() {\n\n\t\t//generate food randomly with 1/10 chance\n\t\tif (Math.floor((Math.random() * 25) + 1) === 3) {\n\n\t\t\t//randomly position it on the field\n\t\t\tvar randomX = Math.floor((Math.random() * size) );\n\t\t\tvar randomY = Math.floor((Math.random() * size) );\n\n\t\t\t//if selected field is empty create food here\n\t\t\tif (game[randomY][randomX] === 0) {\n\t\t\t\tgame[randomY][randomX] = 2;\n\t\t\t}\n\t\t}\n\t}","function ingredientSearch (food) {\n\n\t\t// J\n\t\t// Q\n\t\t// U\n\t\t// E\n\t\t// R\n\t\t// Y\n\t\t$.ajax ({\n\t\t\tmethod: \"GET\",\n\t\t\turl: ingredientSearchURL+\"?metaInformation=false&number=10&query=\"+food,\n\t\t headers: {\n\t\t 'X-Mashape-Key': XMashapeKey,\n\t\t 'Content-Type': \"application/x-www-form-urlencoded\",\n\t\t \"Accept\": \"application/json\"\n\t\t }\n\t\t}).done(function (data) {\n\t\t\t// check each returned ingredient for complete instance of passed in food\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tvar word_list = getWords(data[i].name);\n\t\t\t\t// ensures food is an ingredient and not already in the food list\n\t\t\t\tif (word_list.indexOf(food) !== -1 && food_list.indexOf(food) === -1) {\n\t\t\t\t\tfood_list.push(food);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}","function generateRandomFood() {\n\n\t\tvar x = Math.floor((Math.random() * BOARD_SIZE));\n\t\tvar y = Math.floor((Math.random() * BOARD_SIZE));\n\n\t\tvar pos = new Position(x,y);\n\n\t\twhile(snakeAtPosition(pos)) {\n\n\t\t\tx = Math.floor((Math.random() * BOARD_SIZE));\n\t\t\ty = Math.floor((Math.random() * BOARD_SIZE));\n\t\t\tpos = new Position(x,y);\n\t\t}\n\n\t\treturn new Food(pos.x, pos.y);\n\t}","function systemSelection(option){\n\tvar check = option; \n\tif(vehicleFuel<=0){\n\t\tgameOverLose();\n\t}\n\n\telse{\n\n\n\tif(currentLocation===check){\n\t\t\tgamePrompt(\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\",beginTravel);\n\t\t\t}\n\n\telse{\n\t\n\t\t\tif(check.toLowerCase() === \"e\"){\n\t\t\t\tvehicleFuel=(vehicleFuel-10);\n\t\t\t\tcurrentLocation=\"e\" ;\n\t\t\t\tgamePrompt(\"Flying to Earth...You used 10 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToEarth);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"m\"){\n\t\t\t//need to add a 'visited' conditional\n\t\t\tvehicleFuel=(vehicleFuel-20);\n\t\t\tcurrentLocation=\"m\" ;\n\t\t\t\tgamePrompt(\"Flying to Mesnides...You used 20 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\", goToMesnides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"l\"){\n\t\t\tvehicleFuel=(vehicleFuel-50);\n\t\t\tcurrentLocation=\"l\" ;\n\t\t\tgamePrompt(\"Flying to Laplides...You used 50 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToLaplides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"k\"){\n\t\t\tvehicleFuel=(vehicleFuel-120);\n\t\t\tcurrentLocation=\"k\" ;\n\t\t\tgamePrompt(\"Flying to Kiyturn...You used 120 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToKiyturn);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"a\"){\n\t\t\tvehicleFuel=(vehicleFuel-25);\n\t\t\tcurrentLocation=\"a\";\n\t\t\tgamePrompt(\"Flying to Aenides...You used 25 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToAenides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"c\"){\n\t\t\tvehicleFuel=(vehicleFuel-200);\n\t\t\tcurrentLocation=\"c\" ;\n\t\t\tgamePrompt(\"Flying to Cramuthea...You used 200 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToCramuthea);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"s\"){\n\t\t\tvehicleFuel=(vehicleFuel-400);\n\t\t\tcurrentLocation=\"s\" ;\n\t\t\tgamePrompt(\"Flying to Smeon T9Q...You used 400 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToSmeon);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"g\"){\n\t\t\tvehicleFuel=(vehicleFuel-85);\n\t\t\tcurrentLocation=\"g\" ;\n\t\t\tgamePrompt(\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToGleshan);\n\t\t\t}\n\t\telse{\n\t\t\tgamePrompt(\"Sorry Captain, I did not understand you. I will return you to the main menu\",beginTravel);\n\t\t}\n\t}\n\t}\n}","function chap19(){\n var wantChicken = false;\n var foodArray = [\"Salmon\", \"Tilapia\", \"Tuna\", \"Lobster\"];\n var customerOrder = prompt(\"What would you like?\", \"Look the menu\");\n for (var i = 0; i <= 3; i++) {\n if (customerOrder === foodArray[i]) {\n wantChicken = true;\n alert(\"We have it on the menu!\");\n break;\n }\n }\n if(wantChicken===false) {\n\t\talert(\"We don't serve chicken here, sorry.\");\n\t}\n}","function createFood() {\n food.FOOD_COLOUR = food.colours[Math.floor(Math.random()*7)]\n // Generate a random number the food x-coordinate\n food.x = randomTen(0, gameCanvas.width - 10);\n // Generate a random number for the food y-coordinate\n food.y = randomTen(0, gameCanvas.height - 10);\n \n\n // if the new food location is where the snake currently is, generate a new food location\n snakeOne.snake.forEach(function isFoodOnSnake(part) {\n const foodIsoNsnake = part.x == food.x && part.y == food.y;\n if (foodIsoNsnake) createFood();\n });\n }","function doSomething(chosen, title) {\n switch (chosen) {\n case 'my-tweets':\n tweetIt();\n break;\n case 'spotify-this-song':\n songIt(title);\n break;\n case 'movie-this':\n movieIt(title);\n break;\n case 'do-what-it-says':\n doIt();\n break;\n }\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\n if(userInput === \"1\"){\n \n randomDestination = yesOrNo(destination,destination);\n \n }\n else if (userInput === \"2\") {\n \n randomRestaurant = yesOrNo(restaurant,restaurant);\n }\n else if (userInput === \"3\") {\n \n randomTravelType = yesOrNo(transportation, transportation);\n }\n else if (userInput === \"4\") {\n \n randomEntertainment = yesOrNo(entertainment,entertainment);\n }\n}","function setFood() {\n\tvar empty = [];\n\t\n\t//finds all empty cells so not to collide with snake\n\tfor (var x=0; x < grid.w; x++) {\n\t\tfor (var y=0; y < grid.h; y++) {\n\t\t\tif (grid.get(x, y) == emptyFill) {\n\t\t\t\tempty.push({x:x, y:y});\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//puts food in random cell\n\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))];\n\tgrid.set(foodFill, randpos.x, randpos.y);\n}","function randomFood() {\n var fRow = Math.floor(Math.random() * 19);\n var fCol = Math.floor(Math.random() * 19);\n var foodCell = $('#cell_'+fRow+'_'+fCol);\n if (!foodCell.hasClass('snake-cell')) {\n foodCell.addClass(\"food-cell\");\n food='_'+fRow+'_'+fCol;\n }\n else randomFood();\n }","function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}","function generateMealPlan() {\n // here we will let them decide, based on their diet type, we can take a quick survey of the current diet type\n // when they click generate a meal plan because this can change very regularly\n\n if (dietType == 'maintain' /* check if the diet type == maintainWeight*/) {\n // this means that they do not need to change amount of calories burn, so essentially calorieLoss = regular loss\n calorieIntake = calculateBMR();\n } else if (dietType == 'gain' /*check if the diet type == weightGain*/) {\n // to gain weight we must add around 500 calories (this is a changing factor) to the intake amount\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\n // are they trying to gain, normal (healthy) amount are 0.5lb (+250 calories) and 1lb (+500 calories) a week\n neededCalories = 250 /* 250 ?*/; //again we will check and change this value depending on amount loss\n calorieIntake = calculateBMR() + neededCalories;\n } else if (dietType == 'loss') {\n // to lose weight we must subtract around 500 calories(this is a changing factor) to the intake amount\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\n // are they trying to lose, normal (healthy) amount are 0.5lb (-250 calories) and 1lb (-500 calories) a week\n neededCalories = 250 /* 500 ?*/;\n calorieIntake = calculateBMR() - neededCalories;\n }\n\n // now we can call the calorieIntake value and essentially grab a meal/meals that are within this range for the\n // user\n\n // we can make calls to the database and check for the essential meal here this might be a little difficult\n // since we need to make a meal for the day in a sense, so we need to check with the nutritionist \n // about what should be allocated for calories for breakfast, lunch, and dinner\n\n // also we need to check for allergies and account for this in some way, but that can be handled later\n // once we nail down the functionality of this.\n return calorieIntake;\n}","function fighterSelect() {\n if (userSelected === false) {\n userChoice.append($(this));\n userSelected = true;\n for (let i = 0; i < fighterArray.length; i++) {\n if ($(this).attr('alt') === fighterArray[i].name) {\n userFighter = fighterArray[i];\n userFighter.hide();\n }\n }\n return userFighter\n }\n \n else if (userSelected === true && enemySelected === false) {\n enemyChoice.append($(this));\n enemySelected = true;\n for (let i = 0; i < fighterArray.length; i++) {\n if ($(this).attr('alt') === fighterArray[i].name) {\n enemyFighter = fighterArray[i];\n enemyFighter.hide();\n }\n }\n return enemyFighter;\n }\n }","async function e_greedy() {\r\n\t\tlet action;\r\n\t\t//Based off explore/exploit\r\n\t\tif (Math.random() < epsilon) { //chooses best action\r\n\t\t\t//read max value from firestore database and get the id\r\n\t\t\tlet response = await getMax(s);\r\n\t\t\taction = response;\r\n\t\t} else { //choose random action\r\n\t\t\taction = Math.floor(Math.random() * Math.floor(states));; //if a = 8, this indicates to choose random state\r\n\t\t}\r\n\t\treturn action;\r\n\t}","function pickSearchTerm() {\n let options = [\"stop\", \"mad\", \"angry\", \"annoyed\", \"cut it\" ];\n return options[Math.floor(Math.random() * 4)];\n}","function printFruitOrVeggie(word) {\n switch (word) {\n case 'banana':\n case 'apple':\n case 'kiwi':\n case 'cherry':\n case 'lemon':\n case 'grapes':\n case 'peach':\n console.log('fruit'); break;\n case 'tomato':\n case 'cucumber':\n case 'pepper':\n case 'onion':\n case 'parsley':\n case 'garlic':\n console.log('vegetable'); break;\n default:\n console.log('unknown');\n }\n }","checkForFood(foods) {\n for (var i=0; i < foods.length; i++) {\n let distance = Math.abs(super.subtractVectors(this.position, foods[i].position));\n if (distance <= this.senseRadius && distance >= 0) {\n if (distance <= this.stepSize / 2 && distance >= 0) {\n this.eat(foods[i]);\n this.foodIsNearby = false;\n } else {\n this.foodIsNearby = true;\n }\n } else {\n this.foodIsNearby = false;\n }\n }\n }","function checkMeat(food) {\n var aisle = food;\n console.log(aisle);\n console.log(aisleIngredients);\n if (aisleIngredients.indexOf(\"Seafood\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Seafood\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Frozen;Meat\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Frozen;Meat\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Meat\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Meat\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Pasta and Rice\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Pasta and Rice\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Cheese\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Cheese\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Produce\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Produce\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Nuts\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Nuts\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else {\n lastWine();\n }\n}","function selectRestaurant() {\n let restaurant = document.getElementById(\"dropdown\").firstChild.value;\n let clear;\n if (restaurant === null) {\n return;\n } else if (Object.keys(order.items).length > 0) {\n //Confirm the if the user wants to proceed to clear the order\n clear = confirm(\"Would you like to clear the current order?\");\n if(!clear) {\n document.getElementById(\"dropdown\").firstChild.value = \"\";\n return;\n }\n }\n\n clearOrder(true);\n\n changeRestaurant(restaurant);\n\n}","function randomEmote () {\n let emoteState = pet_info.state\n \n switch(emoteState) {\n case 'good':\n const goodPetStates = [\n './assets/Emote_Heart.png',\n './assets/Emote_Hi!.gif',\n './assets/Emote_Game.png',\n './assets/Emote_Laugh.gif',\n './assets/Emote_Happy.png',\n './assets/Emote_Note.png',\n './assets/Emote_Yes.gif'\n ]\n \n const goodArrayLength = goodPetStates.length\n let goodSelectedState = Math.floor((Math.random() * goodArrayLength) + 0)\n\n $('.pet-state').attr('src', goodPetStates[goodSelectedState])\n \n break\n case 'bad':\n const badPetStates = [\n './assets/Emote_No.gif',\n './assets/Emote_Sad.png',\n './assets/Emote_Sick.gif',\n './assets/Emote_Surprised.gif',\n './assets/Emote_Uh.gif',\n './assets/Emote_Angry.png'\n ]\n \n const badArrayLength = badPetStates.length\n let badSelectedState = Math.floor((Math.random() * badArrayLength) + 0)\n \n $('.pet-state').attr('src', badPetStates[badSelectedState])\n \n break\n case 'dead':\n const deadPetStates = [\n './assets/Emote_Sleep.png',\n './assets/Emote_X.png',\n './assets/Emote_Exclamation.png'\n ]\n \n const deadArrayLength = deadPetStates.length\n let deadSelectedState = Math.floor((Math.random() * deadArrayLength) + 0)\n \n $('.pet-state').attr('src', deadPetStates[deadSelectedState])\n \n break\n default:\n const defaultPetState = 'Emote_Question.png'\n $('.pet-state').attr('src', defaultPetState)\n }\n}","function alertAll() {\n let ask = prompt(`What type of coffee maker you are interested in? : \\n Drip,Carob,Coffee-Machine`)\n let lowerAsk = ask.toLowerCase();\n\n if (lowerAsk == 'drip') {\n newCoffeeMachine.firstMethod()\n newCoffeeMachine.history()\n }\n if(lowerAsk == 'carob'){\n newCoffeeMachine3.firstMethod()\n newCoffeeMachine3.mainType()\n }\n if(lowerAsk == 'coffee-machine'){\n newCoffeeMachine2.firstMethod()\n newCoffeeMachine2.history()\n }\n}","function pickUp(index) {\n var pt = self[self.turn];\n var result = self.food[pt];\n if (!result) return; // Nothing to do\n if (result.length == 1) index = 0; // Unique\n if (index == null) { // Can't decide now...\n newState.pending = action;\n return;\n }\n reward += self.food[pt][index]; // Take the food\n newState.food[pt] = null; // Food is now gone\n }","function eatFood() {\n var lastball = snake[snake.length - 1];\n if (lastball.x == food.x * 20 && lastball.y == food.y*20 ) {\n eat.play()\n score++;\n add();\n createFood();\n }\n}","function placeFood() {\n if (!isThereEmptyCell()) return;\n var cell = getCell([~~(Math.random() * settings.size[0]), ~~(Math.random() * settings.size[1])]);\n if (cell.className) placeFood();\n else cell.className = 'food';\n }","onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }","function selectCheese(cheese) {\n if($scope.model.selectedBurger.cheese) {\n $scope.model.selectedBurger.cheese.selected = false;\n }\n if(cheese !== undefined) {\n $scope.model.selectedBurger.cheese = cheese;\n $scope.model.selectedBurger.cheese.selected = true;\n }\n\n selectStep('salads');\n }","function selectAction() {\n inquirer.prompt([\n {\n name: \"action\",\n message: \"Please select what you want to do:\",\n type: \"list\",\n choices: [\n \"View Product Sales by Department\",\n \"Create New Department\",\n ]\n }\n // use if to lead manager to the different functions\n ]).then(function (answers) {\n if (answers.action === \"View Product Sales by Department\") {\n // run the list function to display all available product\n console.log(\"=============================================\")\n salesByDepartment()\n } else if (answers.action === \"Create New Department\") {\n // run the lowInventory function to display all product with lower than 5 stock quant\n console.log(\"=============================================\")\n createDepartment() \n } else {\n console.log(\"I don't know what you want to do.\")\n }\n })\n}","function findTheCheese (foods) {\n const cheese = [\"cheddar\", \"gouda\", \"camembert\"];\n \n for (let i=0; i < foods.length; i++) { \n \n let flag = cheese.indexOf(foods[i]);\n \n if(flag !== -1) {\n return foods[i];\n }\n } \n return \"no cheese!\";\n}","function app(people){\n let searchType = promptFor(\"Do you know the name of the person you are looking for? Enter 'yes' or 'no'\", yesNo).toLowerCase();\n let searchResults;\n let pickAdventure;\n switch(searchType){\n case 'yes':\n searchResults = searchByName(people);\n break;\n case 'no':\n let pickAdventure = decideSearch();\n if (pickAdventure === \"one\"){\n searchResults = searchByTraits(people);\n } \n else if (pickAdventure === \"multiple\"){\n //multiple search\n }\n else{\n alert(\"Invalid Response\");\n decideSearch();\n }\n // TODO: search by traits\n break;\n default:\n app(people); // restart app\n break;\n }\n \n // Call the mainMenu function ONLY after you find the SINGLE person you are looking for\n mainMenu(searchResults, people);\n \n}","function explore(name) {\n // create a random number, if that number is either 3, 6 or 9, the player will fight a monster\n const randomNumber = Math.floor(Math.random() * 10) + 1;\n\n if (randomNumber === 3 || randomNumber === 6 || randomNumber === 9) {\n // disable button to explore tower and insert dialogue that let players know which monster they are facing\n disableExploreTowerButton();\n monsterEncounterDialogue();\n \n } else {\n exploreDialogue(name);\n }\n}","function pickFruits() {\n return getApple()\n .then(apple => {\n return getBanana()\n .then(banana => `${apple} + ${banana}`);\n });\n}","function aDifficultChoice(choice){\n if(choice==1){\n return 'Take her daughter to a doctor';\n }\n else{\n if(choice==-1)\n {\n return 'Break down and give up all hope';\n } \n }\n if(typeof(choice)=='undefined')\n {\n return \"Wasn't able to decide\";\n }\n else{\n if(choice==\"I give up\")\n {\n return \"Refused to do anything for Karen\";\n }\n}\n}","function ChooseBattleOption(){\r\n\r\n PotentialDamageBlocked[0] = 0; // If Both Players Defend\r\n PotentialDamageDealt[0] = Attack; // If Both Players Attack\r\n\r\n if (NatureControllerScript.Attack >= Defence) PotentialDamageBlocked[1] = Defence; //If Nature Attacks and Human defends\r\n if (NatureControllerScript.Attack < Defence) PotentialDamageBlocked[1] = NatureControllerScript.Attack; //If Nature Attacks and Human defends\r\n\r\n var NetDamageDealt: int; \r\n NetDamageDealt = Attack - NatureControllerScript.Defence;\r\n if (NetDamageDealt > 0) PotentialDamageDealt[1] = NetDamageDealt; //If Human Attacks and Nature defends\r\n if (NetDamageDealt <= 0) PotentialDamageDealt[1] = 0; //If Human Attacks and Nature defends (Successful Defence)\r\n\r\n AttackingPotential = (PotentialDamageDealt[0]+PotentialDamageDealt[1])/2;\r\n DefendingPotential = (PotentialDamageBlocked[0]+PotentialDamageBlocked[1])/2;\r\n \r\n if (DefendingPotential > AttackingPotential){\r\n Choice = 1; //Defend\r\n }\r\n\r\n if (AttackingPotential > DefendingPotential){\r\n Choice = 0; //Attack\r\n }\r\n\r\n if (AttackingPotential == DefendingPotential){\r\n if (Health >= NatureControllerScript.Health) Choice = 0; //Choice = Attack\r\n if (Health < NatureControllerScript.Health) Choice = 1; //Choice = Defend\r\n }\r\n}","function picker(action, target) {\n switch (action) {\n case \"concert-this\":\n concertthis(target);\n break;\n\n case \"spotify-this-song\":\n spotifythissong(target);\n break;\n\n case \"movie-this\":\n moviethis(target);\n break;\n\n case \"do-what-it-says\":\n dowhatitsays();\n break;\n\n default:\n console.log(\"Hmmm ... I don't understand.\");\n break;\n }\n}","function spawnFood() {\n\tvar x = Math.floor(Math.random()*(WIDTH-3))+1;\n\tvar y =\tMath.floor(Math.random()*(HEIGHT-5))+3;\n\tvar f = {x: x, y: y};\n\tvar clear = snake.body.every(\n\t\t\tfunction(cell) {\n\t\t\t\treturn !isTouchingFood(cell, f);\n\t\t\t}) && !isTouchingFood(snake.head, f);\n\tif (clear) {\n\t\tfood = new Food(x, y);\n\t} else {\n\t\tspawnFood();\n\t}\n}","function Food() {\n var food_x = Math.floor(Math.random() * backWidth);\n var food_y = Math.floor(Math.random() * backHeight);\n\n board[food_y][food_x].food = 1;\n }","function pickLocForFood() {\n\tvar cols = floor(windowWidth/s.sWidth);\n\tvar rows = floor(windowHeight/s.sHeight);\n\tfoodPosition =createVector(floor (random(cols)), floor(random(rows)));\n\tfoodPosition.x = constrain (foodPosition.x * s.sWidth, 20, windowWidth-s.sWidth-60);\n\tfoodPosition.y = constrain (foodPosition.y * s.sHeight, 20, windowWidth-s.sHeight-20);\n}","function hasPizza (foodTray) {\n return foodTray.indexOf('pizza') !== -1;\n}","async function makeFood(step) {\n try {\n if (step < brusselSprouts.length) {\n await addFood(brusselSprouts[step], \"#brusselSprouts\"); // Coloco o passo atual na fila\n makeFood(step + 1); // Dou o próximo passo na receita\n } else {\n throw \"End of recipe.\";\n }\n } catch (err) {\n console.log(err);\n }\n}","function whichMeal(datapoint){\n let f = datapoint.whichMeal;\n if (f = \"breakfast\"){\n return \"0.1\";\n }else if (f = \"lunch\"){\n return \"0.5\";\n }else if (f = \"lunch\"){\n return \"1\";\n }\n}","function EatFood(agent) {\n\tthis.description = 'eating food';\n\n\tthis.evaluate = function(context) {\n\t\tvar self = this;\n\t\tvar result = agent.grid.eachThing(function(food) {\n\t\t\tif(!food.claimedBy &&\n\t\t\t\tagent.pos.x == food.pos.x &&\n\t\t\t\tagent.pos.y == food.pos.y) {\n\t\t\t\tagent.grid.claimFood(food, agent);\n\t\t\t}\n\t\t\tif(food.claimedBy == agent) {\n\t\t\t\tcontext.updateRunningTime(self, context.elapsedTime);\n\t\t\t\tfood.consume(context.runningTime);\n\t\t\t\treturn BT.NodeStatus.Running;\n\t\t\t}\n\t\t}, Food);\n\n\t\treturn typeof result !== 'undefined' ? result : BT.NodeStatus.Failure;\n\t};\n}","randomAction() {\n var action;\n const role = this.role.toLowerCase();\n switch (this.location.location.toLowerCase()) {\n case 'throne': \n if (role == 'advisor' && randomChoice([0,1,1]) == 1) {\n action = new Action.Propose(randomChoice([100,150,200,300]),randomChoice([this.game.courtyard,this.game.chapel,this.game.barracks]));\n } break;\n case 'courtyard': break;\n case 'ballroom': \n if (role != 'captain' && role != 'grim' && randomChoice([0,1,1]) == 1) {\n action = new Action.Laud(randomChoice(this.game.characters));\n } break;\n case 'chapel':\n if (role != 'captain' && randomChoice([0,1,1]) == 1) {\n action = new Action.Pray();\n } break;\n case 'barracks': break;\n }\n if (action == null) {\n action = randomChoice([0,0,1]) == 1 ? this.randomVisit() : new Action.Investigate(randomChoice(this.game.characters));\n }\n if (action.time <= this.time) {\n return action;\n } else {\n return new Action.End(this.time);\n }\n }","function handleNewMealRequest(response) {\n // Get a random meal from the random meals list\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\n var meal = RANDOM_MEALS[mealIndex];\n\n // Create speech output\n var speechOutput = \"Here's a suggestion: \" + meal;\n\n response.tellWithCard(speechOutput, \"MealRecommendations\", speechOutput);\n}","function select_by_weather(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = false;\n });\n let selectedChoices = findIfFilters(\"weather\");\n if (selectedChoices.length === 0) {\n document.querySelector('#no-filter-chosen').style.display = 'block';\n } else {\n filter(\"weather\", selectedChoices);\n display_selected_recipes();\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\n }\n}","function displayPizzaType(){\n if (pizzaArray.indexOf(randPizza) === 0){\n pizzaType.innerText = 'Cheese';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese';\n } else if (pizzaArray.indexOf(randPizza) === 1){\n pizzaType.innerText = 'Pepperoni';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Pepperoni';\n } else if (pizzaArray.indexOf(randPizza) === 2){\n pizzaType.innerText = 'Sausage & Peppers';\n ingredientList.innerHTML = 'Sauce, Cheese, Sausage, Peppers';\n } else if (pizzaArray.indexOf(randPizza) === 3){\n pizzaType.innerText = 'Breath-mint';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Anchovies, Garlic, Onion';\n } else if (pizzaArray.indexOf(randPizza) === 4){\n pizzaType.innerText = 'Marg';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Basil, Garlic, Tomato';\n } else if (pizzaArray.indexOf(randPizza) === 5){\n pizzaType.innerText = 'Meat Lovers';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Sausage, Pepperoni, Bacon, Ham';\n } else if (pizzaArray.indexOf(randPizza) === 6){\n pizzaType.innerText = 'Veggie';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Mushroom, Onion, Peppers, Tomato';\n } else if (pizzaArray.indexOf(randPizza) === 7){\n pizzaType.innerText = 'White';\n ingredientList.innerHTML = 'Ingredients
    Cheese, Basil, Tomato, Garlic';\n } else if (pizzaArray.indexOf(randPizza) === 8){\n pizzaType.innerText = 'Vegan';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Basil, Tomato, Mushroom, Onion, Pepper';\n } else if (pizzaArray.indexOf(randPizza) === 9){\n pizzaType.innerText = 'Hawaiian';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Ham, Pineapple';\n } \n\n}","function getChoice() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }).then(function(answer) {\nswitch(answer.action) {\n\tcase 'View Products for Sale':\n\t\tviewProducts();\n\tbreak;\n\n\tcase 'View Low Inventory':\n\t\tviewLowInventory();\n\tbreak;\n\t\n\tcase 'Add to Inventory':\n\t\trestockInventory();\n\tbreak; \n\t\n\tcase 'Add New Product':\n\t\taddNewProduct();\n\tbreak;\n }\n })\n}","function Food_Function() {\n var Food_Output;\n var Foods = document.getElementById(\"Food_Input\").value\n var Food_String = \" is a Delicious Food!\"\n switch(Foods) {\n case \"Chips\": //a case, are the various conditions that are evaluated \n Food_Output = \"Chips\" + Food_String;\n break;\n case \"Steak\":\n Food_Output = \"Steak\" + Food_String;\n break;\n case \"Chicken\":\n Food_Output = \"Chicken\" + Food_String;\n break;\n case \"Curry\":\n Food_Output = \"Curry\" + Food_String;\n break;\n case \"Chilli\":\n Food_Output = \"Chilli\" + Food_String;\n break;\n case \"Purple\":\n Food_Output = \"Purple\" + Food_String;\n break;\n default:\n Food_Output = \"Please enter a Food exactly as written on the above list\"; //if no case match prents this\n}\ndocument.getElementById(\"Output\").innerHTML=Food_Output;\n}","choose_treatment(){\n // Gerando um número aleatório entre 0 e 26.\n let index = (Math.floor(Math.random()* 25 + 1));\n // Possíveis formas de tratamento.\n let treatment = [\n \"consagrado\",\n \"condensado\",\n \"condenado\",\n \"chamuscado\",\n \"concursado\",\n \"condecorado\",\n \"comissionado\",\n \"calejado\", \n \"cutucado\", \n \"cuckado\", \n \"abenssoado\", \n \"desgraçado\", \n \"lisonjeado\", \n \"alejado\", \n \"afetado\", \n \"afeminado\", \n \"sensualizado\", \n \"fuzilado\", \n \"adequado\", \n \"algemado\", \n \"amargurado\", \n \"retardado\", \n \"reciclado\", \n \"coroado\", \n \"abestado\", \n \"ensaboado\"\n ];\n return treatment[index];\n }","function addFoodIcon(food) {\n switch(pluralize.singular(food.name.toLowerCase())) {\n case 'apple':\n return 'apple-1.png';\n break;\n case 'asparagus':\n return 'asparagus.png';\n break;\n case 'avocado':\n return 'avocado.png';\n break;\n case 'bacon':\n return 'bacon.png';\n break;\n case 'banana':\n return 'banana.png';\n break;\n case 'bean':\n return 'beans.png';\n break;\n case 'biscuit':\n return 'biscuit.png';\n break;\n case 'blueberry':\n return 'blueberries.png';\n break;\n case 'bread':\n return 'bread-1.png';\n break;\n case 'broccoli':\n return 'broccoli.png';\n break;\n case 'cabbage':\n return 'cabbage.png';\n break;\n case 'cake':\n return 'cake.png';\n break;\n case 'candy':\n return 'candy.png';\n break;\n case 'carrot':\n return 'carrot.png';\n break;\n case 'cauliflower':\n return 'cauliflower.png';\n break;\n case 'cereal':\n return 'cereals.png';\n break;\n case 'cheese':\n return 'cheese.png';\n break;\n case 'cherry':\n return 'cherries.png';\n break;\n case 'chili':\n return 'chili.png';\n break;\n case 'chips':\n return 'chips.png';\n break;\n case 'chives':\n return 'chives.png';\n break;\n case 'green onion':\n return 'chives.png';\n break;\n case 'chocolate':\n return 'chocolate.png';\n break;\n case 'coconut':\n return 'coconut.png';\n break;\n case 'coffee':\n return 'coffee-2.png';\n break;\n case 'cookie':\n return 'cookies.png';\n break;\n case 'corn':\n return 'corn.png';\n break;\n case 'cucumber':\n return 'cucumber.png';\n break;\n case 'egg':\n return 'egg.png';\n break;\n case 'fish':\n return 'fish.png';\n break;\n case 'flour':\n return 'flour.png';\n break;\n case 'fry':\n return 'fries.png';\n break;\n case 'garlic':\n return 'garlic.png';\n break;\n case 'egg':\n return 'egg.png';\n break;\n case 'grape':\n return 'grapes.png';\n break;\n case 'ham':\n return 'ham.png';\n break;\n case 'honey':\n return 'honey.png';\n break;\n case 'ice cream':\n return 'ice-cream-12.png';\n break;\n case 'jam':\n return 'jam-1.png';\n break;\n case 'jelly':\n return 'jam-1.png';\n break;\n case 'lemon':\n return 'lemon-1.png';\n break;\n case 'lime':\n return 'lime.png';\n break;\n case 'milk':\n return 'milk-1.png';\n break;\n case 'mushroom':\n return 'mushroom.png';\n break;\n case 'mustard':\n return 'mustard.png';\n break;\n case 'noodles':\n return 'noodles.png';\n break;\n case 'oat':\n return 'oat.png';\n break;\n case 'olive oil':\n return 'oil.png';\n break;\n case 'vegetable oil':\n return 'oil.png';\n break;\n case 'oil':\n return 'oil.png';\n break;\n case 'olive':\n return 'olive.png';\n break;\n case 'onion':\n return 'onion.png';\n break;\n case 'orange':\n return 'orange.png';\n break;\n case 'pancake':\n return 'pancakes-1.png';\n break;\n case 'pasta':\n return 'spaguetti.png';\n break;\n case 'peach':\n return 'peach.png';\n break;\n case 'pear':\n return 'pear.png';\n break;\n case 'pea':\n return 'peas.png';\n break;\n case 'pepper':\n return 'pepper.png';\n break;\n case 'pickle':\n return 'pickles.png';\n break;\n case 'pie':\n return 'pie.png';\n break;\n case 'pineapple':\n return 'pineapple.png';\n break;\n case 'beer':\n return 'pint.png';\n break;\n case 'pistachio':\n return 'pistachio.png';\n break;\n case 'pizza':\n return 'pizza.png';\n break;\n case 'pomegranate':\n return 'pomegranate.png';\n break;\n case 'potato':\n return 'potatoes-2.png';\n break;\n case 'pretzel':\n return 'pretzel.png';\n break;\n case 'pumpkin':\n return 'pumpkin.png';\n break;\n case 'radish':\n return 'radish.png';\n break;\n case 'raspberry':\n return 'raspberry.png';\n break;\n case 'rice':\n return 'rice.png';\n break;\n case 'brown rice':\n return 'rice.png';\n break;\n case 'white rice':\n return 'rice.png';\n break;\n case 'salad':\n return 'salad.png';\n break;\n case 'lettuce':\n return 'salad-1.png';\n break;\n case 'spinach':\n return 'salad-1.png';\n break;\n case 'kale':\n return 'salad-1.png';\n break;\n case 'salami':\n return 'salami.png';\n break;\n case 'salmon':\n return 'salmon.png';\n break;\n case 'sandwich':\n return 'sandwich.png';\n break;\n case 'sausage':\n return 'sausage.png';\n break;\n case 'italian sausage':\n return 'sausage.png';\n break;\n case 'breakfast sausage':\n return 'sausage.png';\n break;\n case 'steak':\n return 'steak.png';\n break;\n case 'strawberry':\n return 'strawberry.png';\n break;\n case 'sushi':\n return 'sushi-1.png';\n break;\n case 'taco':\n return 'taco.png';\n break;\n case 'toast':\n return 'toast.png';\n break;\n case 'tomato':\n return 'tomato.png';\n break;\n case 'turkey':\n return 'turkey.png';\n break;\n case 'watermelon':\n return 'watermelon.png';\n break;\n case 'wrap':\n return 'wrap.png';\n break;\n case 'chicken':\n return 'meat.png';\n break;\n case 'chicken breast':\n return 'meat.png';\n break;\n case 'ketchup':\n return 'mustard-2.png';\n break;\n case 'ground beef':\n return 'ham.png';\n break;\n case 'ground turkey':\n return 'ham.png';\n break;\n case 'ground chicken':\n return 'ham.png';\n break;\n case 'ground chicken':\n return 'ham.png';\n break;\n // If a food name is not one of these things, populate it's icon based on category\n default: \n if (food.category === 'Vegetables') {\n return 'salad-1.png';\n } else if (food.category === 'Fruits') {\n return 'apple-1.png'\n } else if (food.category === 'Meat/Seafood') {\n return 'meat-1.png'\n } else if (food.category === 'Grains') {\n return 'grain.png'\n } else if (food.category === 'Dairy') {\n return 'milk.png'\n } else if (food.category === 'Sugars') {\n return 'cupcake.png'\n }\n return 'food.png'\n }\n}","function fDogs(selected_species) {\n return selected_species.species == \"dog\"\n}","function runIntoTheForest(){\n\tstory(\"You get sketched out from the guy acting strange all of a sudden so you just start running as fast as you can towards the only cover you'll have to get away from him\");\n\tchoices = [\"Trip over a tree root\",\"Go back\",\"Call the police\"];\n\tanswer = setOptions(choices);\n}","function genRandomResult(placesArray){\n var numResult = Math.floor(Math.random() * (placesArray.length));\n var restaurantChoice = placesArray[numResult];\n console.log(\"restaurant choice \" + restaurantChoice)\n //alert(restaurantChoice);\n return restaurantChoice;\n}//genRandomResult"],"string":"[\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function randomFood() {\\n\\n\\t\\tif (Math.random() > 0.5) {\\n\\t\\t\\treturn 'pizza';\\n\\t\\t} \\n\\t\\treturn 'ice cream';\\n\\t}\",\n \"function whatDidYouEat(food) {\\n var outcome;\\n switch (food) {\\n case \\\"beans\\\":\\n outcome = \\\"gas attack\\\";\\n break;\\n case \\\"salad\\\":\\n outcome = \\\"safe and sound\\\";\\n break;\\n case \\\"mexican\\\":\\n outcome = \\\"diarrhea in 30 minutes\\\"\\n break;\\n default:\\n outcome = \\\"please enter valid food\\\";\\n }\\n return outcome;\\n}\",\n \"function checkFood(food){\\n\\tvar food = [\\\"chicken\\\", \\\"beef\\\", \\\"fish\\\", \\\"lamb\\\", \\\"veal\\\"];\\n\\n\\t//The first term starts with 0\\n\\n\\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\\n\\t\\talert(\\\"You are considered as meat\\\");\\n\\t}else{\\n\\t\\talert(\\\"You may or may not be considered as meat\\\");\\n\\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \\\"You are considered as meat\\\"\\n\\t//if something else is entered, then a popup will appear saying \\\"you may or may not be considered as meat\\\"\\t\\n\\t}\\n}\",\n \"function findTheCheese (foods) {\\n\\n for (var i = 0; i < foods.length; i++) {\\n\\n switch (foods[i]) {\\n case \\\"cheddar\\\":\\n return \\\"cheddar\\\"\\n break;\\n case \\\"gouda\\\":\\n return \\\"gouda\\\"\\n break;\\n case \\\"camembert\\\":\\n return \\\"camembert\\\"\\n break;\\n }\\n }\\n return \\\"no cheese!\\\"\\n}\",\n \"function eat(food)\\n\\t\\t{\\n\\t\\t\\t// Add the food's HTML element to a queue of uneaten food elements.\\n\\t\\t\\tuneatenFood.push(food.element);\\n\\n\\t\\t\\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\\n\\t\\t\\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\\n\\t\\t\\t// removes the food element.\\n\\t\\t\\tFish.swimTo(\\n\\t\\t\\t\\tfood.position,\\n\\t\\t\\t\\tFish.PathType.AppendPath,\\n\\t\\t\\t\\tfunction()\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tlet eatenFood = uneatenFood.shift();\\n\\t\\t\\t\\t\\teatenFood.parentNode.removeChild(eatenFood);\\n\\t\\t\\t\\t\\tgrow();\\n\\t\\t\\t\\t});\\n\\t\\t} // end eat()\",\n \"function makeFood(beans, rice) {\\n if (beans === 'y' && rice === 'y') {\\n console.log('Burrito');\\n }\\n}\",\n \"function setFoodType(type) {\\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\\n if(type === 'kebab') {\\n $scope.hammered = 'chosen-emotion';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'cafe') {\\n $scope.hammered = '';\\n $scope.hungover = 'chosen-emotion';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'fastfood') {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = 'chosen-emotion';\\n $scope.hardworking = '';\\n } else {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = 'chosen-emotion';\\n }\\n vm.foodType = type;\\n }\",\n \"selectSoupTomato() {\\n I.waitForElement(foodObjects.chooseCup);\\n I.tap(foodObjects.chooseCup);\\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\\n I.waitForElement(foodObjects.tomatoSoup);\\n I.tap(foodObjects.tomatoSoup);\\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\\n }\",\n \"function randomFood() {\\n\\tfor(var i=0; i<3; i++) {\\n\\t\\tvar rfood = Math.floor(Math.random()*food.length);\\n\\t\\tfoods[i].className = 'food';\\n\\t\\tfoods[i].classList.add(food[rfood]);\\n\\t\\tfoods[i].style.top = randomPosition()+\\\"px\\\";\\n\\t\\tfoods[i].style.left = randomPosition()+\\\"px\\\";\\n\\t\\tcheckEat(pig, foods[i]);\\n\\t}\\n}\",\n \"function fruitOrVegetable(product) {\\n switch (product) {\\n case \\\"cucumber\\\":\\n case \\\"pepper\\\":\\n case \\\"carrot\\\":\\n console.log(\\\"vegetable\\\");\\n break;\\n // TODO: Implement the other cases\\n }\\n}\",\n \"eat() {\\r\\n let consume = this.food - 2\\r\\n if (consume > 1) {\\r\\n this.isHealthy = true\\r\\n return this.food = consume\\r\\n } if (consume <= 0) {\\r\\n this.isHealthy = false\\r\\n return this.food = 0\\r\\n }\\r\\n else if (consume <= 1) {\\r\\n return this.food = consume\\r\\n //alert(this.name + \\\" food supply reached to 0. It's time for a hunt\\\")\\r\\n //this.isHealthy = true\\r\\n }\\r\\n\\r\\n }\",\n \"generateRestaurant(){\\n// we want the user to input the zipcode they want to search, the food type they want to eat\\n// and the rating (1-5) \\n// getRestaurants()\\n\\n\\n}\",\n \"function eatingFood(eatingTime) {\\n switch(eatingTime) {\\n case 'Breakfast':\\n return '07:00';\\n case 'Lunch':\\n return '13:00';\\n default:\\n return 'I do not eat';\\n }\\n}\",\n \"pickUpFood() {\\n var surTile = this.Survivor.getCurrentTile();\\n for (const f of this.foodStock) {\\n if (surTile === f.getTile() && f.getActive()) {\\n f.setActive(false);\\n this.playerFood += this.foodValue;\\n this.playerScore += 10;\\n }\\n }\\n }\",\n \"function changeRestaurant() {\\n if (selectedRestaurant < rRestaurants.length - 1) {\\n const next = selectedRestaurant + 1;\\n dispatch(setSelectedRestaurant(next));\\n } else {\\n dispatch(setSelectedRestaurant(0));\\n }\\n }\",\n \"function getRandomMeal() {\\n const getMeal = async () => {\\n const singleMeal = await getRandom();\\n if (singleMeal) setMeal(singleMeal);\\n setStatus(true);\\n };\\n getMeal();\\n }\",\n \"function eatFood() {\\n if (gameState.snakeStart === gameState.food) {\\n gameState.snakeLength++;\\n\\n updateFoodCell(\\\"remove\\\", gameState.food);\\n\\n createFood();\\n updateFoodCell(\\\"add\\\", gameState.food);\\n gameState.score++;\\n increaseSpeed();\\n showScore();\\n return true;\\n }\\n}\",\n \"function eat(snake, food) {\\n\\tsnake.belly = food.value;\\n\\tresetFood();\\n}\",\n \"eat(){\\n let head = this.state.snakeDots[this.state.snakeDots.length - 1];\\n let food = this.state.food;\\n if (head[0] === food[0] && head[1] === food[1]){\\n this.setState({\\n food : getRandomCo()\\n })\\n this.increaseB();\\n this.SpeedIN();\\n }\\n }\",\n \"function fastFoodMeal(sandwich, side, drink, dessert) {\\n \\n return {\\n sandwich: sandwich,\\n side: side,\\n drink: drink,\\n dessert: dessert,\\n }\\n}\",\n \"function foodClickHandler(foodsitem) {\\n setFood(foodsitem);\\n }\",\n \"function computeFood(inputFood) {\\n if (inputFood) {\\n inputFood = inputFood.toLowerCase();\\n switch (inputFood) {\\n case \\\"italian\\\": \\n parseFood = \\\"cuisine=italian&\\\";\\n break;\\n case \\\"american\\\":\\n parseFood = \\\"cuisine=american&\\\";\\n break;\\n case \\\"chicken\\\": \\n parseFood = \\\"cuisine=chicken&\\\";\\n break;\\n case \\\"burgers\\\": \\n parseFood = \\\"cuisine=burgers&\\\";\\n break;\\n case \\\"salads\\\": \\n parseFood = \\\"cuisine=salads&\\\";\\n break;\\n case \\\"sandwiches\\\": \\n parseFood = \\\"cuisine=sandwiches&\\\";\\n break;\\n case \\\"soups\\\": \\n parseFood = \\\"cuisine=soups&\\\";\\n break;\\n case \\\"subs\\\": \\n parseFood = \\\"cuisine=subs&\\\";\\n break;\\n case \\\"chinese\\\": \\n parseFood = \\\"cuisine=chinese&\\\";\\n break;\\n case \\\"vietnamese\\\": \\n parseFood = \\\"cuisine=vietnamese&\\\";\\n break;\\n case \\\"pizza\\\": \\n parseFood = \\\"cuisine=pizza&\\\";\\n break;\\n case \\\"seafood\\\": \\n parseFood = \\\"cuisine=seafood&\\\";\\n break;\\n case \\\"indian\\\": \\n parseFood = \\\"cuisine=indian&\\\";\\n break;\\n case \\\"asian\\\": \\n parseFood = \\\"cuisine=asian&\\\";\\n break;\\n case \\\"diner\\\": \\n parseFood = \\\"cuisine=diner&\\\";\\n break;\\n case \\\"healthy\\\": \\n parseFood = \\\"cuisine=healthy&\\\";\\n break;\\n case \\\"irish\\\": \\n parseFood = \\\"cuisine=irish&\\\";\\n break;\\n case \\\"mediterranean\\\": \\n parseFood = \\\"cuisine=mediterranean&\\\";\\n break;\\n case \\\"noodles\\\": \\n parseFood = \\\"cuisine=noodles&\\\";\\n break;\\n case \\\"steak\\\": \\n parseFood = \\\"cuisine=steak&\\\";\\n break;\\n case \\\"vegetarian\\\": \\n parseFood = \\\"cuisine=vegetarian&\\\";\\n break;\\n }\\n }\\n}\",\n \"function chooseAction() {\\n\\tinquirer\\n\\t\\t.prompt({\\n\\t\\t\\tname: \\\"action\\\", \\n\\t\\t\\ttype: \\\"rawlist\\\", \\n\\t\\t\\tmessage: \\\"What do you want to do?\\\", \\n\\t\\t\\tchoices: [\\\"VIEW PRODUCTS\\\", \\\"VIEW LOW INVENTORY\\\", \\\"ADD TO INVENTORY\\\", \\\"ADD NEW PRODUCT\\\", \\\"QUIT\\\"]\\n\\t\\t})\\n\\t\\t.then(function(ans) {\\n\\t\\t\\tif(ans.action.toUpperCase() ===\\\"VIEW PRODUCTS\\\") {\\n\\t\\t\\t\\tviewProducts(); \\n\\t\\t\\t} \\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"VIEW LOW INVENTORY\\\") {\\n\\t\\t\\t\\tviewLowInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD TO INVENTORY\\\") {\\n\\t\\t\\t\\taddInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD NEW PRODUCT\\\") {\\n\\t\\t\\t\\taddNewProduct(); \\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tendConnection(); \\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"async displayFoodChoice(step) {\\n const user = await this.userProfile.get(step.context, {});\\n if (user.food) {\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n } else {\\n const user = await this.userProfile.get(step.context, {});\\n\\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\\n\\n if (step.context.activity.text == 1) {\\n user.food = \\\"European\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 2) {\\n user.food = \\\"Chinese\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 3) {\\n user.food = \\\"American\\\";\\n await this.userProfile.set(step.context, user);\\n }else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\\n return await step.beginDialog(WHICH_FOOD);\\n }\\n\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n }\\n return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"function fightOrRun() {\\n var choices = [\\\"Run\\\", \\\"Fight\\\"];\\n var askPlayer = parseInt(readline.keyInSelect(choices, \\\"Do you want to fight like a shark or run like a shrimp???\\\\nThe next monster might be scarier.\\\\n \\\\n What are you going to do? Press 1 to run...Press 2 to fight.\\\"));\\n if (choices === 1) {\\n //call the function for deciding to run \\n run();\\n } else {\\n //call the function for deciding to fight\\n console.log('You decided to fight, bring it on!!.');\\n fight();\\n }\\n }\",\n \"onFood () {\\r\\n let tilePlants = this.tile.objs.filter(o => o.name === 'plant')\\r\\n if (tilePlants.length < 1) return false\\r\\n return tilePlants[0]\\r\\n }\",\n \"function foodFunc() {\\n\\n var favFood = prompt('Guess one of the top four styles of foods that I enjoy eating.').toLowerCase();\\n var foodStyles = ['mexican', 'italian', 'southern', 'japanese'];\\n\\n for (var i = 0; i < 5; i++) {\\n if (favFood === foodStyles[0] || favFood === foodStyles[1] || favFood === foodStyles[2] || favFood === foodStyles[3]) {\\n favFood = alert('Correct, ' + favFood + ' food is delicious!');\\n score++;\\n break;\\n } else if (i !== 6) {\\n favFood = prompt('That doesn\\\\'t make the top four. Please try again.');\\n }\\n }\\n if (i === 5) {\\n favFood = alert('My top four favorite styles of food are mexican, italian, southern, and japanese food!');\\n }\\n}\",\n \"function makeEnemyChoice() {\\n const choices = [\\\"horse\\\", \\\"hay\\\", \\\"sword\\\"];\\n const choiceIndex = Math.floor(Math.random() * choices.length);\\n selectItem(\\\"enemy\\\", choices[choiceIndex]);\\n}\",\n \"eat () {\\n if (this.food === 0) {\\n this.isHealthy = false;\\n\\n } else {\\n this.food -= 1;\\n }\\n }\",\n \"function makeChoise() {\\n\\tconsole.log('Func makeChoise');\\n\\tvar choise = 0;\\n\\tif(machina.countCoins == MINERAL_WATER) {\\n\\t\\tchoise = prompt('Press 1 to choose Mineral water or add more coins to make another choise.', 0);\\n\\t\\tif(choise == 1) {\\n\\t\\t\\tmachina.giveMineralWater();\\n\\t\\t}\\n\\t\\telse getCoins();\\n\\t}\\n\\telse if(machina.countCoins == SWEET_WATER ) {\\n\\t\\tchoise = prompt('Press 1 to choose Mineral water or Press 2 to choose Sweet water.', 0);\\n\\t\\tif(choise == 1) {\\n\\t\\t\\tmachina.giveMineralWater();\\n\\t\\t}\\n\\t\\telse machina.giveSweetWater();\\n\\t}\\n}\",\n \"function fightOrFlight() {\\n var fightOrFlight = ask.question(\\\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\\\n\\\")\\n if (fightOrFlight === \\\"f\\\") {\\n fight();\\n } else {\\n run();\\n }\\n}\",\n \"async eatEnergy() {\\n await this.updateAvailableEat();\\n let response = await this.sendRequest(\\\"foodSystem.php\\\", { \\\"whatneed\\\": \\\"eatFrmHldnk\\\" });\\n debug(\\\"Eating...\\\", response);\\n return response;\\n }\",\n \"setSelectedRestaurant(state, resto) {\\n state.selectedRestaurant = resto;\\n }\",\n \"function pickFood() {\\r\\n\\r\\n\\t\\tdocument.getElementById(\\\"searchFood\\\").value = \\\"\\\";\\r\\n\\t\\tlet food = document.getElementById(this.id).innerHTML;\\r\\n\\t\\tlet foodName = \\\"\\\";\\r\\n\\t\\tlet foodSplit = food.split(/[ \\\\t\\\\n]+/);\\r\\n\\r\\n\\t\\tfor(let i = 0; i < foodSplit.length; i++) {\\r\\n\\t\\t\\tfoodName += foodSplit[i];\\r\\n\\t\\t\\tif(i + 1 < foodSplit.length) {\\r\\n\\t\\t\\t\\tfoodName += \\\"+\\\";\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tlet url = \\\"https://www.themealdb.com/api/json/v1/1/search.php?s=\\\"+foodName;\\r\\n\\t\\tfetch(url)\\r\\n\\t\\t\\t.then(checkStatus)\\r\\n\\t\\t\\t.then(function(responseText) {\\r\\n\\t\\t\\t\\tlet json = JSON.parse(responseText);\\r\\n\\t\\t\\t\\tclear();\\r\\n\\t\\t\\t\\taddTop(json);\\r\\n\\t\\t\\t\\taddIngredients(json);\\r\\n\\t\\t\\t\\taddDirections(json);\\r\\n\\t\\t\\t\\textras(json);\\r\\n\\t\\t\\t\\tdocument.getElementById(\\\"image\\\").style.visibility = \\\"visible\\\";\\r\\n\\t\\t\\t})\\r\\n\\t\\t\\t.catch(function(error) {\\r\\n\\t\\t\\t\\tconsole.log(error);\\r\\n\\t\\t\\t\\tlet error1 = document.getElementById(\\\"error\\\");\\r\\n\\t\\t\\t\\terror1.innerHTML = \\\"Sorry a problem occurred with API, try another name\\\";\\r\\n\\t\\t\\t});\\r\\n\\t}\",\n \"function findTheCheese (foods) {\\n for (var i=0; i= 1) {\\n\\t\\t\\t\\t\\tadventure = \\\"restaurant\\\";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse if (activity == 1 && budget == 0) {\\n\\t\\t\\t\\t\\tadventure = \\\"shopping_mall\\\";\\n\\t\\t\\t\\t} else if (activity == 1 && budget >= 1) {\\n\\t\\t\\t\\t\\tadventure = \\\"amusement_park\\\";\\n\\t\\t\\t\\t} else if (activity == 2 && budget == 0) {\\n\\t\\t\\t\\t\\tadventure = \\\"bar\\\";\\n\\t\\t\\t\\t} else if (activity == 2 && budget >= 1) {\\n\\t\\t\\t\\t\\tadventure = \\\"spa\\\";\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function Traveler(food, name, isHealthy) {\\n this.isHealthy = true; //setting as true to begin with\\n this.food = food; // CB Note: can put this getRandomIntInclusive(1,0); --not best solution\\n this.name = name;\\n this.isHealthy = isHealthy;\\n }\",\n \"function chooseAction(me, opponent, t) {\\n // This strategy uses the state variable 'evil'.\\n // In every round, turn 'not angel' with 10% probability.\\n // (And remain this way until the 200 rounds are over.)\\n if (Math.random() < 0.1) {\\n angel = false;\\n }\\n\\n // If angel, recycle\\n if (angel) return 1;\\n\\n return 0; // Waste otherwise\\n }\",\n \"async promptForFood(step) {\\n if (step.result && step.result.value === 'yes') {\\n\\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\\n {\\n retryPrompt: 'Sorry, I do not understand or say cancel.'\\n }\\n );\\n } else {\\n return await step.next(-1);\\n }\\n}\",\n \"function flavorBanana() {\\n\\t// flavor texts\\n\\tflavors = [\\\"Bananas are radioactive.\\\",\\\"Bananas are clones.\\\",\\\"Most types of banana are unpalatable.\\\",\\\"Bananas are technically a berry.\\\",\\\"A cluster of bananas is called a \\\\\\\"hand.\\\\\\\"\\\"];\\n\\t// pick a flavor text and return it\\n\\tflavor = Math.floor(Math.random() * flavors.length);\\n\\treturn flavors[flavor];\\n}\",\n \"function selectMeat(meat) {\\n if($scope.model.selectedBurger.meat) {\\n $scope.model.selectedBurger.meat.selected = false;\\n }\\n $scope.model.selectedBurger.meat = meat;\\n $scope.model.selectedBurger.meat.selected = true;\\n selectStep('cheese');\\n }\",\n \"function doChoice(e) {\\n if (this.selectedIndex>0) {\\n var c = favlist[this.options[this.selectedIndex].value];\\n\\t\\tvar fail = false;\\n if (c) {\\n var i;\\n setNotice('Loading fav ...');\\n for (i=1;i<=c.length;i++) {\\n fail |= setState(i,c[i-1]);\\n }\\n for (;i<=11;i++) {\\n clearState(i);\\n }\\n }\\n this.selectedIndex = 0;\\n\\t\\tif (fail)\\n\\t\\t\\taddNotice('Item(s) not found!');\\n\\t\\telse\\n\\t\\t\\taddNotice('Fav loaded!');\\n }\\n}\",\n \"function findFood(post) {\\n\\t\\tconsole.log(post);\\n\\t\\trestaurantCheck(post);\\n\\t\\tpost = filterPost(post); // filters posts\\n\\n\\t\\t// checks spoonacular API to find foods\\n\\t\\tpost.forEach(function (element, index) {\\n\\t\\t\\tclassifyCuisine(element);\\n\\t\\t\\tingredientSearch(element);\\n\\t\\t});\\n\\t}\",\n \"function foodFactory() {\\n\\n\\t\\t//generate food randomly with 1/10 chance\\n\\t\\tif (Math.floor((Math.random() * 25) + 1) === 3) {\\n\\n\\t\\t\\t//randomly position it on the field\\n\\t\\t\\tvar randomX = Math.floor((Math.random() * size) );\\n\\t\\t\\tvar randomY = Math.floor((Math.random() * size) );\\n\\n\\t\\t\\t//if selected field is empty create food here\\n\\t\\t\\tif (game[randomY][randomX] === 0) {\\n\\t\\t\\t\\tgame[randomY][randomX] = 2;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function ingredientSearch (food) {\\n\\n\\t\\t// J\\n\\t\\t// Q\\n\\t\\t// U\\n\\t\\t// E\\n\\t\\t// R\\n\\t\\t// Y\\n\\t\\t$.ajax ({\\n\\t\\t\\tmethod: \\\"GET\\\",\\n\\t\\t\\turl: ingredientSearchURL+\\\"?metaInformation=false&number=10&query=\\\"+food,\\n\\t\\t headers: {\\n\\t\\t 'X-Mashape-Key': XMashapeKey,\\n\\t\\t 'Content-Type': \\\"application/x-www-form-urlencoded\\\",\\n\\t\\t \\\"Accept\\\": \\\"application/json\\\"\\n\\t\\t }\\n\\t\\t}).done(function (data) {\\n\\t\\t\\t// check each returned ingredient for complete instance of passed in food\\n\\t\\t\\tfor (var i = 0; i < data.length; i++) {\\n\\t\\t\\t\\tvar word_list = getWords(data[i].name);\\n\\t\\t\\t\\t// ensures food is an ingredient and not already in the food list\\n\\t\\t\\t\\tif (word_list.indexOf(food) !== -1 && food_list.indexOf(food) === -1) {\\n\\t\\t\\t\\t\\tfood_list.push(food);\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\",\n \"function generateRandomFood() {\\n\\n\\t\\tvar x = Math.floor((Math.random() * BOARD_SIZE));\\n\\t\\tvar y = Math.floor((Math.random() * BOARD_SIZE));\\n\\n\\t\\tvar pos = new Position(x,y);\\n\\n\\t\\twhile(snakeAtPosition(pos)) {\\n\\n\\t\\t\\tx = Math.floor((Math.random() * BOARD_SIZE));\\n\\t\\t\\ty = Math.floor((Math.random() * BOARD_SIZE));\\n\\t\\t\\tpos = new Position(x,y);\\n\\t\\t}\\n\\n\\t\\treturn new Food(pos.x, pos.y);\\n\\t}\",\n \"function systemSelection(option){\\n\\tvar check = option; \\n\\tif(vehicleFuel<=0){\\n\\t\\tgameOverLose();\\n\\t}\\n\\n\\telse{\\n\\n\\n\\tif(currentLocation===check){\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\\\",beginTravel);\\n\\t\\t\\t}\\n\\n\\telse{\\n\\t\\n\\t\\t\\tif(check.toLowerCase() === \\\"e\\\"){\\n\\t\\t\\t\\tvehicleFuel=(vehicleFuel-10);\\n\\t\\t\\t\\tcurrentLocation=\\\"e\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Earth...You used 10 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToEarth);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"m\\\"){\\n\\t\\t\\t//need to add a 'visited' conditional\\n\\t\\t\\tvehicleFuel=(vehicleFuel-20);\\n\\t\\t\\tcurrentLocation=\\\"m\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Mesnides...You used 20 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\", goToMesnides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"l\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-50);\\n\\t\\t\\tcurrentLocation=\\\"l\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Laplides...You used 50 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToLaplides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"k\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-120);\\n\\t\\t\\tcurrentLocation=\\\"k\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Kiyturn...You used 120 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToKiyturn);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"a\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-25);\\n\\t\\t\\tcurrentLocation=\\\"a\\\";\\n\\t\\t\\tgamePrompt(\\\"Flying to Aenides...You used 25 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToAenides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"c\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-200);\\n\\t\\t\\tcurrentLocation=\\\"c\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Cramuthea...You used 200 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToCramuthea);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"s\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-400);\\n\\t\\t\\tcurrentLocation=\\\"s\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Smeon T9Q...You used 400 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToSmeon);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"g\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-85);\\n\\t\\t\\tcurrentLocation=\\\"g\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToGleshan);\\n\\t\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, I did not understand you. I will return you to the main menu\\\",beginTravel);\\n\\t\\t}\\n\\t}\\n\\t}\\n}\",\n \"function chap19(){\\n var wantChicken = false;\\n var foodArray = [\\\"Salmon\\\", \\\"Tilapia\\\", \\\"Tuna\\\", \\\"Lobster\\\"];\\n var customerOrder = prompt(\\\"What would you like?\\\", \\\"Look the menu\\\");\\n for (var i = 0; i <= 3; i++) {\\n if (customerOrder === foodArray[i]) {\\n wantChicken = true;\\n alert(\\\"We have it on the menu!\\\");\\n break;\\n }\\n }\\n if(wantChicken===false) {\\n\\t\\talert(\\\"We don't serve chicken here, sorry.\\\");\\n\\t}\\n}\",\n \"function createFood() {\\n food.FOOD_COLOUR = food.colours[Math.floor(Math.random()*7)]\\n // Generate a random number the food x-coordinate\\n food.x = randomTen(0, gameCanvas.width - 10);\\n // Generate a random number for the food y-coordinate\\n food.y = randomTen(0, gameCanvas.height - 10);\\n \\n\\n // if the new food location is where the snake currently is, generate a new food location\\n snakeOne.snake.forEach(function isFoodOnSnake(part) {\\n const foodIsoNsnake = part.x == food.x && part.y == food.y;\\n if (foodIsoNsnake) createFood();\\n });\\n }\",\n \"function doSomething(chosen, title) {\\n switch (chosen) {\\n case 'my-tweets':\\n tweetIt();\\n break;\\n case 'spotify-this-song':\\n songIt(title);\\n break;\\n case 'movie-this':\\n movieIt(title);\\n break;\\n case 'do-what-it-says':\\n doIt();\\n break;\\n }\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\\n if(userInput === \\\"1\\\"){\\n \\n randomDestination = yesOrNo(destination,destination);\\n \\n }\\n else if (userInput === \\\"2\\\") {\\n \\n randomRestaurant = yesOrNo(restaurant,restaurant);\\n }\\n else if (userInput === \\\"3\\\") {\\n \\n randomTravelType = yesOrNo(transportation, transportation);\\n }\\n else if (userInput === \\\"4\\\") {\\n \\n randomEntertainment = yesOrNo(entertainment,entertainment);\\n }\\n}\",\n \"function setFood() {\\n\\tvar empty = [];\\n\\t\\n\\t//finds all empty cells so not to collide with snake\\n\\tfor (var x=0; x < grid.w; x++) {\\n\\t\\tfor (var y=0; y < grid.h; y++) {\\n\\t\\t\\tif (grid.get(x, y) == emptyFill) {\\n\\t\\t\\t\\tempty.push({x:x, y:y});\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\t//puts food in random cell\\n\\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))];\\n\\tgrid.set(foodFill, randpos.x, randpos.y);\\n}\",\n \"function randomFood() {\\n var fRow = Math.floor(Math.random() * 19);\\n var fCol = Math.floor(Math.random() * 19);\\n var foodCell = $('#cell_'+fRow+'_'+fCol);\\n if (!foodCell.hasClass('snake-cell')) {\\n foodCell.addClass(\\\"food-cell\\\");\\n food='_'+fRow+'_'+fCol;\\n }\\n else randomFood();\\n }\",\n \"function fightOrCave() {\\n\\n let whereNext = prompt(\\\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\\\").toLowerCase();\\n\\n if (whereNext === \\\"grottan\\\"){\\n goToCaveSecondTime();\\n }\\n else if (whereNext === \\\"fight\\\") {\\n alert(\\\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\\\")\\n goToCaveSecondTime();\\n }\\n else {\\n alert(\\\"Vänligen ange fight eller grottan\\\")\\n fightOrCave()\\n }\\n\\n \\n}\",\n \"function generateMealPlan() {\\n // here we will let them decide, based on their diet type, we can take a quick survey of the current diet type\\n // when they click generate a meal plan because this can change very regularly\\n\\n if (dietType == 'maintain' /* check if the diet type == maintainWeight*/) {\\n // this means that they do not need to change amount of calories burn, so essentially calorieLoss = regular loss\\n calorieIntake = calculateBMR();\\n } else if (dietType == 'gain' /*check if the diet type == weightGain*/) {\\n // to gain weight we must add around 500 calories (this is a changing factor) to the intake amount\\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\\n // are they trying to gain, normal (healthy) amount are 0.5lb (+250 calories) and 1lb (+500 calories) a week\\n neededCalories = 250 /* 250 ?*/; //again we will check and change this value depending on amount loss\\n calorieIntake = calculateBMR() + neededCalories;\\n } else if (dietType == 'loss') {\\n // to lose weight we must subtract around 500 calories(this is a changing factor) to the intake amount\\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\\n // are they trying to lose, normal (healthy) amount are 0.5lb (-250 calories) and 1lb (-500 calories) a week\\n neededCalories = 250 /* 500 ?*/;\\n calorieIntake = calculateBMR() - neededCalories;\\n }\\n\\n // now we can call the calorieIntake value and essentially grab a meal/meals that are within this range for the\\n // user\\n\\n // we can make calls to the database and check for the essential meal here this might be a little difficult\\n // since we need to make a meal for the day in a sense, so we need to check with the nutritionist \\n // about what should be allocated for calories for breakfast, lunch, and dinner\\n\\n // also we need to check for allergies and account for this in some way, but that can be handled later\\n // once we nail down the functionality of this.\\n return calorieIntake;\\n}\",\n \"function fighterSelect() {\\n if (userSelected === false) {\\n userChoice.append($(this));\\n userSelected = true;\\n for (let i = 0; i < fighterArray.length; i++) {\\n if ($(this).attr('alt') === fighterArray[i].name) {\\n userFighter = fighterArray[i];\\n userFighter.hide();\\n }\\n }\\n return userFighter\\n }\\n \\n else if (userSelected === true && enemySelected === false) {\\n enemyChoice.append($(this));\\n enemySelected = true;\\n for (let i = 0; i < fighterArray.length; i++) {\\n if ($(this).attr('alt') === fighterArray[i].name) {\\n enemyFighter = fighterArray[i];\\n enemyFighter.hide();\\n }\\n }\\n return enemyFighter;\\n }\\n }\",\n \"async function e_greedy() {\\r\\n\\t\\tlet action;\\r\\n\\t\\t//Based off explore/exploit\\r\\n\\t\\tif (Math.random() < epsilon) { //chooses best action\\r\\n\\t\\t\\t//read max value from firestore database and get the id\\r\\n\\t\\t\\tlet response = await getMax(s);\\r\\n\\t\\t\\taction = response;\\r\\n\\t\\t} else { //choose random action\\r\\n\\t\\t\\taction = Math.floor(Math.random() * Math.floor(states));; //if a = 8, this indicates to choose random state\\r\\n\\t\\t}\\r\\n\\t\\treturn action;\\r\\n\\t}\",\n \"function pickSearchTerm() {\\n let options = [\\\"stop\\\", \\\"mad\\\", \\\"angry\\\", \\\"annoyed\\\", \\\"cut it\\\" ];\\n return options[Math.floor(Math.random() * 4)];\\n}\",\n \"function printFruitOrVeggie(word) {\\n switch (word) {\\n case 'banana':\\n case 'apple':\\n case 'kiwi':\\n case 'cherry':\\n case 'lemon':\\n case 'grapes':\\n case 'peach':\\n console.log('fruit'); break;\\n case 'tomato':\\n case 'cucumber':\\n case 'pepper':\\n case 'onion':\\n case 'parsley':\\n case 'garlic':\\n console.log('vegetable'); break;\\n default:\\n console.log('unknown');\\n }\\n }\",\n \"checkForFood(foods) {\\n for (var i=0; i < foods.length; i++) {\\n let distance = Math.abs(super.subtractVectors(this.position, foods[i].position));\\n if (distance <= this.senseRadius && distance >= 0) {\\n if (distance <= this.stepSize / 2 && distance >= 0) {\\n this.eat(foods[i]);\\n this.foodIsNearby = false;\\n } else {\\n this.foodIsNearby = true;\\n }\\n } else {\\n this.foodIsNearby = false;\\n }\\n }\\n }\",\n \"function checkMeat(food) {\\n var aisle = food;\\n console.log(aisle);\\n console.log(aisleIngredients);\\n if (aisleIngredients.indexOf(\\\"Seafood\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Seafood\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Frozen;Meat\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Frozen;Meat\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Meat\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Meat\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Pasta and Rice\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Pasta and Rice\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Cheese\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Cheese\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Produce\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Produce\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Nuts\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Nuts\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else {\\n lastWine();\\n }\\n}\",\n \"function selectRestaurant() {\\n let restaurant = document.getElementById(\\\"dropdown\\\").firstChild.value;\\n let clear;\\n if (restaurant === null) {\\n return;\\n } else if (Object.keys(order.items).length > 0) {\\n //Confirm the if the user wants to proceed to clear the order\\n clear = confirm(\\\"Would you like to clear the current order?\\\");\\n if(!clear) {\\n document.getElementById(\\\"dropdown\\\").firstChild.value = \\\"\\\";\\n return;\\n }\\n }\\n\\n clearOrder(true);\\n\\n changeRestaurant(restaurant);\\n\\n}\",\n \"function randomEmote () {\\n let emoteState = pet_info.state\\n \\n switch(emoteState) {\\n case 'good':\\n const goodPetStates = [\\n './assets/Emote_Heart.png',\\n './assets/Emote_Hi!.gif',\\n './assets/Emote_Game.png',\\n './assets/Emote_Laugh.gif',\\n './assets/Emote_Happy.png',\\n './assets/Emote_Note.png',\\n './assets/Emote_Yes.gif'\\n ]\\n \\n const goodArrayLength = goodPetStates.length\\n let goodSelectedState = Math.floor((Math.random() * goodArrayLength) + 0)\\n\\n $('.pet-state').attr('src', goodPetStates[goodSelectedState])\\n \\n break\\n case 'bad':\\n const badPetStates = [\\n './assets/Emote_No.gif',\\n './assets/Emote_Sad.png',\\n './assets/Emote_Sick.gif',\\n './assets/Emote_Surprised.gif',\\n './assets/Emote_Uh.gif',\\n './assets/Emote_Angry.png'\\n ]\\n \\n const badArrayLength = badPetStates.length\\n let badSelectedState = Math.floor((Math.random() * badArrayLength) + 0)\\n \\n $('.pet-state').attr('src', badPetStates[badSelectedState])\\n \\n break\\n case 'dead':\\n const deadPetStates = [\\n './assets/Emote_Sleep.png',\\n './assets/Emote_X.png',\\n './assets/Emote_Exclamation.png'\\n ]\\n \\n const deadArrayLength = deadPetStates.length\\n let deadSelectedState = Math.floor((Math.random() * deadArrayLength) + 0)\\n \\n $('.pet-state').attr('src', deadPetStates[deadSelectedState])\\n \\n break\\n default:\\n const defaultPetState = 'Emote_Question.png'\\n $('.pet-state').attr('src', defaultPetState)\\n }\\n}\",\n \"function alertAll() {\\n let ask = prompt(`What type of coffee maker you are interested in? : \\\\n Drip,Carob,Coffee-Machine`)\\n let lowerAsk = ask.toLowerCase();\\n\\n if (lowerAsk == 'drip') {\\n newCoffeeMachine.firstMethod()\\n newCoffeeMachine.history()\\n }\\n if(lowerAsk == 'carob'){\\n newCoffeeMachine3.firstMethod()\\n newCoffeeMachine3.mainType()\\n }\\n if(lowerAsk == 'coffee-machine'){\\n newCoffeeMachine2.firstMethod()\\n newCoffeeMachine2.history()\\n }\\n}\",\n \"function pickUp(index) {\\n var pt = self[self.turn];\\n var result = self.food[pt];\\n if (!result) return; // Nothing to do\\n if (result.length == 1) index = 0; // Unique\\n if (index == null) { // Can't decide now...\\n newState.pending = action;\\n return;\\n }\\n reward += self.food[pt][index]; // Take the food\\n newState.food[pt] = null; // Food is now gone\\n }\",\n \"function eatFood() {\\n var lastball = snake[snake.length - 1];\\n if (lastball.x == food.x * 20 && lastball.y == food.y*20 ) {\\n eat.play()\\n score++;\\n add();\\n createFood();\\n }\\n}\",\n \"function placeFood() {\\n if (!isThereEmptyCell()) return;\\n var cell = getCell([~~(Math.random() * settings.size[0]), ~~(Math.random() * settings.size[1])]);\\n if (cell.className) placeFood();\\n else cell.className = 'food';\\n }\",\n \"onSelectRestaurant(restaurant){\\n this.closeAllRestaurant()\\n restaurant.viewDetailsComments()\\n restaurant.viewImg()\\n\\n }\",\n \"function selectCheese(cheese) {\\n if($scope.model.selectedBurger.cheese) {\\n $scope.model.selectedBurger.cheese.selected = false;\\n }\\n if(cheese !== undefined) {\\n $scope.model.selectedBurger.cheese = cheese;\\n $scope.model.selectedBurger.cheese.selected = true;\\n }\\n\\n selectStep('salads');\\n }\",\n \"function selectAction() {\\n inquirer.prompt([\\n {\\n name: \\\"action\\\",\\n message: \\\"Please select what you want to do:\\\",\\n type: \\\"list\\\",\\n choices: [\\n \\\"View Product Sales by Department\\\",\\n \\\"Create New Department\\\",\\n ]\\n }\\n // use if to lead manager to the different functions\\n ]).then(function (answers) {\\n if (answers.action === \\\"View Product Sales by Department\\\") {\\n // run the list function to display all available product\\n console.log(\\\"=============================================\\\")\\n salesByDepartment()\\n } else if (answers.action === \\\"Create New Department\\\") {\\n // run the lowInventory function to display all product with lower than 5 stock quant\\n console.log(\\\"=============================================\\\")\\n createDepartment() \\n } else {\\n console.log(\\\"I don't know what you want to do.\\\")\\n }\\n })\\n}\",\n \"function findTheCheese (foods) {\\n const cheese = [\\\"cheddar\\\", \\\"gouda\\\", \\\"camembert\\\"];\\n \\n for (let i=0; i < foods.length; i++) { \\n \\n let flag = cheese.indexOf(foods[i]);\\n \\n if(flag !== -1) {\\n return foods[i];\\n }\\n } \\n return \\\"no cheese!\\\";\\n}\",\n \"function app(people){\\n let searchType = promptFor(\\\"Do you know the name of the person you are looking for? Enter 'yes' or 'no'\\\", yesNo).toLowerCase();\\n let searchResults;\\n let pickAdventure;\\n switch(searchType){\\n case 'yes':\\n searchResults = searchByName(people);\\n break;\\n case 'no':\\n let pickAdventure = decideSearch();\\n if (pickAdventure === \\\"one\\\"){\\n searchResults = searchByTraits(people);\\n } \\n else if (pickAdventure === \\\"multiple\\\"){\\n //multiple search\\n }\\n else{\\n alert(\\\"Invalid Response\\\");\\n decideSearch();\\n }\\n // TODO: search by traits\\n break;\\n default:\\n app(people); // restart app\\n break;\\n }\\n \\n // Call the mainMenu function ONLY after you find the SINGLE person you are looking for\\n mainMenu(searchResults, people);\\n \\n}\",\n \"function explore(name) {\\n // create a random number, if that number is either 3, 6 or 9, the player will fight a monster\\n const randomNumber = Math.floor(Math.random() * 10) + 1;\\n\\n if (randomNumber === 3 || randomNumber === 6 || randomNumber === 9) {\\n // disable button to explore tower and insert dialogue that let players know which monster they are facing\\n disableExploreTowerButton();\\n monsterEncounterDialogue();\\n \\n } else {\\n exploreDialogue(name);\\n }\\n}\",\n \"function pickFruits() {\\n return getApple()\\n .then(apple => {\\n return getBanana()\\n .then(banana => `${apple} + ${banana}`);\\n });\\n}\",\n \"function aDifficultChoice(choice){\\n if(choice==1){\\n return 'Take her daughter to a doctor';\\n }\\n else{\\n if(choice==-1)\\n {\\n return 'Break down and give up all hope';\\n } \\n }\\n if(typeof(choice)=='undefined')\\n {\\n return \\\"Wasn't able to decide\\\";\\n }\\n else{\\n if(choice==\\\"I give up\\\")\\n {\\n return \\\"Refused to do anything for Karen\\\";\\n }\\n}\\n}\",\n \"function ChooseBattleOption(){\\r\\n\\r\\n PotentialDamageBlocked[0] = 0; // If Both Players Defend\\r\\n PotentialDamageDealt[0] = Attack; // If Both Players Attack\\r\\n\\r\\n if (NatureControllerScript.Attack >= Defence) PotentialDamageBlocked[1] = Defence; //If Nature Attacks and Human defends\\r\\n if (NatureControllerScript.Attack < Defence) PotentialDamageBlocked[1] = NatureControllerScript.Attack; //If Nature Attacks and Human defends\\r\\n\\r\\n var NetDamageDealt: int; \\r\\n NetDamageDealt = Attack - NatureControllerScript.Defence;\\r\\n if (NetDamageDealt > 0) PotentialDamageDealt[1] = NetDamageDealt; //If Human Attacks and Nature defends\\r\\n if (NetDamageDealt <= 0) PotentialDamageDealt[1] = 0; //If Human Attacks and Nature defends (Successful Defence)\\r\\n\\r\\n AttackingPotential = (PotentialDamageDealt[0]+PotentialDamageDealt[1])/2;\\r\\n DefendingPotential = (PotentialDamageBlocked[0]+PotentialDamageBlocked[1])/2;\\r\\n \\r\\n if (DefendingPotential > AttackingPotential){\\r\\n Choice = 1; //Defend\\r\\n }\\r\\n\\r\\n if (AttackingPotential > DefendingPotential){\\r\\n Choice = 0; //Attack\\r\\n }\\r\\n\\r\\n if (AttackingPotential == DefendingPotential){\\r\\n if (Health >= NatureControllerScript.Health) Choice = 0; //Choice = Attack\\r\\n if (Health < NatureControllerScript.Health) Choice = 1; //Choice = Defend\\r\\n }\\r\\n}\",\n \"function picker(action, target) {\\n switch (action) {\\n case \\\"concert-this\\\":\\n concertthis(target);\\n break;\\n\\n case \\\"spotify-this-song\\\":\\n spotifythissong(target);\\n break;\\n\\n case \\\"movie-this\\\":\\n moviethis(target);\\n break;\\n\\n case \\\"do-what-it-says\\\":\\n dowhatitsays();\\n break;\\n\\n default:\\n console.log(\\\"Hmmm ... I don't understand.\\\");\\n break;\\n }\\n}\",\n \"function spawnFood() {\\n\\tvar x = Math.floor(Math.random()*(WIDTH-3))+1;\\n\\tvar y =\\tMath.floor(Math.random()*(HEIGHT-5))+3;\\n\\tvar f = {x: x, y: y};\\n\\tvar clear = snake.body.every(\\n\\t\\t\\tfunction(cell) {\\n\\t\\t\\t\\treturn !isTouchingFood(cell, f);\\n\\t\\t\\t}) && !isTouchingFood(snake.head, f);\\n\\tif (clear) {\\n\\t\\tfood = new Food(x, y);\\n\\t} else {\\n\\t\\tspawnFood();\\n\\t}\\n}\",\n \"function Food() {\\n var food_x = Math.floor(Math.random() * backWidth);\\n var food_y = Math.floor(Math.random() * backHeight);\\n\\n board[food_y][food_x].food = 1;\\n }\",\n \"function pickLocForFood() {\\n\\tvar cols = floor(windowWidth/s.sWidth);\\n\\tvar rows = floor(windowHeight/s.sHeight);\\n\\tfoodPosition =createVector(floor (random(cols)), floor(random(rows)));\\n\\tfoodPosition.x = constrain (foodPosition.x * s.sWidth, 20, windowWidth-s.sWidth-60);\\n\\tfoodPosition.y = constrain (foodPosition.y * s.sHeight, 20, windowWidth-s.sHeight-20);\\n}\",\n \"function hasPizza (foodTray) {\\n return foodTray.indexOf('pizza') !== -1;\\n}\",\n \"async function makeFood(step) {\\n try {\\n if (step < brusselSprouts.length) {\\n await addFood(brusselSprouts[step], \\\"#brusselSprouts\\\"); // Coloco o passo atual na fila\\n makeFood(step + 1); // Dou o próximo passo na receita\\n } else {\\n throw \\\"End of recipe.\\\";\\n }\\n } catch (err) {\\n console.log(err);\\n }\\n}\",\n \"function whichMeal(datapoint){\\n let f = datapoint.whichMeal;\\n if (f = \\\"breakfast\\\"){\\n return \\\"0.1\\\";\\n }else if (f = \\\"lunch\\\"){\\n return \\\"0.5\\\";\\n }else if (f = \\\"lunch\\\"){\\n return \\\"1\\\";\\n }\\n}\",\n \"function EatFood(agent) {\\n\\tthis.description = 'eating food';\\n\\n\\tthis.evaluate = function(context) {\\n\\t\\tvar self = this;\\n\\t\\tvar result = agent.grid.eachThing(function(food) {\\n\\t\\t\\tif(!food.claimedBy &&\\n\\t\\t\\t\\tagent.pos.x == food.pos.x &&\\n\\t\\t\\t\\tagent.pos.y == food.pos.y) {\\n\\t\\t\\t\\tagent.grid.claimFood(food, agent);\\n\\t\\t\\t}\\n\\t\\t\\tif(food.claimedBy == agent) {\\n\\t\\t\\t\\tcontext.updateRunningTime(self, context.elapsedTime);\\n\\t\\t\\t\\tfood.consume(context.runningTime);\\n\\t\\t\\t\\treturn BT.NodeStatus.Running;\\n\\t\\t\\t}\\n\\t\\t}, Food);\\n\\n\\t\\treturn typeof result !== 'undefined' ? result : BT.NodeStatus.Failure;\\n\\t};\\n}\",\n \"randomAction() {\\n var action;\\n const role = this.role.toLowerCase();\\n switch (this.location.location.toLowerCase()) {\\n case 'throne': \\n if (role == 'advisor' && randomChoice([0,1,1]) == 1) {\\n action = new Action.Propose(randomChoice([100,150,200,300]),randomChoice([this.game.courtyard,this.game.chapel,this.game.barracks]));\\n } break;\\n case 'courtyard': break;\\n case 'ballroom': \\n if (role != 'captain' && role != 'grim' && randomChoice([0,1,1]) == 1) {\\n action = new Action.Laud(randomChoice(this.game.characters));\\n } break;\\n case 'chapel':\\n if (role != 'captain' && randomChoice([0,1,1]) == 1) {\\n action = new Action.Pray();\\n } break;\\n case 'barracks': break;\\n }\\n if (action == null) {\\n action = randomChoice([0,0,1]) == 1 ? this.randomVisit() : new Action.Investigate(randomChoice(this.game.characters));\\n }\\n if (action.time <= this.time) {\\n return action;\\n } else {\\n return new Action.End(this.time);\\n }\\n }\",\n \"function handleNewMealRequest(response) {\\n // Get a random meal from the random meals list\\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\\n var meal = RANDOM_MEALS[mealIndex];\\n\\n // Create speech output\\n var speechOutput = \\\"Here's a suggestion: \\\" + meal;\\n\\n response.tellWithCard(speechOutput, \\\"MealRecommendations\\\", speechOutput);\\n}\",\n \"function select_by_weather(recipes) {\\n recipes.forEach(recipe => {\\n recipe['weather'] = false;\\n });\\n let selectedChoices = findIfFilters(\\\"weather\\\");\\n if (selectedChoices.length === 0) {\\n document.querySelector('#no-filter-chosen').style.display = 'block';\\n } else {\\n filter(\\\"weather\\\", selectedChoices);\\n display_selected_recipes();\\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\\n }\\n}\",\n \"function displayPizzaType(){\\n if (pizzaArray.indexOf(randPizza) === 0){\\n pizzaType.innerText = 'Cheese';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese';\\n } else if (pizzaArray.indexOf(randPizza) === 1){\\n pizzaType.innerText = 'Pepperoni';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Pepperoni';\\n } else if (pizzaArray.indexOf(randPizza) === 2){\\n pizzaType.innerText = 'Sausage & Peppers';\\n ingredientList.innerHTML = 'Sauce, Cheese, Sausage, Peppers';\\n } else if (pizzaArray.indexOf(randPizza) === 3){\\n pizzaType.innerText = 'Breath-mint';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Anchovies, Garlic, Onion';\\n } else if (pizzaArray.indexOf(randPizza) === 4){\\n pizzaType.innerText = 'Marg';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Basil, Garlic, Tomato';\\n } else if (pizzaArray.indexOf(randPizza) === 5){\\n pizzaType.innerText = 'Meat Lovers';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Sausage, Pepperoni, Bacon, Ham';\\n } else if (pizzaArray.indexOf(randPizza) === 6){\\n pizzaType.innerText = 'Veggie';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Mushroom, Onion, Peppers, Tomato';\\n } else if (pizzaArray.indexOf(randPizza) === 7){\\n pizzaType.innerText = 'White';\\n ingredientList.innerHTML = 'Ingredients
    Cheese, Basil, Tomato, Garlic';\\n } else if (pizzaArray.indexOf(randPizza) === 8){\\n pizzaType.innerText = 'Vegan';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Basil, Tomato, Mushroom, Onion, Pepper';\\n } else if (pizzaArray.indexOf(randPizza) === 9){\\n pizzaType.innerText = 'Hawaiian';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Ham, Pineapple';\\n } \\n\\n}\",\n \"function getChoice() {\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\"]\\n }).then(function(answer) {\\nswitch(answer.action) {\\n\\tcase 'View Products for Sale':\\n\\t\\tviewProducts();\\n\\tbreak;\\n\\n\\tcase 'View Low Inventory':\\n\\t\\tviewLowInventory();\\n\\tbreak;\\n\\t\\n\\tcase 'Add to Inventory':\\n\\t\\trestockInventory();\\n\\tbreak; \\n\\t\\n\\tcase 'Add New Product':\\n\\t\\taddNewProduct();\\n\\tbreak;\\n }\\n })\\n}\",\n \"function Food_Function() {\\n var Food_Output;\\n var Foods = document.getElementById(\\\"Food_Input\\\").value\\n var Food_String = \\\" is a Delicious Food!\\\"\\n switch(Foods) {\\n case \\\"Chips\\\": //a case, are the various conditions that are evaluated \\n Food_Output = \\\"Chips\\\" + Food_String;\\n break;\\n case \\\"Steak\\\":\\n Food_Output = \\\"Steak\\\" + Food_String;\\n break;\\n case \\\"Chicken\\\":\\n Food_Output = \\\"Chicken\\\" + Food_String;\\n break;\\n case \\\"Curry\\\":\\n Food_Output = \\\"Curry\\\" + Food_String;\\n break;\\n case \\\"Chilli\\\":\\n Food_Output = \\\"Chilli\\\" + Food_String;\\n break;\\n case \\\"Purple\\\":\\n Food_Output = \\\"Purple\\\" + Food_String;\\n break;\\n default:\\n Food_Output = \\\"Please enter a Food exactly as written on the above list\\\"; //if no case match prents this\\n}\\ndocument.getElementById(\\\"Output\\\").innerHTML=Food_Output;\\n}\",\n \"choose_treatment(){\\n // Gerando um número aleatório entre 0 e 26.\\n let index = (Math.floor(Math.random()* 25 + 1));\\n // Possíveis formas de tratamento.\\n let treatment = [\\n \\\"consagrado\\\",\\n \\\"condensado\\\",\\n \\\"condenado\\\",\\n \\\"chamuscado\\\",\\n \\\"concursado\\\",\\n \\\"condecorado\\\",\\n \\\"comissionado\\\",\\n \\\"calejado\\\", \\n \\\"cutucado\\\", \\n \\\"cuckado\\\", \\n \\\"abenssoado\\\", \\n \\\"desgraçado\\\", \\n \\\"lisonjeado\\\", \\n \\\"alejado\\\", \\n \\\"afetado\\\", \\n \\\"afeminado\\\", \\n \\\"sensualizado\\\", \\n \\\"fuzilado\\\", \\n \\\"adequado\\\", \\n \\\"algemado\\\", \\n \\\"amargurado\\\", \\n \\\"retardado\\\", \\n \\\"reciclado\\\", \\n \\\"coroado\\\", \\n \\\"abestado\\\", \\n \\\"ensaboado\\\"\\n ];\\n return treatment[index];\\n }\",\n \"function addFoodIcon(food) {\\n switch(pluralize.singular(food.name.toLowerCase())) {\\n case 'apple':\\n return 'apple-1.png';\\n break;\\n case 'asparagus':\\n return 'asparagus.png';\\n break;\\n case 'avocado':\\n return 'avocado.png';\\n break;\\n case 'bacon':\\n return 'bacon.png';\\n break;\\n case 'banana':\\n return 'banana.png';\\n break;\\n case 'bean':\\n return 'beans.png';\\n break;\\n case 'biscuit':\\n return 'biscuit.png';\\n break;\\n case 'blueberry':\\n return 'blueberries.png';\\n break;\\n case 'bread':\\n return 'bread-1.png';\\n break;\\n case 'broccoli':\\n return 'broccoli.png';\\n break;\\n case 'cabbage':\\n return 'cabbage.png';\\n break;\\n case 'cake':\\n return 'cake.png';\\n break;\\n case 'candy':\\n return 'candy.png';\\n break;\\n case 'carrot':\\n return 'carrot.png';\\n break;\\n case 'cauliflower':\\n return 'cauliflower.png';\\n break;\\n case 'cereal':\\n return 'cereals.png';\\n break;\\n case 'cheese':\\n return 'cheese.png';\\n break;\\n case 'cherry':\\n return 'cherries.png';\\n break;\\n case 'chili':\\n return 'chili.png';\\n break;\\n case 'chips':\\n return 'chips.png';\\n break;\\n case 'chives':\\n return 'chives.png';\\n break;\\n case 'green onion':\\n return 'chives.png';\\n break;\\n case 'chocolate':\\n return 'chocolate.png';\\n break;\\n case 'coconut':\\n return 'coconut.png';\\n break;\\n case 'coffee':\\n return 'coffee-2.png';\\n break;\\n case 'cookie':\\n return 'cookies.png';\\n break;\\n case 'corn':\\n return 'corn.png';\\n break;\\n case 'cucumber':\\n return 'cucumber.png';\\n break;\\n case 'egg':\\n return 'egg.png';\\n break;\\n case 'fish':\\n return 'fish.png';\\n break;\\n case 'flour':\\n return 'flour.png';\\n break;\\n case 'fry':\\n return 'fries.png';\\n break;\\n case 'garlic':\\n return 'garlic.png';\\n break;\\n case 'egg':\\n return 'egg.png';\\n break;\\n case 'grape':\\n return 'grapes.png';\\n break;\\n case 'ham':\\n return 'ham.png';\\n break;\\n case 'honey':\\n return 'honey.png';\\n break;\\n case 'ice cream':\\n return 'ice-cream-12.png';\\n break;\\n case 'jam':\\n return 'jam-1.png';\\n break;\\n case 'jelly':\\n return 'jam-1.png';\\n break;\\n case 'lemon':\\n return 'lemon-1.png';\\n break;\\n case 'lime':\\n return 'lime.png';\\n break;\\n case 'milk':\\n return 'milk-1.png';\\n break;\\n case 'mushroom':\\n return 'mushroom.png';\\n break;\\n case 'mustard':\\n return 'mustard.png';\\n break;\\n case 'noodles':\\n return 'noodles.png';\\n break;\\n case 'oat':\\n return 'oat.png';\\n break;\\n case 'olive oil':\\n return 'oil.png';\\n break;\\n case 'vegetable oil':\\n return 'oil.png';\\n break;\\n case 'oil':\\n return 'oil.png';\\n break;\\n case 'olive':\\n return 'olive.png';\\n break;\\n case 'onion':\\n return 'onion.png';\\n break;\\n case 'orange':\\n return 'orange.png';\\n break;\\n case 'pancake':\\n return 'pancakes-1.png';\\n break;\\n case 'pasta':\\n return 'spaguetti.png';\\n break;\\n case 'peach':\\n return 'peach.png';\\n break;\\n case 'pear':\\n return 'pear.png';\\n break;\\n case 'pea':\\n return 'peas.png';\\n break;\\n case 'pepper':\\n return 'pepper.png';\\n break;\\n case 'pickle':\\n return 'pickles.png';\\n break;\\n case 'pie':\\n return 'pie.png';\\n break;\\n case 'pineapple':\\n return 'pineapple.png';\\n break;\\n case 'beer':\\n return 'pint.png';\\n break;\\n case 'pistachio':\\n return 'pistachio.png';\\n break;\\n case 'pizza':\\n return 'pizza.png';\\n break;\\n case 'pomegranate':\\n return 'pomegranate.png';\\n break;\\n case 'potato':\\n return 'potatoes-2.png';\\n break;\\n case 'pretzel':\\n return 'pretzel.png';\\n break;\\n case 'pumpkin':\\n return 'pumpkin.png';\\n break;\\n case 'radish':\\n return 'radish.png';\\n break;\\n case 'raspberry':\\n return 'raspberry.png';\\n break;\\n case 'rice':\\n return 'rice.png';\\n break;\\n case 'brown rice':\\n return 'rice.png';\\n break;\\n case 'white rice':\\n return 'rice.png';\\n break;\\n case 'salad':\\n return 'salad.png';\\n break;\\n case 'lettuce':\\n return 'salad-1.png';\\n break;\\n case 'spinach':\\n return 'salad-1.png';\\n break;\\n case 'kale':\\n return 'salad-1.png';\\n break;\\n case 'salami':\\n return 'salami.png';\\n break;\\n case 'salmon':\\n return 'salmon.png';\\n break;\\n case 'sandwich':\\n return 'sandwich.png';\\n break;\\n case 'sausage':\\n return 'sausage.png';\\n break;\\n case 'italian sausage':\\n return 'sausage.png';\\n break;\\n case 'breakfast sausage':\\n return 'sausage.png';\\n break;\\n case 'steak':\\n return 'steak.png';\\n break;\\n case 'strawberry':\\n return 'strawberry.png';\\n break;\\n case 'sushi':\\n return 'sushi-1.png';\\n break;\\n case 'taco':\\n return 'taco.png';\\n break;\\n case 'toast':\\n return 'toast.png';\\n break;\\n case 'tomato':\\n return 'tomato.png';\\n break;\\n case 'turkey':\\n return 'turkey.png';\\n break;\\n case 'watermelon':\\n return 'watermelon.png';\\n break;\\n case 'wrap':\\n return 'wrap.png';\\n break;\\n case 'chicken':\\n return 'meat.png';\\n break;\\n case 'chicken breast':\\n return 'meat.png';\\n break;\\n case 'ketchup':\\n return 'mustard-2.png';\\n break;\\n case 'ground beef':\\n return 'ham.png';\\n break;\\n case 'ground turkey':\\n return 'ham.png';\\n break;\\n case 'ground chicken':\\n return 'ham.png';\\n break;\\n case 'ground chicken':\\n return 'ham.png';\\n break;\\n // If a food name is not one of these things, populate it's icon based on category\\n default: \\n if (food.category === 'Vegetables') {\\n return 'salad-1.png';\\n } else if (food.category === 'Fruits') {\\n return 'apple-1.png'\\n } else if (food.category === 'Meat/Seafood') {\\n return 'meat-1.png'\\n } else if (food.category === 'Grains') {\\n return 'grain.png'\\n } else if (food.category === 'Dairy') {\\n return 'milk.png'\\n } else if (food.category === 'Sugars') {\\n return 'cupcake.png'\\n }\\n return 'food.png'\\n }\\n}\",\n \"function fDogs(selected_species) {\\n return selected_species.species == \\\"dog\\\"\\n}\",\n \"function runIntoTheForest(){\\n\\tstory(\\\"You get sketched out from the guy acting strange all of a sudden so you just start running as fast as you can towards the only cover you'll have to get away from him\\\");\\n\\tchoices = [\\\"Trip over a tree root\\\",\\\"Go back\\\",\\\"Call the police\\\"];\\n\\tanswer = setOptions(choices);\\n}\",\n \"function genRandomResult(placesArray){\\n var numResult = Math.floor(Math.random() * (placesArray.length));\\n var restaurantChoice = placesArray[numResult];\\n console.log(\\\"restaurant choice \\\" + restaurantChoice)\\n //alert(restaurantChoice);\\n return restaurantChoice;\\n}//genRandomResult\"\n]"},"negative_scores":{"kind":"list like","value":["0.7036451","0.68487436","0.6445757","0.6161395","0.6132312","0.608472","0.59508175","0.5935433","0.59339875","0.5858789","0.5857141","0.5808869","0.5801549","0.5787674","0.57862955","0.5737572","0.571127","0.5710847","0.5680382","0.56678766","0.5634949","0.562701","0.5609133","0.5589664","0.5576922","0.5574979","0.55523497","0.5551033","0.5524142","0.5521212","0.5510057","0.5503258","0.54934406","0.5484304","0.5476818","0.54746795","0.5457178","0.5444551","0.5444358","0.5435162","0.5415711","0.541545","0.54153484","0.5407661","0.5406086","0.53969073","0.53912973","0.5377946","0.53762895","0.5374873","0.53652143","0.53619915","0.5360041","0.5356098","0.5356077","0.53518325","0.53432316","0.53398263","0.5330626","0.5324696","0.5313833","0.53116083","0.53097504","0.5305349","0.5282668","0.52759814","0.527447","0.5269119","0.52600825","0.5248817","0.5248778","0.52435327","0.5242059","0.5239417","0.52310675","0.5230467","0.52294344","0.5229163","0.5216421","0.5212049","0.5211808","0.52105564","0.52057755","0.5202131","0.5201235","0.5197262","0.5196263","0.51801795","0.5178012","0.51726294","0.51709485","0.51689434","0.5158452","0.5155164","0.51525736","0.5146485","0.5146405","0.51454234","0.51317394","0.51206666","0.511492"],"string":"[\n \"0.7036451\",\n \"0.68487436\",\n \"0.6445757\",\n \"0.6161395\",\n \"0.6132312\",\n \"0.608472\",\n \"0.59508175\",\n \"0.5935433\",\n \"0.59339875\",\n \"0.5858789\",\n \"0.5857141\",\n \"0.5808869\",\n \"0.5801549\",\n \"0.5787674\",\n \"0.57862955\",\n \"0.5737572\",\n \"0.571127\",\n \"0.5710847\",\n \"0.5680382\",\n \"0.56678766\",\n \"0.5634949\",\n \"0.562701\",\n \"0.5609133\",\n \"0.5589664\",\n \"0.5576922\",\n \"0.5574979\",\n \"0.55523497\",\n \"0.5551033\",\n \"0.5524142\",\n \"0.5521212\",\n \"0.5510057\",\n \"0.5503258\",\n \"0.54934406\",\n \"0.5484304\",\n \"0.5476818\",\n \"0.54746795\",\n \"0.5457178\",\n \"0.5444551\",\n \"0.5444358\",\n \"0.5435162\",\n \"0.5415711\",\n \"0.541545\",\n \"0.54153484\",\n \"0.5407661\",\n \"0.5406086\",\n \"0.53969073\",\n \"0.53912973\",\n \"0.5377946\",\n \"0.53762895\",\n \"0.5374873\",\n \"0.53652143\",\n \"0.53619915\",\n \"0.5360041\",\n \"0.5356098\",\n \"0.5356077\",\n \"0.53518325\",\n \"0.53432316\",\n \"0.53398263\",\n \"0.5330626\",\n \"0.5324696\",\n \"0.5313833\",\n \"0.53116083\",\n \"0.53097504\",\n \"0.5305349\",\n \"0.5282668\",\n \"0.52759814\",\n \"0.527447\",\n \"0.5269119\",\n \"0.52600825\",\n \"0.5248817\",\n \"0.5248778\",\n \"0.52435327\",\n \"0.5242059\",\n \"0.5239417\",\n \"0.52310675\",\n \"0.5230467\",\n \"0.52294344\",\n \"0.5229163\",\n \"0.5216421\",\n \"0.5212049\",\n \"0.5211808\",\n \"0.52105564\",\n \"0.52057755\",\n \"0.5202131\",\n \"0.5201235\",\n \"0.5197262\",\n \"0.5196263\",\n \"0.51801795\",\n \"0.5178012\",\n \"0.51726294\",\n \"0.51709485\",\n \"0.51689434\",\n \"0.5158452\",\n \"0.5155164\",\n \"0.51525736\",\n \"0.5146485\",\n \"0.5146405\",\n \"0.51454234\",\n \"0.51317394\",\n \"0.51206666\",\n \"0.511492\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":61,"cells":{"query":{"kind":"string","value":"Continue or regret option for fancy restaurant."},"document":{"kind":"string","value":"function regretFancyRestaurantOption() {\n subTitle.innerText = \"Are you sure?\";\n firstButton.innerText = \"Yes, continue\";\n firstButton.onclick = function() {\n fancyRestauratMenu();\n }\n secondButton.innerText = \"No, go back\";\n secondButton.onclick = function() {\n startFunction();\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 handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function option() {\n\tinquirer\n\t\t.prompt(\n\t\t\t{\n\t\t\t\tname: \"option\",\n\t\t\t\ttype: \"rawlist\",\n\t\t\t\tmessage: \"Would you like to continue to shop?\",\n\t\t\t\tchoices: [\"yes\", \"no\"]\n\t\t\t}\n\t\t)\n\t\t.then(function (answer) {\n\t\t\tif (answer.option === \"yes\") {\n\t\t\t\tdisplayProducts();\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log(\"Thank you for shopping with us at Bamazon, now get the hell out of here!\")\n\t\t\t\tconnection.end()\n\t\t\t}\n\t\t})\n}","function changeRestaurant() {\n if (selectedRestaurant < rRestaurants.length - 1) {\n const next = selectedRestaurant + 1;\n dispatch(setSelectedRestaurant(next));\n } else {\n dispatch(setSelectedRestaurant(0));\n }\n }","function selectRestaurant() {\n let restaurant = document.getElementById(\"dropdown\").firstChild.value;\n let clear;\n if (restaurant === null) {\n return;\n } else if (Object.keys(order.items).length > 0) {\n //Confirm the if the user wants to proceed to clear the order\n clear = confirm(\"Would you like to clear the current order?\");\n if(!clear) {\n document.getElementById(\"dropdown\").firstChild.value = \"\";\n return;\n }\n }\n\n clearOrder(true);\n\n changeRestaurant(restaurant);\n\n}","function restartMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"restartSelection\",\n\t\tmessage: \"Would you like to continue shopping?\"\n\t}]).then(function(restartAnswer){\n\t\tif (restartAnswer.restartSelection === true) {\n\t\t\tcustomerMenu();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Thank you for shopping!\\nYour total is $\" + totalCost); \n\t\t}\n\t});\n}","async promptForFood(step) {\n if (step.result && step.result.value === 'yes') {\n\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\n {\n retryPrompt: 'Sorry, I do not understand or say cancel.'\n }\n );\n } else {\n return await step.next(-1);\n }\n}","generateRestaurant(){\n// we want the user to input the zipcode they want to search, the food type they want to eat\n// and the rating (1-5) \n// getRestaurants()\n\n\n}","function selectRestaurant(){\r\n\tlet select = document.getElementById(\"restaurant-select\");\r\n\tlet name = select.options[select.selectedIndex]\r\n\t//checks for undefined\r\n\tif (name !== undefined){\r\n\t\t//creates custom url that tells server what the currently selected restaurant is\r\n\t\tname= select.options[select.selectedIndex].text;\r\n\t\tname = name.replace(/\\s+/g, '-');\r\n\t\tlet request = new XMLHttpRequest();\r\n\t\r\n\t\trequest.onreadystatechange = function(){\t\r\n\t\t\tif(this.readyState == 4 && this.status == 200){ //if its reggie\r\n\t\t\t\tlet data = JSON.parse(request.responseText);\r\n\t\t\t\t//set menu[0] equal to the data from the server\r\n\t\t\t\tmenu[0] = data;\r\n\t\t\t\tconsole.log(menu);\r\n\t\t\t\tlet result = true;\r\n\t\r\n\t\t\t\t//If order is not empty, confirm the user wants to switch restaurants.\r\n\t\t\t\tif(!isEmpty(order)){\r\n\t\t\t\t\tresult = confirm(\"Are you sure you want to clear your order and switch menus?\");\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t//If switch is confirmed, load the new restaurant data\r\n\t\t\t\tif(result){\r\n\t\t\t\t\t//Get the selected index and set the current restaurant\r\n\t\t\t\t\tlet selected = select.options[select.selectedIndex].value;\r\n\t\t\t\t\tcurrentSelectIndex = select.selectedIndex;\r\n\t\t\t\t\t//In A2, current restaurant will be data you received from the server\r\n\t\t\t\t\tcurrentRestaurant = menu[0];\r\n\t\t\r\n\t\t\t\t\t//Update the page contents to contain the new menu\r\n\t\t\t\t\tif (currentRestaurant !== undefined){\r\n\t\t\t\t\t\tdocument.getElementById(\"left\").innerHTML = getCategoryHTML(currentRestaurant);\r\n\t\t\t\t\t\tdocument.getElementById(\"middle\").innerHTML = getMenuHTML(currentRestaurant);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Clear the current oder and update the order summary\r\n\t\t\t\t\torder = {};\r\n\t\t\t\t\tupdateOrder(currentRestaurant);\r\n\t\t\r\n\t\t\t\t\t//Update the restaurant info on the page\r\n\t\t\t\t\tlet info = document.getElementById(\"info\");\r\n\t\t\t\t\tinfo.innerHTML = currentRestaurant.name + \"
    Minimum Order: $\" + currentRestaurant.min_order + \"
    Delivery Fee: $\" + currentRestaurant.delivery_fee + \"

    \";\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\r\n\t\t\t\t\tlet select = document.getElementById(\"restaurant-select\");\r\n\t\t\t\t\tselect.selectedIndex = currentSelectIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//make request to server with custom url based on the currently selected restaurant\r\n\t\trequest.open(\"GET\",\"http://localhost:3000/menu-data/\"+name,true);\r\n\t\trequest.send();\r\n\t}\r\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function continuePrompt(){\n inquirer\n .prompt({\n name: \"repeat\",\n type: \"list\",\n message: \"Is there anything else you'd like to do?\",\n choices: [\n \"Yes\",\n \"No, I'm done.\"\n ]\n })\n .then(function(answer) {\n switch(answer.repeat){\n case \"Yes\":\n optionMenu();\n break;\n\n case \"No, I'm done.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","async displayFoodChoice(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.food) {\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n } else {\n const user = await this.userProfile.get(step.context, {});\n\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\n\n if (step.context.activity.text == 1) {\n user.food = \"European\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 2) {\n user.food = \"Chinese\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 3) {\n user.food = \"American\";\n await this.userProfile.set(step.context, user);\n }else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\n return await step.beginDialog(WHICH_FOOD);\n }\n\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n }\n return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","setSelectedRestaurant(state, resto) {\n state.selectedRestaurant = resto;\n }","onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }","function startOver() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: \"confirm\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to make another selection?\"\n\t\t}\n\t]).then(function(answer) {\n\t\tif (answer.confirm === true) {\n\t\t\tdisplayOptions();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Goodbye!\");\n\t\t}\n\t});\n}","function mainMenu() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"choice\",\n message: \"Would you like to place another order?\"\n }\n ]).then(function (answer) {//response is boolean only\n if (answer.choice) { //if true, run func\n startBamazon();\n } else {\n console.log(\"Thanks for shopping at Bamazon. See you soon!\")\n connection.end();\n }\n })\n}","function resetProductView(){\n \n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"action\",\n message: \"What would you like to do next?\",\n choices:[\"I want to checkout\", \"I want to continue shopping\"]\n }\n\n ]).then(function(answers){\n if(answers.action === \"I want to checkout\"){\n console.log(\"Good Bye, hope to see you again!\");\n }else if (answers.action === \"I want to continue shopping\"){\n customerview();\n }\n });\n\n}","function doChoice(e) {\n if (this.selectedIndex>0) {\n var c = favlist[this.options[this.selectedIndex].value];\n\t\tvar fail = false;\n if (c) {\n var i;\n setNotice('Loading fav ...');\n for (i=1;i<=c.length;i++) {\n fail |= setState(i,c[i-1]);\n }\n for (;i<=11;i++) {\n clearState(i);\n }\n }\n this.selectedIndex = 0;\n\t\tif (fail)\n\t\t\taddNotice('Item(s) not found!');\n\t\telse\n\t\t\taddNotice('Fav loaded!');\n }\n}","function continueShopping(){\n inquirer.prompt(\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Do you want to continue shopping?\",\n default: true\n }\n ).then(answers=>{\n if(answers.confirm){\n displayProducts();\n }else{\n connection.end();\n }\n });\n}","function regretFastFoodRestaurantOption() {\n subTitle.innerText = \"Are you sure?\";\n firstButton.innerText = \"Yes, continue\";\n firstButton.onclick = function() {\n fastFoodRestaurantScene();\n }\n secondButton.innerText = \"No, go back\";\n secondButton.onclick = function() {\n startFunction();\n }\n}","function regretsPrompt (res) {\n\tinquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"What would you like to do?\",\n\t\t\t\tchoices: [\"Change Quantity\", \"Start Over\"],\n\t\t\t\tname: \"selection\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tif (inqRes.selection == \"Change Quantity\"){\n\t\t\t\tquantityPrompt(res);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplayAllProducts();\t\n\t\t\t}\n\n\n\t\t});//ends then\n}","function continuePrompt(){\n inquirer.prompt({\n type: \"confirm\",\n name: \"continue\",\n message: \"Continue....?\",\n }).then((answer) => {\n if (answer.continue){\n showMainMenu();\n } else{\n exit();\n }\n })\n}","function repeat() {\n inquirer\n .prompt({\n name: \"gotoMainMenu\",\n type: \"list\",\n message: \"Do you want to go back to main menu ?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function (choice) {\n if (choice.gotoMainMenu === \"Yes\") {\n start();\n }\n else {\n connection.end();\n }\n });\n}","function managerChoice() {\n \n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products For Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Quit\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View Products For Sale\":\n MgrDisplayInv();\n break;\n\n case \"View Low Inventory\":\n lowInv();\n break;\n\n case \"Add to Inventory\":\n addInv();\n break;\n\n case \"Add New Product\":\n addItem();\n break;\n\n case \"Quit\":\n disconnect();\n break;\n }\n });\n}","function mainOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View\",\n \"Add\",\n \"Delete\",\n \"Update\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n\n case \"View\":\n viewChoice();\n break;\n\n case \"Add\":\n addChoice();\n break;\n\n case \"Delete\":\n deleteChoice()\n break;\n\n case \"Update\":\n updateChoice()\n break;\n\n\n }\n });\n\n}","function startPrompt() {\n \n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Zohar's Bamazon! Wanna check it out?\",\n default: true\n\n }]).then(function(user){\n if (user.confirm === true){\n inventory();\n } else {\n console.log(\"FINE.. come back soon\")\n }\n });\n }","function goPrompt() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What action would you like to do?\",\n name: \"choice\",\n choices: [\n \"Check Departments\",\n \"Check Roles\",\n \"Check Employees\",\n \"Plus Employee\",\n \"Plus Role\",\n \"Plus Department\"\n ]\n }\n // switch replaces else if...selects parameter and javascript will look for the correct function\n ]).then(function (data) {\n switch (data.choice) {\n case \"Check Departments\":\n viewDepartments()\n break;\n case \"Check Roles\":\n viewRoles()\n break;\n case \"Check Employees\":\n viewEmployees()\n break;\n case \"Plus Employee\":\n plusEmployees()\n break;\n case \"Plus Department\":\n plusDepartment()\n break;\n case \"Plus Role\":\n plusRole()\n break;\n }\n })\n}","function runAgain(){\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function startOver() {\n inquirer\n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to buy another product?\",\n default: true\n })\n .then(function(answer) {\n if (answer.continue) {\n purchaseChoice();\n }\n else {\n connection.end();\n }\n })\n}","async handleMenuResult(step) {\n switch (step.result.value) {\n case \"Donate Food\":\n return step.beginDialog(DONATE_FOOD_DIALOG);\n case \"Find a Food Bank\":\n return step.beginDialog(FIND_FOOD_DIALOG);\n case \"Contact Food Bank\":\n return step.beginDialog(CONTACT_DIALOG);\n }\n return step.next();\n }","function continueShopping() {\n inquire.prompt([{\n message: \"Checkout or Continue Shopping?\",\n type: \"list\",\n name: \"continue\",\n choices: [\"Continue\", \"Go to checkout\"]\n }]).then(function (ans) {\n if (ans.continue === \"Continue\") {\n console.log(\" Items Added to Cart!\");\n shoppingCart();\n } else if (ans.continue === \"Go to checkout\") {\n checkOut(itemCart, cartQuant);\n }\n });\n}","function runAgain2(){\n console.log('That item ID was not found in our records.');\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function restartFunction() {\n inquirer.prompt([\n {\n name:\"action\",\n type:\"list\",\n message: \"Do you want to do another operation?\",\n choices: [\n \"Yes, please.\",\n \"No, I am fine thank you.\"\n ]\n }\n ]).then(function(answer) {\n if(answer.action === \"Yes, please.\") {\n menuOptions();\n } else {\n connection.end();\n }\n })\n}","next() {\n inquirer\n .prompt({\n type: 'list',\n name: 'select',\n message: 'Select a team member or hit \"Done\" to finish:',\n choices: ['Add Manager', 'Add Engineer', 'Add Intern', 'Done'],\n }).then(({select}) => {\n this.parseChoice(select);\n });\n }","chooseLocation() {\n \n }","function restartPrompt(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Would you like to continue shopping?\".question,\n default: true\n }\n ]).then(function(input){\n // If customer wants to continue show products again\n if(input.confirm){\n showProducts();\n }\n else{\n console.log(\"Thank you for shopping with Bamazon!\".magenta);\n connection.end();\n }\n })\n}","function reRun(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"reply\",\n message: \"Would you like to purchase another item?\"\n }\n ]).then(function(answer) {\n if(answer.reply) {\n buy();\n } \n else \n {\n console.log(\"Thanks for shopping Bamazon!\");\n connection.end();\n }\n });\n}","function callNextActionOrExit(answer) {\n if (answer.userSelection === \"View Products for Sale\") {\n console.log(\"You want to view products\");\n viewProducts();\n } else if (answer.userSelection === \"View Low Inventory\") {\n console.log(\"You want to view inventory\")\n viewLowInventory();\n } else if (answer.userSelection === \"Add to Inventory\") {\n console.log(\"You want to add to inventory\")\n addToInventory();\n } else if (answer.userSelection === \"Add New Product\") {\n console.log(\"You want to add a new product\")\n getNewItem();\n } else {\n database.endConnection();\n }\n}","function managerOptions() {\n inquirer.prompt([\n {\n name: \"option\",\n message: \"Hello, random manager. What would you like to do today?\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n ]).then(function (answer) {\n\n //Use a switch case since we have multiple scenarios\n switch (answer.option) {\n\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addNew();\n break;\n };\n });\n}","function ADMIN() {\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\n flights.sort((a, b) => a.id - b.id);\n for (let i = 0; i < flights.length; i++) {\n flights[i].display = true;\n }\n let ediDel;\n do {\n ediDel = prompt(\n \"Te encuentras en la funci\\u00F3n de ADMINISTRADOR. Indica la funci\\u00F3n a la que quieres acceder: EDIT, DELETE.\",\n \"EDIT,DELETE\"\n );\n salida(ediDel, ADMIN);\n ediDel = ediDel.toUpperCase();\n } while (ediDel !== \"EDIT\" && ediDel !== \"DELETE\");\n\n //JUMP TO NEXT FUNCITON\n if (ediDel === \"EDIT\") {\n EDIT();\n } else if (ediDel === \"DELETE\") {\n DELETE();\n } else {\n alert(\"No te he entendido\");\n ADMIN();\n }\n}","function again() {\n inquirer.prompt({\n name: \"shop\",\n type: \"list\",\n message: \"Would you like to keep shopping?\",\n choices: [\"Yes\", \"No\"]\n }).then(function(answer){\n if(answer.shop == \"Yes\"){\n list();\n } else {\n console.log(\"Please come back soon!\");\n connection.end();\n }\n })\n}","function endRepeat() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"wish\",\n message: \"\\nDo you want to perform another operation?\",\n choices: [\"Yes\", \"No\"]\n }]).then( answer => {\n if (answer.wish === \"Yes\") {\n showMenu();\n } else {\n connection.end();\n }\n })\n}","function determineNextAction(option) {\n switch(option.toString()) {\n case \"Add Engineer\": \n currentEmployeeType = Engineer.getRole();\n askQuestions(ENGINEER_QUESTIONS);\n break;\n case 'Add Intern':\n currentEmployeeType = Intern.getRole();\n askQuestions(INTERN_QUESTIONS)\n break;\n case 'Exit':\n console.log(\"generate html\");\n GenerateHTML.generateSkeletonHTML(teamArray);\n console.log(\"exiting....\");\n break;\n }\n}","function shopAgain(){\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"shop\",\n message: \"Would you like to buy another item?\",\n choices: [\"YES\", \"NO\"]\n }\n ]).then(function(answer) {\n if (answer.shop === \"YES\") {\n runBamazon();\n } else {\n console.log(\"Thank you for shopping with us, have a nice day!\");\n connection.end();\n }\n })\n}","function initSelectRestaurant(restaurants, searchTerm){\n $(function(){\n\n var getRestaurant = window.LE.restaurants.getRestaurant\n\n userdata.restaurant = null;\n\n //dummy var\n var isSearch = null;\n\n // prepare template\n var source = $(\"#restaurant-dropdown-template\").html();\n var template = Handlebars.compile(source);\n\n html = template(restaurants); \n\n // populate dropdown for restaurants\n var renderingRestaurants = $('#render-restaurants').after(html);\n\n // render confirmation of the search term so the user remembers what they were looking for\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\n\n // when the restaurant changes, we need to display rate and other data\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\n });\n \n $(\"#select-restaurant-continue-button\").on(\"click\", function(){\n // this is the restaurant id to render later\n var selectedVal = $(\"#restaurant\").val();\n\n if(_debug){ console.log(selectedVal); }\n\n if(selectedVal == \"\"){\n document.getElementById(\"restaurant-alert\").innerHTML = \"Required.\";\n }else{\n\n // cleanup old event handlers before leaving home context\n destroyHome();\n\n userdata.currentRestaurant = selectedVal;\n initSelectItem(selectedVal);\n // ease scroll to top of next view\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n });\n });\n}","function displayRestaurant() {\n restaurantDrop.on(\"click\", function (event) {\n if ($(event.target).attr(\"class\") === \"yes\") {\n console.log(\"hi\");\n $(\".body-container\").prepend($(\".location\").show());\n restaurantOption.hide();\n }\n if ($(event.target).attr(\"class\") === \"no\") {\n $(\".final-date\").removeClass(\"hide\");\n restaurantOption.hide();\n viewDate.append($(\".movie-display\"));\n $(\".movie-display\").show();\n restaurantStorage.push(\"\")\n localStorage.setItem(\"Restaurants\", JSON.stringify(restaurantStorage))\n }\n });\n}","function superAsk(){\n\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"rawlist\",\n message: \"Greetings, what action would you like to perform today? (select by picking a #)\",\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\n name: \"action\", \n },\n\n ])\n .then(function(response) {\n\n switch (response.action) {\n case 'View Product Sales by Department':\n viewProdSales();\n break;\n case 'Create New Department':\n createDept();\n break;\n case 'Exit':\n process.exit();\n break;\n default:\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\n }\n });\n}","function restartMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"restartSelection\",\n\t\tmessage: \"Would you like to return to the main menu?\"\n\t}]).then(function(restartAnswer){\n\t\tif (restartAnswer.restartSelection === true) {\n\t\t\tmanagerMenu();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Good bye!\"); \n\t\t}\n\t});\n}","function menu_paquet(){\n\t\taction=prompt(\"F fin de tour | P piocher une carte\");\n\t\taction=action.toUpperCase();\n\t\tif (action != null){\n\t\t\tswitch(action){\n\t\t\t\tcase \"F\":\n\t\t\t\t\tif (att_me.length>0){\n\t\t\t\t\t\t//MAJ des cartes en INV_ATT1,2\n\t\t\t\t\t\tmajCartesEnAttaque();\n\t\t\t\t\t}\n\t\t\t\t\tif (pv_adv==0 || pv_me==0){\n\t\t\t\t\t\tif (pv_adv==0){\n\t\t\t\t\t\t\talert(\"Vous avez gagné !!!\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert(\"Vous avez perdu !!!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/////////////////////////////////Gérer la fin de partie ICI\n\t\t\t\t\t} else {\n\t\t\t\t\t\tIA_jouer(IA_stategie_basic);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"P\":\n\t\t\t\t\tjeu_piocherDsPaquet(true);\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}","function start() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All departments\",\n \"View All employees\",\n \"View All roles\",\n \"Add roles\",\n \"Add departments\",\n \"Add employees\",\n \"Delete roles\",\n \"Delete departments\",\n \"Exit\"\n ]\n })\n .then(function(res) { \n switch (res.action) {\n case \"View departments\":\n viewDep();\n break;\n \n case \"View All employees\":\n viewEmp();\n break;\n \n case \"View All roles\":\n viewRole();\n break;\n \n case \"Add roles\":\n addRole();\n break;\n \n case \"Add departments\":\n addDep();\n break;\n\n case \"Add employees\":\n addEmp();\n break;\n\n case \"Update employee roles\":\n updateEmpRole();\n break;\n \n case \"Delete roles\":\n deleteRole();\n break;\n \n case \"Delete departments\":\n deleteDep();\n break;\n \n case \"Exit\":\n end();\n break\n }\n });\n }","function handleNewMealRequest(response) {\n // Get a random meal from the random meals list\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\n var meal = RANDOM_MEALS[mealIndex];\n\n // Create speech output\n var speechOutput = \"Here's a suggestion: \" + meal;\n\n response.tellWithCard(speechOutput, \"MealRecommendations\", speechOutput);\n}","function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\n if(userInput === \"1\"){\n \n randomDestination = yesOrNo(destination,destination);\n \n }\n else if (userInput === \"2\") {\n \n randomRestaurant = yesOrNo(restaurant,restaurant);\n }\n else if (userInput === \"3\") {\n \n randomTravelType = yesOrNo(transportation, transportation);\n }\n else if (userInput === \"4\") {\n \n randomEntertainment = yesOrNo(entertainment,entertainment);\n }\n}","function start() {\n inquirer.prompt({\n name: \"select\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\"VIEW SALES\", \"CREATE NEW DEPARTMENT\", \"DELETE DEPARTMENT\", \"EXIT\"]\n }).then(function (answers) {\n if (answers.select.toUpperCase() === \"VIEW SALES\") {\n viewSales();\n } else if (answers.select.toUpperCase() === \"CREATE NEW DEPARTMENT\") {\n newDepartment();\n } else if (answers.select.toUpperCase() === \"DELETE DEPARTMENT\") {\n deleteDepartment();\n } else {\n // Selecting \"EXIT\" just takes the user here\n connection.end();\n }\n });\n}","function nextAction() {\n\tinquirer.prompt({\n\t\tmessage: \"What would you like to do next?\",\n\t\ttype: \"list\",\n\t\tname: \"nextAction\",\n\t\tchoices: [\"Add More Items\", \"Remove Items\", \"Alter Item Order Amount\", \"Survey Cart\", \"Checkout\"]\n\t})\n\t\t.then(function (actionAnswer) {\n\t\t\tswitch (actionAnswer.nextAction) {\n\t\t\t\tcase \"Add More Items\":\n\t\t\t\t\t// go to the start function\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Remove Items\":\n\t\t\t\t\t// go to the removal function\n\t\t\t\t\tremoveItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Checkout\":\n\t\t\t\t\t// go to the checkout tree;\n\t\t\t\t\tverifyCheckout();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Alter Item Order Amount\":\n\t\t\t\t\t// go to the function that alters the shopping cart qty\n\t\t\t\t\talterItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Survey Cart\":\n\t\t\t\t\t// look at the cart\n\t\t\t\t\tcheckoutFunction();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: console.log(\"how did you get here?\")\n\t\t\t}\n\t\t})\n}","function anotherAction() {\n\n inquirer\n .prompt([\n {\n name: \"confirm\",\n type: \"confirm\",\n message: \"Would you like to complete another action?\"\n }\n ])\n .then(function (answer) {\n if (answer.confirm == true) {\n showMenu();\n }\n else {\n console.log(\"Goodbye.\");\n connection.end();\n }\n\n });\n\n}","onSelectRestaurant(restaurant){\n \n this.infoWindow.setContent(` ${restaurant.name} ${restaurant.address} `)\n this.infoWindow.open(this.map,this.markers.find(m=>m.restaurant.address === restaurant.address));\n }","function askForMenuOption() {\n\tlet selection = PROMPT.question(\" >> \");\n\tswitch (selection) {\n\t\tcase \"new\":\n\t\t\taddNewMovie();\n\t\t\taddMovieRating(movies.length - 1);\n\t\t\tbreak;\n\t\tcase \"sort\":\n\t\t\tsetSortOrder();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (selection == \"\" || (!MOVIE_ID_REGEX.test(selection) || selection > movies.length)) {\n\t\t\t\tconsole.log(\"--- Movie ID invalid - Try again ---\");\n\t\t\t\taskForMenuOption();\n\t\t\t}\n\t\t\taddMovieRating(Number(selection) - 1);\n\t\t\tbreak;\n\n\t}\n}","function _wantToGoFunction() {\n if (vm.dataCheck) {\n\n for (var i = 0; i < vm.dataCheck.length; i++) {\n\n if (vm.dataCheck[i].favoriteType == 2) {\n\n vm.$alertService.warning('Already in your \"Want To Go\" list!');\n }\n }\n\n } else {\n\n vm.favoriteTypeData = {\n favoriteType: 2,\n placeId: vm.place.id\n }\n\n vm.$userFavoritePlacesService.apiPostUserFavoritePlaces(vm.favoriteTypeData, vm.onFavoriteSuccess, vm.onFavoriteError);\n }\n }","function continueorquit(data) {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"CorQ\",\n message: \"Would you like to Add Another employee\",\n choices: ['Yes', 'No']\n },\n ])\n .then(quitData => {\n switch (quitData.CorQ) {\n case 'Yes': getEmployee()\n break\n case 'No': createWebsite()\n break\n }\n })\n\n\n}","function another() {\n inquirer\n .prompt(\n {\n name: 'another',\n type: 'confirm',\n message: 'Would you like to continue shopping?'\n },\n\n )\n .then(function (answer) {\n if (answer.another === true) {\n start();\n } else {\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\n connection.end();\n }\n });\n\n}","function promptAction() {\n inquirer.prompt([{\n type: 'list',\n message: 'Select from list below what action you would like to complete.',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\n name: \"action\"\n }, ]).then(function(selection) {\n switch (selection.action) {\n case 'View Products for Sale':\n viewAllProducts();\n break;\n\n case 'View Low Inventory':\n lowInventoryList();\n break;\n\n case 'Add to Inventory':\n addInventory();\n break;\n\n case 'Add New Product':\n addNewProduct();\n break;\n }\n }).catch(function(error) {\n throw error;\n });\n}","function systemSelection(option){\n\tvar check = option; \n\tif(vehicleFuel<=0){\n\t\tgameOverLose();\n\t}\n\n\telse{\n\n\n\tif(currentLocation===check){\n\t\t\tgamePrompt(\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\",beginTravel);\n\t\t\t}\n\n\telse{\n\t\n\t\t\tif(check.toLowerCase() === \"e\"){\n\t\t\t\tvehicleFuel=(vehicleFuel-10);\n\t\t\t\tcurrentLocation=\"e\" ;\n\t\t\t\tgamePrompt(\"Flying to Earth...You used 10 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToEarth);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"m\"){\n\t\t\t//need to add a 'visited' conditional\n\t\t\tvehicleFuel=(vehicleFuel-20);\n\t\t\tcurrentLocation=\"m\" ;\n\t\t\t\tgamePrompt(\"Flying to Mesnides...You used 20 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\", goToMesnides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"l\"){\n\t\t\tvehicleFuel=(vehicleFuel-50);\n\t\t\tcurrentLocation=\"l\" ;\n\t\t\tgamePrompt(\"Flying to Laplides...You used 50 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToLaplides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"k\"){\n\t\t\tvehicleFuel=(vehicleFuel-120);\n\t\t\tcurrentLocation=\"k\" ;\n\t\t\tgamePrompt(\"Flying to Kiyturn...You used 120 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToKiyturn);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"a\"){\n\t\t\tvehicleFuel=(vehicleFuel-25);\n\t\t\tcurrentLocation=\"a\";\n\t\t\tgamePrompt(\"Flying to Aenides...You used 25 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToAenides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"c\"){\n\t\t\tvehicleFuel=(vehicleFuel-200);\n\t\t\tcurrentLocation=\"c\" ;\n\t\t\tgamePrompt(\"Flying to Cramuthea...You used 200 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToCramuthea);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"s\"){\n\t\t\tvehicleFuel=(vehicleFuel-400);\n\t\t\tcurrentLocation=\"s\" ;\n\t\t\tgamePrompt(\"Flying to Smeon T9Q...You used 400 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToSmeon);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"g\"){\n\t\t\tvehicleFuel=(vehicleFuel-85);\n\t\t\tcurrentLocation=\"g\" ;\n\t\t\tgamePrompt(\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToGleshan);\n\t\t\t}\n\t\telse{\n\t\t\tgamePrompt(\"Sorry Captain, I did not understand you. I will return you to the main menu\",beginTravel);\n\t\t}\n\t}\n\t}\n}","function askAgain(){\n\tconsole.log(\"=============================================================\");\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: \"confirm\",\n\t\t\tname: \"confirm\",\n\t\t\tmessage: \"Would you like to do another task?\",\n\t\t\tdefault: false\n\t\t}\n\t]).then(function(again){\n\t\tif (again.confirm){\n\t\t\tsupervisorOptions();\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"All tasks are done.\");\n\t\t\t// Exits node program execution\n\t\t\tprocess.exit();\n\t\t}\n\t});\n}","prompt() {\n // Fetch appointment types from Acuity\n acuity.request('/appointment-types', function (err, res, appointmentTypes) {\n\n // Build some buttons for folks to choose a class\n const replies = appointmentTypes\n // Filter types for public classes\n .filter(appointmentType => appointmentType.type === 'class' && !appointmentType.private)\n // Create a button for each type\n .map(appointmentType => client.makeReplyButton(\n appointmentType.name,\n null,\n 'bookClass',\n {appointmentTypeID: appointmentType.id}\n ));\n\n // Set the response intent to prompt to choose a type\n client.addResponseWithReplies('prompt/type', null, replies);\n\n // End the asynchronous prompt\n client.done();\n });\n }","function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}","function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function","function anythingElse() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Anything Else?\",\n name: \"choice\"\n }\n ])\n .then(res => {\n if (res.choice) {\n displayProducts();\n } else {\n console.log(\"Thank You!\");\n console.log(`Total: $${total}`);\n connection.end();\n }\n });\n}","function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}","function promptOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Would you like to ... ?\",\n choices: [\"Continue Shopping\", \"Update Cart\", \"Checkout\"],\n name: \"choice\"\n }\n ]).then(function (option) {\n switch (option.choice) {\n case \"Continue Shopping\":\n promptBuy();\n break;\n case \"Update Cart\":\n updateCart();\n break;\n case \"Checkout\":\n checkout();\n break;\n }\n });\n}","function endStart(){\n inquirer.prompt({\n name: \"confirm\",\n type: \"confirm\",\n message: \"continue shopping?\",\n // default: true\n }).then(function (data) {\n if (data.confirm === false)\n \n process.exit();\n else \n start();\n });\n}","function managerOptions() {\n inquirer.prompt([\n {\n type: \"checkbox\",\n name: \"managerTask\",\n message: \"Hi manager. What would you like to do?\",\n choices: [\"View products for sale\", \"View low inventory\", \"Add to inventory\", \"Add New Product\"]\n }\n ]).then(function (manager) {\n var task = manager.managerTask;\n if (task == \"View products for sale\") {\n viewProducts();\n }\n else if (task == \"View low inventory\") {\n lowinventory();\n }\n else if (task == \"Add to inventory\") {\n addToInvetory();\n }\n else if (task == \"Add New Product\") {\n addProduct();\n }\n });\n}","function returnToMenu() {\n\tinquirer.prompt({\n\t\tname: \"choice\",\n\t\ttype: \"confirm\",\n\t\tmessage: \"Would you like to return to the menu?\"\n\n\t}).then(function(input) {\n\t\tif (input.choice === true) {\n\t\t\tmenu();\n\t\t} else {\n\t\t\tconnection.end();\n\t\t}\n\t})\n}","function menuoption(){\n inquirer.prompt({\n type: \"list\",\n name : \"menu\",\n message : \"What do you want to see ?\",\n choices : [\"\\n\",\"View Products for Sale\",\"View Low Inventory\",\"Add to Inventory\",\"Add New Product\"]\n\n }).then(function(answer){\n // var update;\n // var addnew;\n console.log(answer.menu);\n //if else option to compare user input and call the required function\n if(answer.menu == \"View Products for Sale\" ){\n showitem();\n }else if(answer.menu == \"View Low Inventory\"){\n \n lowinventory();\n }else if(answer.menu == \"Add to Inventory\"){\n updateinventory();\n // updateonecolumn(itemidinput);\n }else if(answer.menu == \"Add New Product\"){\n addnewproduct();\n }\n \n });\n }","function shop() {\n\n inquirer.prompt([{\n name: \"menu\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Update Inventory\", \"Add New Product\"]\n }]).then(function (answer) {\n\n switch (answer.menu) {\n case \"View Products for Sale\":\n forSale();\n break;\n\n case \"View Low Inventory\":\n lowStock();\n break;\n\n case \"Add New Product\":\n addThing();\n break;\n\n case \"Update Inventory\":\n moreStuff();\n break;\n }\n });\n}","buildGoOption(term) {\n let isValidPatp = urbitOb.isValidPatp(term.substr(1));\n let isStation = isValidStation(term);\n let details = isStation && getStationDetails(term);\n // use collection description if it's a collection\n let displayTextTerm = isStation ? details.type == 'text' ? `${details.station.split(\"/\")[0]} / ${details.stationTitle}` : details.station.split(\"/\").join(\" / \") : term;\n\n let displayText = `go ${displayTextTerm}`;\n let helpText = isStation ?\n `Go to ${details.cir} on ~${details.host}` :\n `Go to the profile of ${term}`\n\n return {\n name: `go ${term}`,\n action: () => {\n let targetUrl;\n if (isValidPatp) {\n targetUrl = profileUrl(term.substr(1))\n this.props.transitionTo(targetUrl);\n } else if (isStation) {\n targetUrl = (details.type === \"text-topic\") ? details.postUrl : details.stationUrl\n this.props.transitionTo(targetUrl);\n }\n },\n displayText,\n helpText\n };\n }","function handle_again() {\n var current = current_selection();\n // call the initiator function on the current selection\n window.initiate_fcn(current, $(featherlight_selector()).get(0));\n}","function menu() {\n var option = parseInt(prompt('Choississez une option :'));\n\n do {\n if (option == 1) {\n list(), navigation();\n var option = parseInt(prompt('Choississez une option :'));\n } else if (option == 2) {\n addContact();\n var option = parseInt(prompt('Choississez une option :'));\n }\n } while (option != 3)\n alert(\"Aurevoir et à bientot !\");\n}","function askToContinue() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tmessage: 'Do you want to play again?',\n\t\t\t\t\tname: 'confirm',\n\t\t\t\t\tdefault: true\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\tif (response.confirm === true) {\n\t\t\t\t\tstartGame();\n\t\t\t\t} \n\t\t\t});\n\t}","function cardMakeContinue() { // function that asks to continue making cards//\n\tinquirer.prompt({\n\t\t\ttype: \"list\",\n\t\t\tmessage:\"\\nContinue? Yes or No \",\n\t\t\tchoices: [\"Yes\", \"No\"],\n\t\t\tname: \"ynChoices\"\n\t\t\t}).then(function(continuebasicYN){\n\t\t\tvar ynChoices = continuebasicYN.ynChoices;\n \t\n\t\t\tif (ynChoices === \"Yes\") \n\t\t\t\t{\n\t\t\t\tgetInfo(loop); // calls function to enter another card\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{ console.log(\"Good Job, you are finished!\");\n\t\t\t\t}\n\t\t\t}) // close cardMakecontinue prompts\n\n\t\t}","function frostingChoice(item) {\n frostingChosen = true;\n if (typeof preFrostingChoice !== 'undefined'){\n preFrostingChoice.style.backgroundColor = \"white\";\n }\n\n item.style.backgroundColor = \"lightgray\";\n preFrostingChoice = item;\n\n checkPrice();\n}","function keepShopping(){\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"do you want to keep shopping for beers?\",\n name: \"confirm\"\n }\n ]).then(function(res){\n if (res.confirm){\n console.log(\"----------------\");\n showProducts();\n } else {\n console.log('Thank you for shopping in our online bar, happy drinking!');\n connection.end();\n }\n })\n}","function promptContinue(){\n return inquirer.prompt([\n {\n type: \"list\",\n name: \"Job\", \n choices: [\"Engineer\", \"Intern\", \"Finish building my team\"]\n },\n])\n.then((answers) => {\n if(answers.Job === \"Engineer\"){\n promptEngineer();\n } else if (answers.Job === \"Intern\"){\n promptIntern();\n } else {\n generate.generateHTML(employeeArray);\n console.log(\"Your team is being built!\")\n }\n})\n}","async promptForMenu(step) {\n return step.prompt(MENU_PROMPT, {\n choices: [\"Donate Food\", \"Find a Food Bank\", \"Contact Food Bank\"],\n prompt: \"Do you have food to donate, do you need food, or are you contacting a food bank?\",\n retryPrompt: \"I'm sorry, that wasn't a valid response. Please select one of the options\"\n });\n }","function askUser() {\n inquirer.prompt(\n {\n name: \"action\",\n message: \"WHAT WOULD YOU LIKE TO DO?\",\n type: \"list\",\n choices: [\"BROWSE ITEMS\", \"EXIT\"]\n }\n ).then(function (answer) {\n switch (answer.action) {\n case \"BROWSE ITEMS\":\n showItems();\n break;\n\n case \"EXIT\":\n connection.end();\n break;\n }\n });\n}","function checkIfVacationNeedsReplacement(bool){\n let ask;\n let empty = \"\";\n if (bool === true){\n alert(\"Enjoy your Vacation!\");\n loopBreak = true;\n return empty;\n }\n else{\n ask = prompt(\"What part of your vacation would you like to replace? Type destination, food, transportation, entertainment, all, or done.\");\n return ask;\n }\n}","function goToAenides(){\n\t\tif(visitedAen===0){\n\t\t\tvisitedAen=1;\n\t\t\t// artifacts=1;\n\t\t\tgamePrompt(\"You discover upon arrival to Aenides that they are a hostile people. You attempt to land, but they begin to fire upon your S.R.S.V. and you are forced to retreat.\",beginTravel);\n\t\t}else{\n\t\t\tgamePrompt([\"You've already been here!\",\"Where to next?\"],beginTravel);\n\t\t}\n}","function foodRunnerSelector() {\n \n if (document.getElementById(\"foodRunnerYes\").checked == true) {\n\tdoTipFoodRunner = true;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"Food Runner will be tipped out\";}\n else { \n\tdoTipFoodRunner = false;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"No tip out for Food Runner\"; \n }\n return doTipFoodRunner\n}","function optionMenu(){\n inquirer\n .prompt({\n name: \"menu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Nothing, I've changed my mind.\"\n ]\n })\n .then(function(answer) {\n switch(answer.menu){\n case \"View Products for Sale\":\n showProducts();\n\n // continuePrompt is delayed to allow showProducts to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n\n // continuePrompt is delayed to allow lowInventory to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"Add to Inventory\":\n showProducts()\n\n // addInventory is delayed to allow lowInventory to be completed\n setTimeout(addInventory,300);\n break;\n\n case \"Add New Product\":\n newProduct();\n break;\n\n case \"Nothing, I've changed my mind.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","function confirmGoalsAndContinue() {\n if ($('.js-goal-rank').length > 1) {\n reorderItems('#goal-rank-num li', '#sortable-goals');\n }\n //Make sure the number labels are in the proper order, the user might navigate back to goal ranking using the back button\n utility.getInitialOrder('#goal-rank-num li');\n SALT.trigger('goalrank:updated');\n $('#js-rank-container').removeClass('active-panel');\n $('.js-onboarding-exit, .outer-progress-meter-wrapper').show();\n //Show the first Q+A panel now that goal rank is hidden\n $('.js-profileQA-container').children().first().addClass('active-panel');\n focusFirstInput();\n //Scroll to the top of the screen in case so that the user is always seeing the top of the new panel\n $('html, body').animate({scrollTop: 0}, 300);\n initializeProgressMeter();\n }","function noInventoryOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Do you want to choose a new item or quit?\",\n choices: [\"NEW-ITEM\", \"QUIT\"],\n name: \"startAgain\"\n }\n ])\n .then(function(answer6) {\n if (answer6.startAgain == \"NEW-ITEM\") {\n displayProducts(); \n }\n if (answer6.startAgain == \"QUIT\") {\n console.log(\"Thank you. Good-bye!\");\n connection.end();\n }\n });\n}","function onAfterLocationUpdate() {\n $.fancybox.showLoading(getLabel('ajax.finding-restaurants'));\n location.href = ctx + '/app/' + getLabel('url.find-takeaway') + '/session/loc';\n}","function returntoMenu() {\n inquirer.prompt({\n name: 'return',\n type: 'rawlist',\n choices: [\"Return to Main Menu\", \"Exit\"],\n message: \"Would you like to return to main menu or exit?\"\n }).then(function(answer){\n if (answer.return === \"Return to Main Menu\") {\n start();\n }\n else {\n connection.end();\n }\n })\n}","function askAgain() {\n\n inquirer\n .prompt({\n name: \"nextSteps\",\n type: \"list\",\n message: \"Would you like to continue shopping?\",\n choices: [\"YES\", \"NO\"]\n })\n .then(function(answer) {\n \n if (answer.nextSteps.toUpperCase() === \"NO\") {\n\n console.log(chalk.yellow(\"\\nHope you had a pleasant experience. Come again soon!\\n\"));\n\n //turns off the connection from db\n connection.end();\n }\n\n else {\n\n \t//the first function is called again\n \treadProducts();\n\n\n } \n\n });\n}","function options() {\n inquirer\n .prompt({\n name: \"departmentOfManagers\",\n type: \"list\",\n message: \"Which saleDepartment you are looking for ?\",\n choices: [\"Products of sale\", \"Low Inventory\", \"Add to Inventory\", \" Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer of functions\n if (answer.options === \"Products of sale\") {\n viewSaleProduct();\n }\n else if(answer.options === \"Low Inventory\") {\n lowInventory();\n }\n else if(answer.options === \"Add to Inventory\") {\n addInventory();\n } \n else if(answer.options === \"Add New Product\") \n {\n addNewProduct();\n } else{\n connection.end();\n }\n });\n}","function chooseFoodQuiz() {\n $(foodQuiz).click();\n questions = foodQuestions;\n finalQuestion = foodQuestions.length - 1;\n startQuiz();\n}","function nextPrompt(){\n inquirer.prompt([\n {\n name: \"status\",\n type: \"list\",\n message: \"Buy more?\",\n choices: [\"Buy more\", \"Exit\"]\n }\n ]).then(answer => {\n if(answer.status === \"Buy more\"){\n displayInventory();\n promptBuy();\n } else{\n console.log(\"Thank you. Goodbye.\");\n connection.end();\n }\n })\n}","function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}","function mainMenu(){\n inquirer.prompt([\n {\n name: \"mainOptions\",\n type: \"list\",\n message:\"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory Products\", \"Add Product Inventory\", \"Add New Product\", \"Exit\"]\n }\n ]).then(function(answer){\n switch (answer.mainOptions) {\n case \"View Products\":\n displayInventory();\n break;\n case \"View Low Inventory Products\":\n displayLowInv();\n break;\n case \"Add Product Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n addProduct();\n break;\n case \"Exit\":\n console.log(\"***********************************************************\");\n console.log(\"* Have a productive day :-) *\");\n console.log(\"***********************************************************\");\n connection.end();\n };\n });\n}","function managerPrompt() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"Hello Bamazon manager, what would you like to do today?\",\n choices: [\n \"View Products for sale?\",\n \"View Low Inventory?\",\n \"Add to Inventory?\",\n \"Add a New Product?\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View Products for sale?\":\n viewAllProducts();\n break;\n\n case \"View Low Inventory?\":\n viewLowInventory();\n break;\n\n case \"Add to Inventory?\":\n addInventory();\n break;\n\n case \"Add a New Product?\":\n addNewProduct();\n break;\n }\n\n });\n\n}","function userSearch() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do:\",\n choices: [\"View product sales by Department\", \"Create new department\", \"Exit Supervisor Mode\"]\n }\n\n ]).then(function (manager) {\n\n switch (manager.choice) {\n case \"View product sales by Department\":\n viewDepartments();\n break;\n \n case \"Create new department\":\n addNewDepartment();\n break;\n\n case \"Exit Supervisor Mode\":\n console.log(\"\\nSee ya later!\\n\");\n connection.end ();\n break;\n }\n\n });\n\n}"],"string":"[\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function option() {\\n\\tinquirer\\n\\t\\t.prompt(\\n\\t\\t\\t{\\n\\t\\t\\t\\tname: \\\"option\\\",\\n\\t\\t\\t\\ttype: \\\"rawlist\\\",\\n\\t\\t\\t\\tmessage: \\\"Would you like to continue to shop?\\\",\\n\\t\\t\\t\\tchoices: [\\\"yes\\\", \\\"no\\\"]\\n\\t\\t\\t}\\n\\t\\t)\\n\\t\\t.then(function (answer) {\\n\\t\\t\\tif (answer.option === \\\"yes\\\") {\\n\\t\\t\\t\\tdisplayProducts();\\n\\t\\t\\t}\\n\\n\\t\\t\\telse {\\n\\t\\t\\t\\tconsole.log(\\\"Thank you for shopping with us at Bamazon, now get the hell out of here!\\\")\\n\\t\\t\\t\\tconnection.end()\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function changeRestaurant() {\\n if (selectedRestaurant < rRestaurants.length - 1) {\\n const next = selectedRestaurant + 1;\\n dispatch(setSelectedRestaurant(next));\\n } else {\\n dispatch(setSelectedRestaurant(0));\\n }\\n }\",\n \"function selectRestaurant() {\\n let restaurant = document.getElementById(\\\"dropdown\\\").firstChild.value;\\n let clear;\\n if (restaurant === null) {\\n return;\\n } else if (Object.keys(order.items).length > 0) {\\n //Confirm the if the user wants to proceed to clear the order\\n clear = confirm(\\\"Would you like to clear the current order?\\\");\\n if(!clear) {\\n document.getElementById(\\\"dropdown\\\").firstChild.value = \\\"\\\";\\n return;\\n }\\n }\\n\\n clearOrder(true);\\n\\n changeRestaurant(restaurant);\\n\\n}\",\n \"function restartMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tname: \\\"restartSelection\\\",\\n\\t\\tmessage: \\\"Would you like to continue shopping?\\\"\\n\\t}]).then(function(restartAnswer){\\n\\t\\tif (restartAnswer.restartSelection === true) {\\n\\t\\t\\tcustomerMenu();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Thank you for shopping!\\\\nYour total is $\\\" + totalCost); \\n\\t\\t}\\n\\t});\\n}\",\n \"async promptForFood(step) {\\n if (step.result && step.result.value === 'yes') {\\n\\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\\n {\\n retryPrompt: 'Sorry, I do not understand or say cancel.'\\n }\\n );\\n } else {\\n return await step.next(-1);\\n }\\n}\",\n \"generateRestaurant(){\\n// we want the user to input the zipcode they want to search, the food type they want to eat\\n// and the rating (1-5) \\n// getRestaurants()\\n\\n\\n}\",\n \"function selectRestaurant(){\\r\\n\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\tlet name = select.options[select.selectedIndex]\\r\\n\\t//checks for undefined\\r\\n\\tif (name !== undefined){\\r\\n\\t\\t//creates custom url that tells server what the currently selected restaurant is\\r\\n\\t\\tname= select.options[select.selectedIndex].text;\\r\\n\\t\\tname = name.replace(/\\\\s+/g, '-');\\r\\n\\t\\tlet request = new XMLHttpRequest();\\r\\n\\t\\r\\n\\t\\trequest.onreadystatechange = function(){\\t\\r\\n\\t\\t\\tif(this.readyState == 4 && this.status == 200){ //if its reggie\\r\\n\\t\\t\\t\\tlet data = JSON.parse(request.responseText);\\r\\n\\t\\t\\t\\t//set menu[0] equal to the data from the server\\r\\n\\t\\t\\t\\tmenu[0] = data;\\r\\n\\t\\t\\t\\tconsole.log(menu);\\r\\n\\t\\t\\t\\tlet result = true;\\r\\n\\t\\r\\n\\t\\t\\t\\t//If order is not empty, confirm the user wants to switch restaurants.\\r\\n\\t\\t\\t\\tif(!isEmpty(order)){\\r\\n\\t\\t\\t\\t\\tresult = confirm(\\\"Are you sure you want to clear your order and switch menus?\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\r\\n\\t\\t\\t\\t//If switch is confirmed, load the new restaurant data\\r\\n\\t\\t\\t\\tif(result){\\r\\n\\t\\t\\t\\t\\t//Get the selected index and set the current restaurant\\r\\n\\t\\t\\t\\t\\tlet selected = select.options[select.selectedIndex].value;\\r\\n\\t\\t\\t\\t\\tcurrentSelectIndex = select.selectedIndex;\\r\\n\\t\\t\\t\\t\\t//In A2, current restaurant will be data you received from the server\\r\\n\\t\\t\\t\\t\\tcurrentRestaurant = menu[0];\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the page contents to contain the new menu\\r\\n\\t\\t\\t\\t\\tif (currentRestaurant !== undefined){\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"left\\\").innerHTML = getCategoryHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"middle\\\").innerHTML = getMenuHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t//Clear the current oder and update the order summary\\r\\n\\t\\t\\t\\t\\torder = {};\\r\\n\\t\\t\\t\\t\\tupdateOrder(currentRestaurant);\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the restaurant info on the page\\r\\n\\t\\t\\t\\t\\tlet info = document.getElementById(\\\"info\\\");\\r\\n\\t\\t\\t\\t\\tinfo.innerHTML = currentRestaurant.name + \\\"
    Minimum Order: $\\\" + currentRestaurant.min_order + \\\"
    Delivery Fee: $\\\" + currentRestaurant.delivery_fee + \\\"

    \\\";\\r\\n\\t\\t\\t\\t}else{\\r\\n\\t\\t\\t\\t\\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\\r\\n\\t\\t\\t\\t\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\t\\t\\t\\t\\tselect.selectedIndex = currentSelectIndex;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t//make request to server with custom url based on the currently selected restaurant\\r\\n\\t\\trequest.open(\\\"GET\\\",\\\"http://localhost:3000/menu-data/\\\"+name,true);\\r\\n\\t\\trequest.send();\\r\\n\\t}\\r\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function continuePrompt(){\\n inquirer\\n .prompt({\\n name: \\\"repeat\\\",\\n type: \\\"list\\\",\\n message: \\\"Is there anything else you'd like to do?\\\",\\n choices: [\\n \\\"Yes\\\",\\n \\\"No, I'm done.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.repeat){\\n case \\\"Yes\\\":\\n optionMenu();\\n break;\\n\\n case \\\"No, I'm done.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"async displayFoodChoice(step) {\\n const user = await this.userProfile.get(step.context, {});\\n if (user.food) {\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n } else {\\n const user = await this.userProfile.get(step.context, {});\\n\\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\\n\\n if (step.context.activity.text == 1) {\\n user.food = \\\"European\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 2) {\\n user.food = \\\"Chinese\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 3) {\\n user.food = \\\"American\\\";\\n await this.userProfile.set(step.context, user);\\n }else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\\n return await step.beginDialog(WHICH_FOOD);\\n }\\n\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n }\\n return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"setSelectedRestaurant(state, resto) {\\n state.selectedRestaurant = resto;\\n }\",\n \"onSelectRestaurant(restaurant){\\n this.closeAllRestaurant()\\n restaurant.viewDetailsComments()\\n restaurant.viewImg()\\n\\n }\",\n \"function startOver() {\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to make another selection?\\\"\\n\\t\\t}\\n\\t]).then(function(answer) {\\n\\t\\tif (answer.confirm === true) {\\n\\t\\t\\tdisplayOptions();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Goodbye!\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"function mainMenu() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"choice\\\",\\n message: \\\"Would you like to place another order?\\\"\\n }\\n ]).then(function (answer) {//response is boolean only\\n if (answer.choice) { //if true, run func\\n startBamazon();\\n } else {\\n console.log(\\\"Thanks for shopping at Bamazon. See you soon!\\\")\\n connection.end();\\n }\\n })\\n}\",\n \"function resetProductView(){\\n \\n inquirer.prompt([\\n {\\n type: \\\"rawlist\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do next?\\\",\\n choices:[\\\"I want to checkout\\\", \\\"I want to continue shopping\\\"]\\n }\\n\\n ]).then(function(answers){\\n if(answers.action === \\\"I want to checkout\\\"){\\n console.log(\\\"Good Bye, hope to see you again!\\\");\\n }else if (answers.action === \\\"I want to continue shopping\\\"){\\n customerview();\\n }\\n });\\n\\n}\",\n \"function doChoice(e) {\\n if (this.selectedIndex>0) {\\n var c = favlist[this.options[this.selectedIndex].value];\\n\\t\\tvar fail = false;\\n if (c) {\\n var i;\\n setNotice('Loading fav ...');\\n for (i=1;i<=c.length;i++) {\\n fail |= setState(i,c[i-1]);\\n }\\n for (;i<=11;i++) {\\n clearState(i);\\n }\\n }\\n this.selectedIndex = 0;\\n\\t\\tif (fail)\\n\\t\\t\\taddNotice('Item(s) not found!');\\n\\t\\telse\\n\\t\\t\\taddNotice('Fav loaded!');\\n }\\n}\",\n \"function continueShopping(){\\n inquirer.prompt(\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Do you want to continue shopping?\\\",\\n default: true\\n }\\n ).then(answers=>{\\n if(answers.confirm){\\n displayProducts();\\n }else{\\n connection.end();\\n }\\n });\\n}\",\n \"function regretFastFoodRestaurantOption() {\\n subTitle.innerText = \\\"Are you sure?\\\";\\n firstButton.innerText = \\\"Yes, continue\\\";\\n firstButton.onclick = function() {\\n fastFoodRestaurantScene();\\n }\\n secondButton.innerText = \\\"No, go back\\\";\\n secondButton.onclick = function() {\\n startFunction();\\n }\\n}\",\n \"function regretsPrompt (res) {\\n\\tinquirer\\n \\t\\t.prompt([\\n \\t\\t\\t{\\n\\t\\t\\t\\ttype: \\\"list\\\",\\n\\t\\t\\t\\tmessage: \\\"What would you like to do?\\\",\\n\\t\\t\\t\\tchoices: [\\\"Change Quantity\\\", \\\"Start Over\\\"],\\n\\t\\t\\t\\tname: \\\"selection\\\"\\n\\t\\t }\\n\\t\\t])\\n\\t\\t.then(function(inqRes) {\\n\\t\\t\\tif (inqRes.selection == \\\"Change Quantity\\\"){\\n\\t\\t\\t\\tquantityPrompt(res);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdisplayAllProducts();\\t\\n\\t\\t\\t}\\n\\n\\n\\t\\t});//ends then\\n}\",\n \"function continuePrompt(){\\n inquirer.prompt({\\n type: \\\"confirm\\\",\\n name: \\\"continue\\\",\\n message: \\\"Continue....?\\\",\\n }).then((answer) => {\\n if (answer.continue){\\n showMainMenu();\\n } else{\\n exit();\\n }\\n })\\n}\",\n \"function repeat() {\\n inquirer\\n .prompt({\\n name: \\\"gotoMainMenu\\\",\\n type: \\\"list\\\",\\n message: \\\"Do you want to go back to main menu ?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n })\\n .then(function (choice) {\\n if (choice.gotoMainMenu === \\\"Yes\\\") {\\n start();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function managerChoice() {\\n \\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products For Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Quit\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"View Products For Sale\\\":\\n MgrDisplayInv();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInv();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInv();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addItem();\\n break;\\n\\n case \\\"Quit\\\":\\n disconnect();\\n break;\\n }\\n });\\n}\",\n \"function mainOptions() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View\\\",\\n \\\"Add\\\",\\n \\\"Delete\\\",\\n \\\"Update\\\"\\n ]\\n })\\n .then(function (answer) {\\n switch (answer.action) {\\n\\n case \\\"View\\\":\\n viewChoice();\\n break;\\n\\n case \\\"Add\\\":\\n addChoice();\\n break;\\n\\n case \\\"Delete\\\":\\n deleteChoice()\\n break;\\n\\n case \\\"Update\\\":\\n updateChoice()\\n break;\\n\\n\\n }\\n });\\n\\n}\",\n \"function startPrompt() {\\n \\n inquirer.prompt([{\\n\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Welcome to Zohar's Bamazon! Wanna check it out?\\\",\\n default: true\\n\\n }]).then(function(user){\\n if (user.confirm === true){\\n inventory();\\n } else {\\n console.log(\\\"FINE.. come back soon\\\")\\n }\\n });\\n }\",\n \"function goPrompt() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"What action would you like to do?\\\",\\n name: \\\"choice\\\",\\n choices: [\\n \\\"Check Departments\\\",\\n \\\"Check Roles\\\",\\n \\\"Check Employees\\\",\\n \\\"Plus Employee\\\",\\n \\\"Plus Role\\\",\\n \\\"Plus Department\\\"\\n ]\\n }\\n // switch replaces else if...selects parameter and javascript will look for the correct function\\n ]).then(function (data) {\\n switch (data.choice) {\\n case \\\"Check Departments\\\":\\n viewDepartments()\\n break;\\n case \\\"Check Roles\\\":\\n viewRoles()\\n break;\\n case \\\"Check Employees\\\":\\n viewEmployees()\\n break;\\n case \\\"Plus Employee\\\":\\n plusEmployees()\\n break;\\n case \\\"Plus Department\\\":\\n plusDepartment()\\n break;\\n case \\\"Plus Role\\\":\\n plusRole()\\n break;\\n }\\n })\\n}\",\n \"function runAgain(){\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function startOver() {\\n inquirer\\n .prompt({\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to buy another product?\\\",\\n default: true\\n })\\n .then(function(answer) {\\n if (answer.continue) {\\n purchaseChoice();\\n }\\n else {\\n connection.end();\\n }\\n })\\n}\",\n \"async handleMenuResult(step) {\\n switch (step.result.value) {\\n case \\\"Donate Food\\\":\\n return step.beginDialog(DONATE_FOOD_DIALOG);\\n case \\\"Find a Food Bank\\\":\\n return step.beginDialog(FIND_FOOD_DIALOG);\\n case \\\"Contact Food Bank\\\":\\n return step.beginDialog(CONTACT_DIALOG);\\n }\\n return step.next();\\n }\",\n \"function continueShopping() {\\n inquire.prompt([{\\n message: \\\"Checkout or Continue Shopping?\\\",\\n type: \\\"list\\\",\\n name: \\\"continue\\\",\\n choices: [\\\"Continue\\\", \\\"Go to checkout\\\"]\\n }]).then(function (ans) {\\n if (ans.continue === \\\"Continue\\\") {\\n console.log(\\\" Items Added to Cart!\\\");\\n shoppingCart();\\n } else if (ans.continue === \\\"Go to checkout\\\") {\\n checkOut(itemCart, cartQuant);\\n }\\n });\\n}\",\n \"function runAgain2(){\\n console.log('That item ID was not found in our records.');\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function restartFunction() {\\n inquirer.prompt([\\n {\\n name:\\\"action\\\",\\n type:\\\"list\\\",\\n message: \\\"Do you want to do another operation?\\\",\\n choices: [\\n \\\"Yes, please.\\\",\\n \\\"No, I am fine thank you.\\\"\\n ]\\n }\\n ]).then(function(answer) {\\n if(answer.action === \\\"Yes, please.\\\") {\\n menuOptions();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"next() {\\n inquirer\\n .prompt({\\n type: 'list',\\n name: 'select',\\n message: 'Select a team member or hit \\\"Done\\\" to finish:',\\n choices: ['Add Manager', 'Add Engineer', 'Add Intern', 'Done'],\\n }).then(({select}) => {\\n this.parseChoice(select);\\n });\\n }\",\n \"chooseLocation() {\\n \\n }\",\n \"function restartPrompt(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Would you like to continue shopping?\\\".question,\\n default: true\\n }\\n ]).then(function(input){\\n // If customer wants to continue show products again\\n if(input.confirm){\\n showProducts();\\n }\\n else{\\n console.log(\\\"Thank you for shopping with Bamazon!\\\".magenta);\\n connection.end();\\n }\\n })\\n}\",\n \"function reRun(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"reply\\\",\\n message: \\\"Would you like to purchase another item?\\\"\\n }\\n ]).then(function(answer) {\\n if(answer.reply) {\\n buy();\\n } \\n else \\n {\\n console.log(\\\"Thanks for shopping Bamazon!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function callNextActionOrExit(answer) {\\n if (answer.userSelection === \\\"View Products for Sale\\\") {\\n console.log(\\\"You want to view products\\\");\\n viewProducts();\\n } else if (answer.userSelection === \\\"View Low Inventory\\\") {\\n console.log(\\\"You want to view inventory\\\")\\n viewLowInventory();\\n } else if (answer.userSelection === \\\"Add to Inventory\\\") {\\n console.log(\\\"You want to add to inventory\\\")\\n addToInventory();\\n } else if (answer.userSelection === \\\"Add New Product\\\") {\\n console.log(\\\"You want to add a new product\\\")\\n getNewItem();\\n } else {\\n database.endConnection();\\n }\\n}\",\n \"function managerOptions() {\\n inquirer.prompt([\\n {\\n name: \\\"option\\\",\\n message: \\\"Hello, random manager. What would you like to do today?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\"]\\n }\\n ]).then(function (answer) {\\n\\n //Use a switch case since we have multiple scenarios\\n switch (answer.option) {\\n\\n case \\\"View Products for Sale\\\":\\n viewProducts();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addNew();\\n break;\\n };\\n });\\n}\",\n \"function ADMIN() {\\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\\n flights.sort((a, b) => a.id - b.id);\\n for (let i = 0; i < flights.length; i++) {\\n flights[i].display = true;\\n }\\n let ediDel;\\n do {\\n ediDel = prompt(\\n \\\"Te encuentras en la funci\\\\u00F3n de ADMINISTRADOR. Indica la funci\\\\u00F3n a la que quieres acceder: EDIT, DELETE.\\\",\\n \\\"EDIT,DELETE\\\"\\n );\\n salida(ediDel, ADMIN);\\n ediDel = ediDel.toUpperCase();\\n } while (ediDel !== \\\"EDIT\\\" && ediDel !== \\\"DELETE\\\");\\n\\n //JUMP TO NEXT FUNCITON\\n if (ediDel === \\\"EDIT\\\") {\\n EDIT();\\n } else if (ediDel === \\\"DELETE\\\") {\\n DELETE();\\n } else {\\n alert(\\\"No te he entendido\\\");\\n ADMIN();\\n }\\n}\",\n \"function again() {\\n inquirer.prompt({\\n name: \\\"shop\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to keep shopping?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }).then(function(answer){\\n if(answer.shop == \\\"Yes\\\"){\\n list();\\n } else {\\n console.log(\\\"Please come back soon!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function endRepeat() {\\n inquirer\\n .prompt([{\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n message: \\\"\\\\nDo you want to perform another operation?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then( answer => {\\n if (answer.wish === \\\"Yes\\\") {\\n showMenu();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"function determineNextAction(option) {\\n switch(option.toString()) {\\n case \\\"Add Engineer\\\": \\n currentEmployeeType = Engineer.getRole();\\n askQuestions(ENGINEER_QUESTIONS);\\n break;\\n case 'Add Intern':\\n currentEmployeeType = Intern.getRole();\\n askQuestions(INTERN_QUESTIONS)\\n break;\\n case 'Exit':\\n console.log(\\\"generate html\\\");\\n GenerateHTML.generateSkeletonHTML(teamArray);\\n console.log(\\\"exiting....\\\");\\n break;\\n }\\n}\",\n \"function shopAgain(){\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"shop\\\",\\n message: \\\"Would you like to buy another item?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n }\\n ]).then(function(answer) {\\n if (answer.shop === \\\"YES\\\") {\\n runBamazon();\\n } else {\\n console.log(\\\"Thank you for shopping with us, have a nice day!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function initSelectRestaurant(restaurants, searchTerm){\\n $(function(){\\n\\n var getRestaurant = window.LE.restaurants.getRestaurant\\n\\n userdata.restaurant = null;\\n\\n //dummy var\\n var isSearch = null;\\n\\n // prepare template\\n var source = $(\\\"#restaurant-dropdown-template\\\").html();\\n var template = Handlebars.compile(source);\\n\\n html = template(restaurants); \\n\\n // populate dropdown for restaurants\\n var renderingRestaurants = $('#render-restaurants').after(html);\\n\\n // render confirmation of the search term so the user remembers what they were looking for\\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\\n\\n // when the restaurant changes, we need to display rate and other data\\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\\n });\\n \\n $(\\\"#select-restaurant-continue-button\\\").on(\\\"click\\\", function(){\\n // this is the restaurant id to render later\\n var selectedVal = $(\\\"#restaurant\\\").val();\\n\\n if(_debug){ console.log(selectedVal); }\\n\\n if(selectedVal == \\\"\\\"){\\n document.getElementById(\\\"restaurant-alert\\\").innerHTML = \\\"Required.\\\";\\n }else{\\n\\n // cleanup old event handlers before leaving home context\\n destroyHome();\\n\\n userdata.currentRestaurant = selectedVal;\\n initSelectItem(selectedVal);\\n // ease scroll to top of next view\\n $(\\\"html, body\\\").animate({ scrollTop: 0 }, \\\"slow\\\");\\n }\\n });\\n });\\n}\",\n \"function displayRestaurant() {\\n restaurantDrop.on(\\\"click\\\", function (event) {\\n if ($(event.target).attr(\\\"class\\\") === \\\"yes\\\") {\\n console.log(\\\"hi\\\");\\n $(\\\".body-container\\\").prepend($(\\\".location\\\").show());\\n restaurantOption.hide();\\n }\\n if ($(event.target).attr(\\\"class\\\") === \\\"no\\\") {\\n $(\\\".final-date\\\").removeClass(\\\"hide\\\");\\n restaurantOption.hide();\\n viewDate.append($(\\\".movie-display\\\"));\\n $(\\\".movie-display\\\").show();\\n restaurantStorage.push(\\\"\\\")\\n localStorage.setItem(\\\"Restaurants\\\", JSON.stringify(restaurantStorage))\\n }\\n });\\n}\",\n \"function superAsk(){\\n\\n inquirer\\n .prompt([\\n // Here we create a basic text prompt.\\n {\\n type: \\\"rawlist\\\",\\n message: \\\"Greetings, what action would you like to perform today? (select by picking a #)\\\",\\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\\n name: \\\"action\\\", \\n },\\n\\n ])\\n .then(function(response) {\\n\\n switch (response.action) {\\n case 'View Product Sales by Department':\\n viewProdSales();\\n break;\\n case 'Create New Department':\\n createDept();\\n break;\\n case 'Exit':\\n process.exit();\\n break;\\n default:\\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\\n }\\n });\\n}\",\n \"function restartMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tname: \\\"restartSelection\\\",\\n\\t\\tmessage: \\\"Would you like to return to the main menu?\\\"\\n\\t}]).then(function(restartAnswer){\\n\\t\\tif (restartAnswer.restartSelection === true) {\\n\\t\\t\\tmanagerMenu();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Good bye!\\\"); \\n\\t\\t}\\n\\t});\\n}\",\n \"function menu_paquet(){\\n\\t\\taction=prompt(\\\"F fin de tour | P piocher une carte\\\");\\n\\t\\taction=action.toUpperCase();\\n\\t\\tif (action != null){\\n\\t\\t\\tswitch(action){\\n\\t\\t\\t\\tcase \\\"F\\\":\\n\\t\\t\\t\\t\\tif (att_me.length>0){\\n\\t\\t\\t\\t\\t\\t//MAJ des cartes en INV_ATT1,2\\n\\t\\t\\t\\t\\t\\tmajCartesEnAttaque();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif (pv_adv==0 || pv_me==0){\\n\\t\\t\\t\\t\\t\\tif (pv_adv==0){\\n\\t\\t\\t\\t\\t\\t\\talert(\\\"Vous avez gagné !!!\\\");\\n\\t\\t\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\t\\t\\talert(\\\"Vous avez perdu !!!\\\");\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t/////////////////////////////////Gérer la fin de partie ICI\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tIA_jouer(IA_stategie_basic);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"P\\\":\\n\\t\\t\\t\\t\\tjeu_piocherDsPaquet(true);\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View All departments\\\",\\n \\\"View All employees\\\",\\n \\\"View All roles\\\",\\n \\\"Add roles\\\",\\n \\\"Add departments\\\",\\n \\\"Add employees\\\",\\n \\\"Delete roles\\\",\\n \\\"Delete departments\\\",\\n \\\"Exit\\\"\\n ]\\n })\\n .then(function(res) { \\n switch (res.action) {\\n case \\\"View departments\\\":\\n viewDep();\\n break;\\n \\n case \\\"View All employees\\\":\\n viewEmp();\\n break;\\n \\n case \\\"View All roles\\\":\\n viewRole();\\n break;\\n \\n case \\\"Add roles\\\":\\n addRole();\\n break;\\n \\n case \\\"Add departments\\\":\\n addDep();\\n break;\\n\\n case \\\"Add employees\\\":\\n addEmp();\\n break;\\n\\n case \\\"Update employee roles\\\":\\n updateEmpRole();\\n break;\\n \\n case \\\"Delete roles\\\":\\n deleteRole();\\n break;\\n \\n case \\\"Delete departments\\\":\\n deleteDep();\\n break;\\n \\n case \\\"Exit\\\":\\n end();\\n break\\n }\\n });\\n }\",\n \"function handleNewMealRequest(response) {\\n // Get a random meal from the random meals list\\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\\n var meal = RANDOM_MEALS[mealIndex];\\n\\n // Create speech output\\n var speechOutput = \\\"Here's a suggestion: \\\" + meal;\\n\\n response.tellWithCard(speechOutput, \\\"MealRecommendations\\\", speechOutput);\\n}\",\n \"function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\\n if(userInput === \\\"1\\\"){\\n \\n randomDestination = yesOrNo(destination,destination);\\n \\n }\\n else if (userInput === \\\"2\\\") {\\n \\n randomRestaurant = yesOrNo(restaurant,restaurant);\\n }\\n else if (userInput === \\\"3\\\") {\\n \\n randomTravelType = yesOrNo(transportation, transportation);\\n }\\n else if (userInput === \\\"4\\\") {\\n \\n randomEntertainment = yesOrNo(entertainment,entertainment);\\n }\\n}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"select\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"VIEW SALES\\\", \\\"CREATE NEW DEPARTMENT\\\", \\\"DELETE DEPARTMENT\\\", \\\"EXIT\\\"]\\n }).then(function (answers) {\\n if (answers.select.toUpperCase() === \\\"VIEW SALES\\\") {\\n viewSales();\\n } else if (answers.select.toUpperCase() === \\\"CREATE NEW DEPARTMENT\\\") {\\n newDepartment();\\n } else if (answers.select.toUpperCase() === \\\"DELETE DEPARTMENT\\\") {\\n deleteDepartment();\\n } else {\\n // Selecting \\\"EXIT\\\" just takes the user here\\n connection.end();\\n }\\n });\\n}\",\n \"function nextAction() {\\n\\tinquirer.prompt({\\n\\t\\tmessage: \\\"What would you like to do next?\\\",\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"nextAction\\\",\\n\\t\\tchoices: [\\\"Add More Items\\\", \\\"Remove Items\\\", \\\"Alter Item Order Amount\\\", \\\"Survey Cart\\\", \\\"Checkout\\\"]\\n\\t})\\n\\t\\t.then(function (actionAnswer) {\\n\\t\\t\\tswitch (actionAnswer.nextAction) {\\n\\t\\t\\t\\tcase \\\"Add More Items\\\":\\n\\t\\t\\t\\t\\t// go to the start function\\n\\t\\t\\t\\t\\tstart();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Remove Items\\\":\\n\\t\\t\\t\\t\\t// go to the removal function\\n\\t\\t\\t\\t\\tremoveItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Checkout\\\":\\n\\t\\t\\t\\t\\t// go to the checkout tree;\\n\\t\\t\\t\\t\\tverifyCheckout();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Alter Item Order Amount\\\":\\n\\t\\t\\t\\t\\t// go to the function that alters the shopping cart qty\\n\\t\\t\\t\\t\\talterItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Survey Cart\\\":\\n\\t\\t\\t\\t\\t// look at the cart\\n\\t\\t\\t\\t\\tcheckoutFunction();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tdefault: console.log(\\\"how did you get here?\\\")\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function anotherAction() {\\n\\n inquirer\\n .prompt([\\n {\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to complete another action?\\\"\\n }\\n ])\\n .then(function (answer) {\\n if (answer.confirm == true) {\\n showMenu();\\n }\\n else {\\n console.log(\\\"Goodbye.\\\");\\n connection.end();\\n }\\n\\n });\\n\\n}\",\n \"onSelectRestaurant(restaurant){\\n \\n this.infoWindow.setContent(` ${restaurant.name} ${restaurant.address} `)\\n this.infoWindow.open(this.map,this.markers.find(m=>m.restaurant.address === restaurant.address));\\n }\",\n \"function askForMenuOption() {\\n\\tlet selection = PROMPT.question(\\\" >> \\\");\\n\\tswitch (selection) {\\n\\t\\tcase \\\"new\\\":\\n\\t\\t\\taddNewMovie();\\n\\t\\t\\taddMovieRating(movies.length - 1);\\n\\t\\t\\tbreak;\\n\\t\\tcase \\\"sort\\\":\\n\\t\\t\\tsetSortOrder();\\n\\t\\t\\tbreak;\\n\\t\\tdefault:\\n\\t\\t\\tif (selection == \\\"\\\" || (!MOVIE_ID_REGEX.test(selection) || selection > movies.length)) {\\n\\t\\t\\t\\tconsole.log(\\\"--- Movie ID invalid - Try again ---\\\");\\n\\t\\t\\t\\taskForMenuOption();\\n\\t\\t\\t}\\n\\t\\t\\taddMovieRating(Number(selection) - 1);\\n\\t\\t\\tbreak;\\n\\n\\t}\\n}\",\n \"function _wantToGoFunction() {\\n if (vm.dataCheck) {\\n\\n for (var i = 0; i < vm.dataCheck.length; i++) {\\n\\n if (vm.dataCheck[i].favoriteType == 2) {\\n\\n vm.$alertService.warning('Already in your \\\"Want To Go\\\" list!');\\n }\\n }\\n\\n } else {\\n\\n vm.favoriteTypeData = {\\n favoriteType: 2,\\n placeId: vm.place.id\\n }\\n\\n vm.$userFavoritePlacesService.apiPostUserFavoritePlaces(vm.favoriteTypeData, vm.onFavoriteSuccess, vm.onFavoriteError);\\n }\\n }\",\n \"function continueorquit(data) {\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"CorQ\\\",\\n message: \\\"Would you like to Add Another employee\\\",\\n choices: ['Yes', 'No']\\n },\\n ])\\n .then(quitData => {\\n switch (quitData.CorQ) {\\n case 'Yes': getEmployee()\\n break\\n case 'No': createWebsite()\\n break\\n }\\n })\\n\\n\\n}\",\n \"function another() {\\n inquirer\\n .prompt(\\n {\\n name: 'another',\\n type: 'confirm',\\n message: 'Would you like to continue shopping?'\\n },\\n\\n )\\n .then(function (answer) {\\n if (answer.another === true) {\\n start();\\n } else {\\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\\n connection.end();\\n }\\n });\\n\\n}\",\n \"function promptAction() {\\n inquirer.prompt([{\\n type: 'list',\\n message: 'Select from list below what action you would like to complete.',\\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\\n name: \\\"action\\\"\\n }, ]).then(function(selection) {\\n switch (selection.action) {\\n case 'View Products for Sale':\\n viewAllProducts();\\n break;\\n\\n case 'View Low Inventory':\\n lowInventoryList();\\n break;\\n\\n case 'Add to Inventory':\\n addInventory();\\n break;\\n\\n case 'Add New Product':\\n addNewProduct();\\n break;\\n }\\n }).catch(function(error) {\\n throw error;\\n });\\n}\",\n \"function systemSelection(option){\\n\\tvar check = option; \\n\\tif(vehicleFuel<=0){\\n\\t\\tgameOverLose();\\n\\t}\\n\\n\\telse{\\n\\n\\n\\tif(currentLocation===check){\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\\\",beginTravel);\\n\\t\\t\\t}\\n\\n\\telse{\\n\\t\\n\\t\\t\\tif(check.toLowerCase() === \\\"e\\\"){\\n\\t\\t\\t\\tvehicleFuel=(vehicleFuel-10);\\n\\t\\t\\t\\tcurrentLocation=\\\"e\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Earth...You used 10 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToEarth);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"m\\\"){\\n\\t\\t\\t//need to add a 'visited' conditional\\n\\t\\t\\tvehicleFuel=(vehicleFuel-20);\\n\\t\\t\\tcurrentLocation=\\\"m\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Mesnides...You used 20 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\", goToMesnides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"l\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-50);\\n\\t\\t\\tcurrentLocation=\\\"l\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Laplides...You used 50 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToLaplides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"k\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-120);\\n\\t\\t\\tcurrentLocation=\\\"k\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Kiyturn...You used 120 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToKiyturn);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"a\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-25);\\n\\t\\t\\tcurrentLocation=\\\"a\\\";\\n\\t\\t\\tgamePrompt(\\\"Flying to Aenides...You used 25 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToAenides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"c\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-200);\\n\\t\\t\\tcurrentLocation=\\\"c\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Cramuthea...You used 200 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToCramuthea);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"s\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-400);\\n\\t\\t\\tcurrentLocation=\\\"s\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Smeon T9Q...You used 400 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToSmeon);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"g\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-85);\\n\\t\\t\\tcurrentLocation=\\\"g\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToGleshan);\\n\\t\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, I did not understand you. I will return you to the main menu\\\",beginTravel);\\n\\t\\t}\\n\\t}\\n\\t}\\n}\",\n \"function askAgain(){\\n\\tconsole.log(\\\"=============================================================\\\");\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to do another task?\\\",\\n\\t\\t\\tdefault: false\\n\\t\\t}\\n\\t]).then(function(again){\\n\\t\\tif (again.confirm){\\n\\t\\t\\tsupervisorOptions();\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(\\\"All tasks are done.\\\");\\n\\t\\t\\t// Exits node program execution\\n\\t\\t\\tprocess.exit();\\n\\t\\t}\\n\\t});\\n}\",\n \"prompt() {\\n // Fetch appointment types from Acuity\\n acuity.request('/appointment-types', function (err, res, appointmentTypes) {\\n\\n // Build some buttons for folks to choose a class\\n const replies = appointmentTypes\\n // Filter types for public classes\\n .filter(appointmentType => appointmentType.type === 'class' && !appointmentType.private)\\n // Create a button for each type\\n .map(appointmentType => client.makeReplyButton(\\n appointmentType.name,\\n null,\\n 'bookClass',\\n {appointmentTypeID: appointmentType.id}\\n ));\\n\\n // Set the response intent to prompt to choose a type\\n client.addResponseWithReplies('prompt/type', null, replies);\\n\\n // End the asynchronous prompt\\n client.done();\\n });\\n }\",\n \"function fancyRestauratMenu() {\\n subTitle.innerText = fancyRestaurantWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fancyDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFancyRestaurantChoice();\\n}\",\n \"function start() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"Purchase Items\\\", \\n \\\"Exit\\\"],\\n }\\n ]).then(function(answer) {\\n\\n // Based on the selection, the user experience will be routed in one of these directions\\n switch (answer.choice) {\\n case \\\"Purchase Items\\\":\\n displayItems();\\n break;\\n case \\\"Exit\\\":\\n exit();\\n break;\\n }\\n });\\n} // End start function\",\n \"function anythingElse() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Anything Else?\\\",\\n name: \\\"choice\\\"\\n }\\n ])\\n .then(res => {\\n if (res.choice) {\\n displayProducts();\\n } else {\\n console.log(\\\"Thank You!\\\");\\n console.log(`Total: $${total}`);\\n connection.end();\\n }\\n });\\n}\",\n \"function fightOrCave() {\\n\\n let whereNext = prompt(\\\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\\\").toLowerCase();\\n\\n if (whereNext === \\\"grottan\\\"){\\n goToCaveSecondTime();\\n }\\n else if (whereNext === \\\"fight\\\") {\\n alert(\\\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\\\")\\n goToCaveSecondTime();\\n }\\n else {\\n alert(\\\"Vänligen ange fight eller grottan\\\")\\n fightOrCave()\\n }\\n\\n \\n}\",\n \"function promptOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Would you like to ... ?\\\",\\n choices: [\\\"Continue Shopping\\\", \\\"Update Cart\\\", \\\"Checkout\\\"],\\n name: \\\"choice\\\"\\n }\\n ]).then(function (option) {\\n switch (option.choice) {\\n case \\\"Continue Shopping\\\":\\n promptBuy();\\n break;\\n case \\\"Update Cart\\\":\\n updateCart();\\n break;\\n case \\\"Checkout\\\":\\n checkout();\\n break;\\n }\\n });\\n}\",\n \"function endStart(){\\n inquirer.prompt({\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"continue shopping?\\\",\\n // default: true\\n }).then(function (data) {\\n if (data.confirm === false)\\n \\n process.exit();\\n else \\n start();\\n });\\n}\",\n \"function managerOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"checkbox\\\",\\n name: \\\"managerTask\\\",\\n message: \\\"Hi manager. What would you like to do?\\\",\\n choices: [\\\"View products for sale\\\", \\\"View low inventory\\\", \\\"Add to inventory\\\", \\\"Add New Product\\\"]\\n }\\n ]).then(function (manager) {\\n var task = manager.managerTask;\\n if (task == \\\"View products for sale\\\") {\\n viewProducts();\\n }\\n else if (task == \\\"View low inventory\\\") {\\n lowinventory();\\n }\\n else if (task == \\\"Add to inventory\\\") {\\n addToInvetory();\\n }\\n else if (task == \\\"Add New Product\\\") {\\n addProduct();\\n }\\n });\\n}\",\n \"function returnToMenu() {\\n\\tinquirer.prompt({\\n\\t\\tname: \\\"choice\\\",\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tmessage: \\\"Would you like to return to the menu?\\\"\\n\\n\\t}).then(function(input) {\\n\\t\\tif (input.choice === true) {\\n\\t\\t\\tmenu();\\n\\t\\t} else {\\n\\t\\t\\tconnection.end();\\n\\t\\t}\\n\\t})\\n}\",\n \"function menuoption(){\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name : \\\"menu\\\",\\n message : \\\"What do you want to see ?\\\",\\n choices : [\\\"\\\\n\\\",\\\"View Products for Sale\\\",\\\"View Low Inventory\\\",\\\"Add to Inventory\\\",\\\"Add New Product\\\"]\\n\\n }).then(function(answer){\\n // var update;\\n // var addnew;\\n console.log(answer.menu);\\n //if else option to compare user input and call the required function\\n if(answer.menu == \\\"View Products for Sale\\\" ){\\n showitem();\\n }else if(answer.menu == \\\"View Low Inventory\\\"){\\n \\n lowinventory();\\n }else if(answer.menu == \\\"Add to Inventory\\\"){\\n updateinventory();\\n // updateonecolumn(itemidinput);\\n }else if(answer.menu == \\\"Add New Product\\\"){\\n addnewproduct();\\n }\\n \\n });\\n }\",\n \"function shop() {\\n\\n inquirer.prompt([{\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Update Inventory\\\", \\\"Add New Product\\\"]\\n }]).then(function (answer) {\\n\\n switch (answer.menu) {\\n case \\\"View Products for Sale\\\":\\n forSale();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowStock();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addThing();\\n break;\\n\\n case \\\"Update Inventory\\\":\\n moreStuff();\\n break;\\n }\\n });\\n}\",\n \"buildGoOption(term) {\\n let isValidPatp = urbitOb.isValidPatp(term.substr(1));\\n let isStation = isValidStation(term);\\n let details = isStation && getStationDetails(term);\\n // use collection description if it's a collection\\n let displayTextTerm = isStation ? details.type == 'text' ? `${details.station.split(\\\"/\\\")[0]} / ${details.stationTitle}` : details.station.split(\\\"/\\\").join(\\\" / \\\") : term;\\n\\n let displayText = `go ${displayTextTerm}`;\\n let helpText = isStation ?\\n `Go to ${details.cir} on ~${details.host}` :\\n `Go to the profile of ${term}`\\n\\n return {\\n name: `go ${term}`,\\n action: () => {\\n let targetUrl;\\n if (isValidPatp) {\\n targetUrl = profileUrl(term.substr(1))\\n this.props.transitionTo(targetUrl);\\n } else if (isStation) {\\n targetUrl = (details.type === \\\"text-topic\\\") ? details.postUrl : details.stationUrl\\n this.props.transitionTo(targetUrl);\\n }\\n },\\n displayText,\\n helpText\\n };\\n }\",\n \"function handle_again() {\\n var current = current_selection();\\n // call the initiator function on the current selection\\n window.initiate_fcn(current, $(featherlight_selector()).get(0));\\n}\",\n \"function menu() {\\n var option = parseInt(prompt('Choississez une option :'));\\n\\n do {\\n if (option == 1) {\\n list(), navigation();\\n var option = parseInt(prompt('Choississez une option :'));\\n } else if (option == 2) {\\n addContact();\\n var option = parseInt(prompt('Choississez une option :'));\\n }\\n } while (option != 3)\\n alert(\\\"Aurevoir et à bientot !\\\");\\n}\",\n \"function askToContinue() {\\n\\t\\tinquirer\\n\\t\\t\\t.prompt([\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\ttype: 'confirm',\\n\\t\\t\\t\\t\\tmessage: 'Do you want to play again?',\\n\\t\\t\\t\\t\\tname: 'confirm',\\n\\t\\t\\t\\t\\tdefault: true\\n\\t\\t\\t\\t}\\n\\t\\t\\t])\\n\\t\\t\\t.then(function(response) {\\n\\t\\t\\t\\tif (response.confirm === true) {\\n\\t\\t\\t\\t\\tstartGame();\\n\\t\\t\\t\\t} \\n\\t\\t\\t});\\n\\t}\",\n \"function cardMakeContinue() { // function that asks to continue making cards//\\n\\tinquirer.prompt({\\n\\t\\t\\ttype: \\\"list\\\",\\n\\t\\t\\tmessage:\\\"\\\\nContinue? Yes or No \\\",\\n\\t\\t\\tchoices: [\\\"Yes\\\", \\\"No\\\"],\\n\\t\\t\\tname: \\\"ynChoices\\\"\\n\\t\\t\\t}).then(function(continuebasicYN){\\n\\t\\t\\tvar ynChoices = continuebasicYN.ynChoices;\\n \\t\\n\\t\\t\\tif (ynChoices === \\\"Yes\\\") \\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tgetInfo(loop); // calls function to enter another card\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse \\n\\t\\t\\t\\t{ console.log(\\\"Good Job, you are finished!\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}) // close cardMakecontinue prompts\\n\\n\\t\\t}\",\n \"function frostingChoice(item) {\\n frostingChosen = true;\\n if (typeof preFrostingChoice !== 'undefined'){\\n preFrostingChoice.style.backgroundColor = \\\"white\\\";\\n }\\n\\n item.style.backgroundColor = \\\"lightgray\\\";\\n preFrostingChoice = item;\\n\\n checkPrice();\\n}\",\n \"function keepShopping(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"do you want to keep shopping for beers?\\\",\\n name: \\\"confirm\\\"\\n }\\n ]).then(function(res){\\n if (res.confirm){\\n console.log(\\\"----------------\\\");\\n showProducts();\\n } else {\\n console.log('Thank you for shopping in our online bar, happy drinking!');\\n connection.end();\\n }\\n })\\n}\",\n \"function promptContinue(){\\n return inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"Job\\\", \\n choices: [\\\"Engineer\\\", \\\"Intern\\\", \\\"Finish building my team\\\"]\\n },\\n])\\n.then((answers) => {\\n if(answers.Job === \\\"Engineer\\\"){\\n promptEngineer();\\n } else if (answers.Job === \\\"Intern\\\"){\\n promptIntern();\\n } else {\\n generate.generateHTML(employeeArray);\\n console.log(\\\"Your team is being built!\\\")\\n }\\n})\\n}\",\n \"async promptForMenu(step) {\\n return step.prompt(MENU_PROMPT, {\\n choices: [\\\"Donate Food\\\", \\\"Find a Food Bank\\\", \\\"Contact Food Bank\\\"],\\n prompt: \\\"Do you have food to donate, do you need food, or are you contacting a food bank?\\\",\\n retryPrompt: \\\"I'm sorry, that wasn't a valid response. Please select one of the options\\\"\\n });\\n }\",\n \"function askUser() {\\n inquirer.prompt(\\n {\\n name: \\\"action\\\",\\n message: \\\"WHAT WOULD YOU LIKE TO DO?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"BROWSE ITEMS\\\", \\\"EXIT\\\"]\\n }\\n ).then(function (answer) {\\n switch (answer.action) {\\n case \\\"BROWSE ITEMS\\\":\\n showItems();\\n break;\\n\\n case \\\"EXIT\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function checkIfVacationNeedsReplacement(bool){\\n let ask;\\n let empty = \\\"\\\";\\n if (bool === true){\\n alert(\\\"Enjoy your Vacation!\\\");\\n loopBreak = true;\\n return empty;\\n }\\n else{\\n ask = prompt(\\\"What part of your vacation would you like to replace? Type destination, food, transportation, entertainment, all, or done.\\\");\\n return ask;\\n }\\n}\",\n \"function goToAenides(){\\n\\t\\tif(visitedAen===0){\\n\\t\\t\\tvisitedAen=1;\\n\\t\\t\\t// artifacts=1;\\n\\t\\t\\tgamePrompt(\\\"You discover upon arrival to Aenides that they are a hostile people. You attempt to land, but they begin to fire upon your S.R.S.V. and you are forced to retreat.\\\",beginTravel);\\n\\t\\t}else{\\n\\t\\t\\tgamePrompt([\\\"You've already been here!\\\",\\\"Where to next?\\\"],beginTravel);\\n\\t\\t}\\n}\",\n \"function foodRunnerSelector() {\\n \\n if (document.getElementById(\\\"foodRunnerYes\\\").checked == true) {\\n\\tdoTipFoodRunner = true;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"Food Runner will be tipped out\\\";}\\n else { \\n\\tdoTipFoodRunner = false;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"No tip out for Food Runner\\\"; \\n }\\n return doTipFoodRunner\\n}\",\n \"function optionMenu(){\\n inquirer\\n .prompt({\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Nothing, I've changed my mind.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.menu){\\n case \\\"View Products for Sale\\\":\\n showProducts();\\n\\n // continuePrompt is delayed to allow showProducts to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n\\n // continuePrompt is delayed to allow lowInventory to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n showProducts()\\n\\n // addInventory is delayed to allow lowInventory to be completed\\n setTimeout(addInventory,300);\\n break;\\n\\n case \\\"Add New Product\\\":\\n newProduct();\\n break;\\n\\n case \\\"Nothing, I've changed my mind.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function confirmGoalsAndContinue() {\\n if ($('.js-goal-rank').length > 1) {\\n reorderItems('#goal-rank-num li', '#sortable-goals');\\n }\\n //Make sure the number labels are in the proper order, the user might navigate back to goal ranking using the back button\\n utility.getInitialOrder('#goal-rank-num li');\\n SALT.trigger('goalrank:updated');\\n $('#js-rank-container').removeClass('active-panel');\\n $('.js-onboarding-exit, .outer-progress-meter-wrapper').show();\\n //Show the first Q+A panel now that goal rank is hidden\\n $('.js-profileQA-container').children().first().addClass('active-panel');\\n focusFirstInput();\\n //Scroll to the top of the screen in case so that the user is always seeing the top of the new panel\\n $('html, body').animate({scrollTop: 0}, 300);\\n initializeProgressMeter();\\n }\",\n \"function noInventoryOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Do you want to choose a new item or quit?\\\",\\n choices: [\\\"NEW-ITEM\\\", \\\"QUIT\\\"],\\n name: \\\"startAgain\\\"\\n }\\n ])\\n .then(function(answer6) {\\n if (answer6.startAgain == \\\"NEW-ITEM\\\") {\\n displayProducts(); \\n }\\n if (answer6.startAgain == \\\"QUIT\\\") {\\n console.log(\\\"Thank you. Good-bye!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function onAfterLocationUpdate() {\\n $.fancybox.showLoading(getLabel('ajax.finding-restaurants'));\\n location.href = ctx + '/app/' + getLabel('url.find-takeaway') + '/session/loc';\\n}\",\n \"function returntoMenu() {\\n inquirer.prompt({\\n name: 'return',\\n type: 'rawlist',\\n choices: [\\\"Return to Main Menu\\\", \\\"Exit\\\"],\\n message: \\\"Would you like to return to main menu or exit?\\\"\\n }).then(function(answer){\\n if (answer.return === \\\"Return to Main Menu\\\") {\\n start();\\n }\\n else {\\n connection.end();\\n }\\n })\\n}\",\n \"function askAgain() {\\n\\n inquirer\\n .prompt({\\n name: \\\"nextSteps\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to continue shopping?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n })\\n .then(function(answer) {\\n \\n if (answer.nextSteps.toUpperCase() === \\\"NO\\\") {\\n\\n console.log(chalk.yellow(\\\"\\\\nHope you had a pleasant experience. Come again soon!\\\\n\\\"));\\n\\n //turns off the connection from db\\n connection.end();\\n }\\n\\n else {\\n\\n \\t//the first function is called again\\n \\treadProducts();\\n\\n\\n } \\n\\n });\\n}\",\n \"function options() {\\n inquirer\\n .prompt({\\n name: \\\"departmentOfManagers\\\",\\n type: \\\"list\\\",\\n message: \\\"Which saleDepartment you are looking for ?\\\",\\n choices: [\\\"Products of sale\\\", \\\"Low Inventory\\\", \\\"Add to Inventory\\\", \\\" Add New Product\\\"]\\n })\\n .then(function(answer) {\\n // based on their answer of functions\\n if (answer.options === \\\"Products of sale\\\") {\\n viewSaleProduct();\\n }\\n else if(answer.options === \\\"Low Inventory\\\") {\\n lowInventory();\\n }\\n else if(answer.options === \\\"Add to Inventory\\\") {\\n addInventory();\\n } \\n else if(answer.options === \\\"Add New Product\\\") \\n {\\n addNewProduct();\\n } else{\\n connection.end();\\n }\\n });\\n}\",\n \"function chooseFoodQuiz() {\\n $(foodQuiz).click();\\n questions = foodQuestions;\\n finalQuestion = foodQuestions.length - 1;\\n startQuiz();\\n}\",\n \"function nextPrompt(){\\n inquirer.prompt([\\n {\\n name: \\\"status\\\",\\n type: \\\"list\\\",\\n message: \\\"Buy more?\\\",\\n choices: [\\\"Buy more\\\", \\\"Exit\\\"]\\n }\\n ]).then(answer => {\\n if(answer.status === \\\"Buy more\\\"){\\n displayInventory();\\n promptBuy();\\n } else{\\n console.log(\\\"Thank you. Goodbye.\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function chooseAction() {\\n\\tinquirer\\n\\t\\t.prompt({\\n\\t\\t\\tname: \\\"action\\\", \\n\\t\\t\\ttype: \\\"rawlist\\\", \\n\\t\\t\\tmessage: \\\"What do you want to do?\\\", \\n\\t\\t\\tchoices: [\\\"VIEW PRODUCTS\\\", \\\"VIEW LOW INVENTORY\\\", \\\"ADD TO INVENTORY\\\", \\\"ADD NEW PRODUCT\\\", \\\"QUIT\\\"]\\n\\t\\t})\\n\\t\\t.then(function(ans) {\\n\\t\\t\\tif(ans.action.toUpperCase() ===\\\"VIEW PRODUCTS\\\") {\\n\\t\\t\\t\\tviewProducts(); \\n\\t\\t\\t} \\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"VIEW LOW INVENTORY\\\") {\\n\\t\\t\\t\\tviewLowInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD TO INVENTORY\\\") {\\n\\t\\t\\t\\taddInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD NEW PRODUCT\\\") {\\n\\t\\t\\t\\taddNewProduct(); \\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tendConnection(); \\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function mainMenu(){\\n inquirer.prompt([\\n {\\n name: \\\"mainOptions\\\",\\n type: \\\"list\\\",\\n message:\\\"What would you like to do?\\\",\\n choices: [\\\"View Products\\\", \\\"View Low Inventory Products\\\", \\\"Add Product Inventory\\\", \\\"Add New Product\\\", \\\"Exit\\\"]\\n }\\n ]).then(function(answer){\\n switch (answer.mainOptions) {\\n case \\\"View Products\\\":\\n displayInventory();\\n break;\\n case \\\"View Low Inventory Products\\\":\\n displayLowInv();\\n break;\\n case \\\"Add Product Inventory\\\":\\n addInventory();\\n break;\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n case \\\"Exit\\\":\\n console.log(\\\"***********************************************************\\\");\\n console.log(\\\"* Have a productive day :-) *\\\");\\n console.log(\\\"***********************************************************\\\");\\n connection.end();\\n };\\n });\\n}\",\n \"function managerPrompt() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"Hello Bamazon manager, what would you like to do today?\\\",\\n choices: [\\n \\\"View Products for sale?\\\",\\n \\\"View Low Inventory?\\\",\\n \\\"Add to Inventory?\\\",\\n \\\"Add a New Product?\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"View Products for sale?\\\":\\n viewAllProducts();\\n break;\\n\\n case \\\"View Low Inventory?\\\":\\n viewLowInventory();\\n break;\\n\\n case \\\"Add to Inventory?\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add a New Product?\\\":\\n addNewProduct();\\n break;\\n }\\n\\n });\\n\\n}\",\n \"function userSearch() {\\n\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do:\\\",\\n choices: [\\\"View product sales by Department\\\", \\\"Create new department\\\", \\\"Exit Supervisor Mode\\\"]\\n }\\n\\n ]).then(function (manager) {\\n\\n switch (manager.choice) {\\n case \\\"View product sales by Department\\\":\\n viewDepartments();\\n break;\\n \\n case \\\"Create new department\\\":\\n addNewDepartment();\\n break;\\n\\n case \\\"Exit Supervisor Mode\\\":\\n console.log(\\\"\\\\nSee ya later!\\\\n\\\");\\n connection.end ();\\n break;\\n }\\n\\n });\\n\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.68103266","0.64964914","0.6342976","0.62424755","0.61173964","0.6034379","0.5987297","0.58292925","0.5781033","0.5737571","0.57127887","0.5708035","0.5688682","0.56830406","0.56636477","0.56604296","0.56401587","0.5638404","0.56222045","0.5614877","0.5614036","0.5600347","0.5595774","0.5577155","0.55717146","0.55594057","0.55581653","0.55518633","0.5548958","0.5548455","0.55350167","0.5534366","0.5529235","0.551177","0.5496822","0.5494539","0.5492613","0.5483039","0.5469218","0.5468171","0.54679537","0.54669416","0.54539996","0.545248","0.5450221","0.54411936","0.5439916","0.5433537","0.54230577","0.54205126","0.54155624","0.5410685","0.5398335","0.5394103","0.53911227","0.5388845","0.5386328","0.53853667","0.5376627","0.53737193","0.5367417","0.5363824","0.53552276","0.53495127","0.5343098","0.533838","0.5334769","0.53335583","0.5333456","0.5319867","0.5306104","0.5301944","0.5300739","0.5299799","0.52993965","0.52922577","0.5288702","0.5283504","0.5283024","0.5280796","0.5275275","0.527482","0.5273145","0.52649635","0.52635384","0.5260161","0.5260071","0.52577615","0.5254783","0.52532935","0.52527183","0.5251287","0.52444947","0.524228","0.5241531","0.5236718","0.5236086","0.52356243","0.5228005","0.5226266"],"string":"[\n \"0.68103266\",\n \"0.64964914\",\n \"0.6342976\",\n \"0.62424755\",\n \"0.61173964\",\n \"0.6034379\",\n \"0.5987297\",\n \"0.58292925\",\n \"0.5781033\",\n \"0.5737571\",\n \"0.57127887\",\n \"0.5708035\",\n \"0.5688682\",\n \"0.56830406\",\n \"0.56636477\",\n \"0.56604296\",\n \"0.56401587\",\n \"0.5638404\",\n \"0.56222045\",\n \"0.5614877\",\n \"0.5614036\",\n \"0.5600347\",\n \"0.5595774\",\n \"0.5577155\",\n \"0.55717146\",\n \"0.55594057\",\n \"0.55581653\",\n \"0.55518633\",\n \"0.5548958\",\n \"0.5548455\",\n \"0.55350167\",\n \"0.5534366\",\n \"0.5529235\",\n \"0.551177\",\n \"0.5496822\",\n \"0.5494539\",\n \"0.5492613\",\n \"0.5483039\",\n \"0.5469218\",\n \"0.5468171\",\n \"0.54679537\",\n \"0.54669416\",\n \"0.54539996\",\n \"0.545248\",\n \"0.5450221\",\n \"0.54411936\",\n \"0.5439916\",\n \"0.5433537\",\n \"0.54230577\",\n \"0.54205126\",\n \"0.54155624\",\n \"0.5410685\",\n \"0.5398335\",\n \"0.5394103\",\n \"0.53911227\",\n \"0.5388845\",\n \"0.5386328\",\n \"0.53853667\",\n \"0.5376627\",\n \"0.53737193\",\n \"0.5367417\",\n \"0.5363824\",\n \"0.53552276\",\n \"0.53495127\",\n \"0.5343098\",\n \"0.533838\",\n \"0.5334769\",\n \"0.53335583\",\n \"0.5333456\",\n \"0.5319867\",\n \"0.5306104\",\n \"0.5301944\",\n \"0.5300739\",\n \"0.5299799\",\n \"0.52993965\",\n \"0.52922577\",\n \"0.5288702\",\n \"0.5283504\",\n \"0.5283024\",\n \"0.5280796\",\n \"0.5275275\",\n \"0.527482\",\n \"0.5273145\",\n \"0.52649635\",\n \"0.52635384\",\n \"0.5260161\",\n \"0.5260071\",\n \"0.52577615\",\n \"0.5254783\",\n \"0.52532935\",\n \"0.52527183\",\n \"0.5251287\",\n \"0.52444947\",\n \"0.524228\",\n \"0.5241531\",\n \"0.5236718\",\n \"0.5236086\",\n \"0.52356243\",\n \"0.5228005\",\n \"0.5226266\"\n]"},"document_score":{"kind":"string","value":"0.559048"},"document_rank":{"kind":"string","value":"23"}}},{"rowIdx":62,"cells":{"query":{"kind":"string","value":"Continue or regret option for fastfood restaurant."},"document":{"kind":"string","value":"function regretFastFoodRestaurantOption() {\n subTitle.innerText = \"Are you sure?\";\n firstButton.innerText = \"Yes, continue\";\n firstButton.onclick = function() {\n fastFoodRestaurantScene();\n }\n secondButton.innerText = \"No, go back\";\n secondButton.onclick = function() {\n startFunction();\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 handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function changeRestaurant() {\n if (selectedRestaurant < rRestaurants.length - 1) {\n const next = selectedRestaurant + 1;\n dispatch(setSelectedRestaurant(next));\n } else {\n dispatch(setSelectedRestaurant(0));\n }\n }","function option() {\n\tinquirer\n\t\t.prompt(\n\t\t\t{\n\t\t\t\tname: \"option\",\n\t\t\t\ttype: \"rawlist\",\n\t\t\t\tmessage: \"Would you like to continue to shop?\",\n\t\t\t\tchoices: [\"yes\", \"no\"]\n\t\t\t}\n\t\t)\n\t\t.then(function (answer) {\n\t\t\tif (answer.option === \"yes\") {\n\t\t\t\tdisplayProducts();\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log(\"Thank you for shopping with us at Bamazon, now get the hell out of here!\")\n\t\t\t\tconnection.end()\n\t\t\t}\n\t\t})\n}","async promptForFood(step) {\n if (step.result && step.result.value === 'yes') {\n\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\n {\n retryPrompt: 'Sorry, I do not understand or say cancel.'\n }\n );\n } else {\n return await step.next(-1);\n }\n}","function restartMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"restartSelection\",\n\t\tmessage: \"Would you like to continue shopping?\"\n\t}]).then(function(restartAnswer){\n\t\tif (restartAnswer.restartSelection === true) {\n\t\t\tcustomerMenu();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Thank you for shopping!\\nYour total is $\" + totalCost); \n\t\t}\n\t});\n}","function selectRestaurant() {\n let restaurant = document.getElementById(\"dropdown\").firstChild.value;\n let clear;\n if (restaurant === null) {\n return;\n } else if (Object.keys(order.items).length > 0) {\n //Confirm the if the user wants to proceed to clear the order\n clear = confirm(\"Would you like to clear the current order?\");\n if(!clear) {\n document.getElementById(\"dropdown\").firstChild.value = \"\";\n return;\n }\n }\n\n clearOrder(true);\n\n changeRestaurant(restaurant);\n\n}","generateRestaurant(){\n// we want the user to input the zipcode they want to search, the food type they want to eat\n// and the rating (1-5) \n// getRestaurants()\n\n\n}","function selectRestaurant(){\r\n\tlet select = document.getElementById(\"restaurant-select\");\r\n\tlet name = select.options[select.selectedIndex]\r\n\t//checks for undefined\r\n\tif (name !== undefined){\r\n\t\t//creates custom url that tells server what the currently selected restaurant is\r\n\t\tname= select.options[select.selectedIndex].text;\r\n\t\tname = name.replace(/\\s+/g, '-');\r\n\t\tlet request = new XMLHttpRequest();\r\n\t\r\n\t\trequest.onreadystatechange = function(){\t\r\n\t\t\tif(this.readyState == 4 && this.status == 200){ //if its reggie\r\n\t\t\t\tlet data = JSON.parse(request.responseText);\r\n\t\t\t\t//set menu[0] equal to the data from the server\r\n\t\t\t\tmenu[0] = data;\r\n\t\t\t\tconsole.log(menu);\r\n\t\t\t\tlet result = true;\r\n\t\r\n\t\t\t\t//If order is not empty, confirm the user wants to switch restaurants.\r\n\t\t\t\tif(!isEmpty(order)){\r\n\t\t\t\t\tresult = confirm(\"Are you sure you want to clear your order and switch menus?\");\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t//If switch is confirmed, load the new restaurant data\r\n\t\t\t\tif(result){\r\n\t\t\t\t\t//Get the selected index and set the current restaurant\r\n\t\t\t\t\tlet selected = select.options[select.selectedIndex].value;\r\n\t\t\t\t\tcurrentSelectIndex = select.selectedIndex;\r\n\t\t\t\t\t//In A2, current restaurant will be data you received from the server\r\n\t\t\t\t\tcurrentRestaurant = menu[0];\r\n\t\t\r\n\t\t\t\t\t//Update the page contents to contain the new menu\r\n\t\t\t\t\tif (currentRestaurant !== undefined){\r\n\t\t\t\t\t\tdocument.getElementById(\"left\").innerHTML = getCategoryHTML(currentRestaurant);\r\n\t\t\t\t\t\tdocument.getElementById(\"middle\").innerHTML = getMenuHTML(currentRestaurant);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Clear the current oder and update the order summary\r\n\t\t\t\t\torder = {};\r\n\t\t\t\t\tupdateOrder(currentRestaurant);\r\n\t\t\r\n\t\t\t\t\t//Update the restaurant info on the page\r\n\t\t\t\t\tlet info = document.getElementById(\"info\");\r\n\t\t\t\t\tinfo.innerHTML = currentRestaurant.name + \"
    Minimum Order: $\" + currentRestaurant.min_order + \"
    Delivery Fee: $\" + currentRestaurant.delivery_fee + \"

    \";\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\r\n\t\t\t\t\tlet select = document.getElementById(\"restaurant-select\");\r\n\t\t\t\t\tselect.selectedIndex = currentSelectIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//make request to server with custom url based on the currently selected restaurant\r\n\t\trequest.open(\"GET\",\"http://localhost:3000/menu-data/\"+name,true);\r\n\t\trequest.send();\r\n\t}\r\n}","function mainMenu() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"choice\",\n message: \"Would you like to place another order?\"\n }\n ]).then(function (answer) {//response is boolean only\n if (answer.choice) { //if true, run func\n startBamazon();\n } else {\n console.log(\"Thanks for shopping at Bamazon. See you soon!\")\n connection.end();\n }\n })\n}","function eatFood() {\n if (gameState.snakeStart === gameState.food) {\n gameState.snakeLength++;\n\n updateFoodCell(\"remove\", gameState.food);\n\n createFood();\n updateFoodCell(\"add\", gameState.food);\n gameState.score++;\n increaseSpeed();\n showScore();\n return true;\n }\n}","function startOver() {\n inquirer\n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to buy another product?\",\n default: true\n })\n .then(function(answer) {\n if (answer.continue) {\n purchaseChoice();\n }\n else {\n connection.end();\n }\n })\n}","async function makeFood(step) {\n try {\n if (step < brusselSprouts.length) {\n await addFood(brusselSprouts[step], \"#brusselSprouts\"); // Coloco o passo atual na fila\n makeFood(step + 1); // Dou o próximo passo na receita\n } else {\n throw \"End of recipe.\";\n }\n } catch (err) {\n console.log(err);\n }\n}","function reRun(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"reply\",\n message: \"Would you like to purchase another item?\"\n }\n ]).then(function(answer) {\n if(answer.reply) {\n buy();\n } \n else \n {\n console.log(\"Thanks for shopping Bamazon!\");\n connection.end();\n }\n });\n}","async displayFoodChoice(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.food) {\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n } else {\n const user = await this.userProfile.get(step.context, {});\n\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\n\n if (step.context.activity.text == 1) {\n user.food = \"European\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 2) {\n user.food = \"Chinese\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 3) {\n user.food = \"American\";\n await this.userProfile.set(step.context, user);\n }else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\n return await step.beginDialog(WHICH_FOOD);\n }\n\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n }\n return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","function continueShopping(){\n inquirer.prompt(\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Do you want to continue shopping?\",\n default: true\n }\n ).then(answers=>{\n if(answers.confirm){\n displayProducts();\n }else{\n connection.end();\n }\n });\n}","setSelectedRestaurant(state, resto) {\n state.selectedRestaurant = resto;\n }","function askAgain(){\n\tconsole.log(\"=============================================================\");\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: \"confirm\",\n\t\t\tname: \"confirm\",\n\t\t\tmessage: \"Would you like to do another task?\",\n\t\t\tdefault: false\n\t\t}\n\t]).then(function(again){\n\t\tif (again.confirm){\n\t\t\tsupervisorOptions();\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"All tasks are done.\");\n\t\t\t// Exits node program execution\n\t\t\tprocess.exit();\n\t\t}\n\t});\n}","function repeat() {\n inquirer\n .prompt({\n name: \"gotoMainMenu\",\n type: \"list\",\n message: \"Do you want to go back to main menu ?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function (choice) {\n if (choice.gotoMainMenu === \"Yes\") {\n start();\n }\n else {\n connection.end();\n }\n });\n}","function askAgain() {\n\n inquirer\n .prompt({\n name: \"nextSteps\",\n type: \"list\",\n message: \"Would you like to continue shopping?\",\n choices: [\"YES\", \"NO\"]\n })\n .then(function(answer) {\n \n if (answer.nextSteps.toUpperCase() === \"NO\") {\n\n console.log(chalk.yellow(\"\\nHope you had a pleasant experience. Come again soon!\\n\"));\n\n //turns off the connection from db\n connection.end();\n }\n\n else {\n\n \t//the first function is called again\n \treadProducts();\n\n\n } \n\n });\n}","function continuePrompt(){\n inquirer\n .prompt({\n name: \"repeat\",\n type: \"list\",\n message: \"Is there anything else you'd like to do?\",\n choices: [\n \"Yes\",\n \"No, I'm done.\"\n ]\n })\n .then(function(answer) {\n switch(answer.repeat){\n case \"Yes\":\n optionMenu();\n break;\n\n case \"No, I'm done.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","function runAgain(){\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function restartFunction() {\n inquirer.prompt([\n {\n name:\"action\",\n type:\"list\",\n message: \"Do you want to do another operation?\",\n choices: [\n \"Yes, please.\",\n \"No, I am fine thank you.\"\n ]\n }\n ]).then(function(answer) {\n if(answer.action === \"Yes, please.\") {\n menuOptions();\n } else {\n connection.end();\n }\n })\n}","function fightOrFlight() {\n var fightOrFlight = ask.question(\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\n\")\n if (fightOrFlight === \"f\") {\n fight();\n } else {\n run();\n }\n}","function startPrompt() {\n \n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Zohar's Bamazon! Wanna check it out?\",\n default: true\n\n }]).then(function(user){\n if (user.confirm === true){\n inventory();\n } else {\n console.log(\"FINE.. come back soon\")\n }\n });\n }","function endStart(){\n inquirer.prompt({\n name: \"confirm\",\n type: \"confirm\",\n message: \"continue shopping?\",\n // default: true\n }).then(function (data) {\n if (data.confirm === false)\n \n process.exit();\n else \n start();\n });\n}","function shopAgain(){\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"shop\",\n message: \"Would you like to buy another item?\",\n choices: [\"YES\", \"NO\"]\n }\n ]).then(function(answer) {\n if (answer.shop === \"YES\") {\n runBamazon();\n } else {\n console.log(\"Thank you for shopping with us, have a nice day!\");\n connection.end();\n }\n })\n}","eat() {\r\n let consume = this.food - 2\r\n if (consume > 1) {\r\n this.isHealthy = true\r\n return this.food = consume\r\n } if (consume <= 0) {\r\n this.isHealthy = false\r\n return this.food = 0\r\n }\r\n else if (consume <= 1) {\r\n return this.food = consume\r\n //alert(this.name + \" food supply reached to 0. It's time for a hunt\")\r\n //this.isHealthy = true\r\n }\r\n\r\n }","function superAsk(){\n\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"rawlist\",\n message: \"Greetings, what action would you like to perform today? (select by picking a #)\",\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\n name: \"action\", \n },\n\n ])\n .then(function(response) {\n\n switch (response.action) {\n case 'View Product Sales by Department':\n viewProdSales();\n break;\n case 'Create New Department':\n createDept();\n break;\n case 'Exit':\n process.exit();\n break;\n default:\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\n }\n });\n}","function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}","function runAgain2(){\n console.log('That item ID was not found in our records.');\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function handleNewMealRequest(response) {\n // Get a random meal from the random meals list\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\n var meal = RANDOM_MEALS[mealIndex];\n\n // Create speech output\n var speechOutput = \"Here's a suggestion: \" + meal;\n\n response.tellWithCard(speechOutput, \"MealRecommendations\", speechOutput);\n}","function again() {\n inquirer.prompt({\n name: \"shop\",\n type: \"list\",\n message: \"Would you like to keep shopping?\",\n choices: [\"Yes\", \"No\"]\n }).then(function(answer){\n if(answer.shop == \"Yes\"){\n list();\n } else {\n console.log(\"Please come back soon!\");\n connection.end();\n }\n })\n}","pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }","function restartPrompt(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Would you like to continue shopping?\".question,\n default: true\n }\n ]).then(function(input){\n // If customer wants to continue show products again\n if(input.confirm){\n showProducts();\n }\n else{\n console.log(\"Thank you for shopping with Bamazon!\".magenta);\n connection.end();\n }\n })\n}","function startOver() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: \"confirm\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to make another selection?\"\n\t\t}\n\t]).then(function(answer) {\n\t\tif (answer.confirm === true) {\n\t\t\tdisplayOptions();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Goodbye!\");\n\t\t}\n\t});\n}","function keepShopping(){\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"do you want to keep shopping for beers?\",\n name: \"confirm\"\n }\n ]).then(function(res){\n if (res.confirm){\n console.log(\"----------------\");\n showProducts();\n } else {\n console.log('Thank you for shopping in our online bar, happy drinking!');\n connection.end();\n }\n })\n}","function endRepeat() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"wish\",\n message: \"\\nDo you want to perform another operation?\",\n choices: [\"Yes\", \"No\"]\n }]).then( answer => {\n if (answer.wish === \"Yes\") {\n showMenu();\n } else {\n connection.end();\n }\n })\n}","function resetProductView(){\n \n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"action\",\n message: \"What would you like to do next?\",\n choices:[\"I want to checkout\", \"I want to continue shopping\"]\n }\n\n ]).then(function(answers){\n if(answers.action === \"I want to checkout\"){\n console.log(\"Good Bye, hope to see you again!\");\n }else if (answers.action === \"I want to continue shopping\"){\n customerview();\n }\n });\n\n}","function pickUp(index) {\n var pt = self[self.turn];\n var result = self.food[pt];\n if (!result) return; // Nothing to do\n if (result.length == 1) index = 0; // Unique\n if (index == null) { // Can't decide now...\n newState.pending = action;\n return;\n }\n reward += self.food[pt][index]; // Take the food\n newState.food[pt] = null; // Food is now gone\n }","function another() {\n inquirer\n .prompt(\n {\n name: 'another',\n type: 'confirm',\n message: 'Would you like to continue shopping?'\n },\n\n )\n .then(function (answer) {\n if (answer.another === true) {\n start();\n } else {\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\n connection.end();\n }\n });\n\n}","function anotherAction() {\n\n inquirer\n .prompt([\n {\n name: \"confirm\",\n type: \"confirm\",\n message: \"Would you like to complete another action?\"\n }\n ])\n .then(function (answer) {\n if (answer.confirm == true) {\n showMenu();\n }\n else {\n console.log(\"Goodbye.\");\n connection.end();\n }\n\n });\n\n}","function systemSelection(option){\n\tvar check = option; \n\tif(vehicleFuel<=0){\n\t\tgameOverLose();\n\t}\n\n\telse{\n\n\n\tif(currentLocation===check){\n\t\t\tgamePrompt(\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\",beginTravel);\n\t\t\t}\n\n\telse{\n\t\n\t\t\tif(check.toLowerCase() === \"e\"){\n\t\t\t\tvehicleFuel=(vehicleFuel-10);\n\t\t\t\tcurrentLocation=\"e\" ;\n\t\t\t\tgamePrompt(\"Flying to Earth...You used 10 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToEarth);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"m\"){\n\t\t\t//need to add a 'visited' conditional\n\t\t\tvehicleFuel=(vehicleFuel-20);\n\t\t\tcurrentLocation=\"m\" ;\n\t\t\t\tgamePrompt(\"Flying to Mesnides...You used 20 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\", goToMesnides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"l\"){\n\t\t\tvehicleFuel=(vehicleFuel-50);\n\t\t\tcurrentLocation=\"l\" ;\n\t\t\tgamePrompt(\"Flying to Laplides...You used 50 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToLaplides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"k\"){\n\t\t\tvehicleFuel=(vehicleFuel-120);\n\t\t\tcurrentLocation=\"k\" ;\n\t\t\tgamePrompt(\"Flying to Kiyturn...You used 120 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToKiyturn);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"a\"){\n\t\t\tvehicleFuel=(vehicleFuel-25);\n\t\t\tcurrentLocation=\"a\";\n\t\t\tgamePrompt(\"Flying to Aenides...You used 25 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToAenides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"c\"){\n\t\t\tvehicleFuel=(vehicleFuel-200);\n\t\t\tcurrentLocation=\"c\" ;\n\t\t\tgamePrompt(\"Flying to Cramuthea...You used 200 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToCramuthea);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"s\"){\n\t\t\tvehicleFuel=(vehicleFuel-400);\n\t\t\tcurrentLocation=\"s\" ;\n\t\t\tgamePrompt(\"Flying to Smeon T9Q...You used 400 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToSmeon);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"g\"){\n\t\t\tvehicleFuel=(vehicleFuel-85);\n\t\t\tcurrentLocation=\"g\" ;\n\t\t\tgamePrompt(\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToGleshan);\n\t\t\t}\n\t\telse{\n\t\t\tgamePrompt(\"Sorry Captain, I did not understand you. I will return you to the main menu\",beginTravel);\n\t\t}\n\t}\n\t}\n}","eat () {\n if (this.food === 0) {\n this.isHealthy = false;\n\n } else {\n this.food -= 1;\n }\n }","function chap19(){\n var wantChicken = false;\n var foodArray = [\"Salmon\", \"Tilapia\", \"Tuna\", \"Lobster\"];\n var customerOrder = prompt(\"What would you like?\", \"Look the menu\");\n for (var i = 0; i <= 3; i++) {\n if (customerOrder === foodArray[i]) {\n wantChicken = true;\n alert(\"We have it on the menu!\");\n break;\n }\n }\n if(wantChicken===false) {\n\t\talert(\"We don't serve chicken here, sorry.\");\n\t}\n}","function start() {\n inquirer.prompt([{\n name: \"entrance\",\n message: \"Would you like to shop with us today?\",\n type: \"list\",\n choices: [\"Yes\", \"No\"]\n }]).then(function(answer) {\n // if yes, proceed to shop menu\n if (answer.entrance === \"Yes\") {\n menu();\n } else {\n // if no, end node cli \n console.log(\"---------------------------------------\");\n console.log(\"No?!?!?! What do you mean no!?!?!?!?!?\");\n console.log(\"---------------------------------------\");\n connection.destroy();\n return;\n }\n });\n}","function start() {\n inquirer.prompt({\n name: \"select\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\"VIEW SALES\", \"CREATE NEW DEPARTMENT\", \"DELETE DEPARTMENT\", \"EXIT\"]\n }).then(function (answers) {\n if (answers.select.toUpperCase() === \"VIEW SALES\") {\n viewSales();\n } else if (answers.select.toUpperCase() === \"CREATE NEW DEPARTMENT\") {\n newDepartment();\n } else if (answers.select.toUpperCase() === \"DELETE DEPARTMENT\") {\n deleteDepartment();\n } else {\n // Selecting \"EXIT\" just takes the user here\n connection.end();\n }\n });\n}","function start() {\n inquirer\n .prompt({\n name: \"choice\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory Less than 30 items in stock\",\n \"Update current Items Stock Quantity\",\n \"Add New Product to Current Dept\"\n ]\n })\n .then(function(answer) {\n switch (answer.choice) {\n case \"View Products for Sale\":\n viewAll();\n break;\n case \"View Low Inventory Less than 30 items in stock\":\n viewLowInv();\n break;\n case \"Update current Items Stock Quantity\":\n // viewAll();\n addToInv();\n break;\n case \"Add New Product to Current Dept\":\n addNewProduct();\n break;\n }\n });\n}","findCraving(type) {\n \n // Make sure a craving has been selected - if not alert user and abort.\n if (app.currentCraving === 0) {\n app.showAlert(\"No craving\", \"Please select a craving to continue!\");\n return;\n }\n // Opens the loading screen\n app.showLoadingScreen();\n // Builds our call url.\n // Base URL // Current LAT //Current Lon // CurrentCraving \n var callUrl = `${ apiUrls.zomatoBase }/search?lat=${ app.latLong[0] }&lon=${ app.latLong[1] }&cuisines=${ app.currentCraving }&radius=3000`;\n \n // See if the user opted to hide restaurants they've visited.\n var hidePrev = $(\"#chk-hide-previous\").is(\":checked\");\n \n // Zero out our array.\n app.restaurantResults.length = 0;\n\n // Performs the API call.\n app.callApi(\"get\", callUrl, apiKeys.zomato.header).then((response) => {\n // Loops through our responses\n for (var i = 0; i < response.restaurants.length; i++) {\n // Gets the current restaurant.\n var rest = response.restaurants[i].restaurant;\n // Creates an object\n var newRestaurant = new Restaurant(rest.id, rest.name, rest.location.address, rest.location.latitude, rest.location.longitude,\n rest.thumb, rest.price_range, rest.average_cost_for_two, rest.featured_image, rest.user_rating.rating_text, rest.user_rating.aggregate_rating);\n // Gets the distance as a float\n newRestaurant.distance = parseFloat(distance(app.latLong[0], app.latLong[1], newRestaurant.lat, newRestaurant.lon));\n // Assume we can push it into our results array.\n var canPush = true;\n // If we want to hide it\n if (hidePrev) {\n // Make sure we have a list of restaurants the user has been to\n if (app.currentUser.restaurants) {\n // Loop through the users' visited restaurants\n for (var j = 0; j < app.currentUser.restaurants.length; j++) {\n // Compare it with our current working restaurant\n if (newRestaurant.id === app.currentUser.restaurants[j]) {\n // If it's there, flag we cannot push it to the array.\n canPush = false;\n }\n }\n }\n }\n if (canPush) {\n // If we made it, push it into our results array.\n app.restaurantResults.push(newRestaurant);\n }\n };\n // if the user wanted\n if (type === \"fast\") {\n app.restaurantResults.sort(app.sortByDistance);\n } else {\n app.restaurantResults.sort(app.sortByQuality);\n }\n // Populate our results screen\n app.populateResults();\n // Hide the loading overlay\n app.hideLoadingScreen();\n // Fade into our results screen\n app.switchScreens(\"#craving-select-screen\", \"#results-screen\", true);\n });\n }","function askIfDone() {\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Would you like to return to the main menu?\",\n name: \"decision\"\n }\n ]).then(function(response){\n if(response.decision === true) {\n menu();\n }\n else {\n console.log(\"\\nThank you. Goodbye.\");\n console.log(\"\\n============================================\");\n connection.end();\n }\n });\n}","function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\n if(userInput === \"1\"){\n \n randomDestination = yesOrNo(destination,destination);\n \n }\n else if (userInput === \"2\") {\n \n randomRestaurant = yesOrNo(restaurant,restaurant);\n }\n else if (userInput === \"3\") {\n \n randomTravelType = yesOrNo(transportation, transportation);\n }\n else if (userInput === \"4\") {\n \n randomEntertainment = yesOrNo(entertainment,entertainment);\n }\n}","function start(){\n inquirer.prompt({\n type: \"list\",\n message: \"What would you like to view?\",\n name: \"answer\",\n choices: [\"All inventory\", \"Electronics\", \"Furniture\", \"Apparel\", \"Camping/Outdoors\", \"Tools\", \"Exit\"]\n }).then(function(data){\n if(data.answer === \"Exit\"){\n console.log(\"\\nThanks for shopping with Bamazon!\\n\".green);\n connection.end();\n }\n else if(data.answer === \"All inventory\"){\n query = \"SELECT * FROM products\"\n showItems();\n }\n else{\n query = \"SELECT * FROM products WHERE department = \" + \"'\" + data.answer.toLowerCase() + \"'\"\n showItems();\n }\n \n }) \n}","function callNextActionOrExit(answer) {\n if (answer.userSelection === \"View Products for Sale\") {\n console.log(\"You want to view products\");\n viewProducts();\n } else if (answer.userSelection === \"View Low Inventory\") {\n console.log(\"You want to view inventory\")\n viewLowInventory();\n } else if (answer.userSelection === \"Add to Inventory\") {\n console.log(\"You want to add to inventory\")\n addToInventory();\n } else if (answer.userSelection === \"Add New Product\") {\n console.log(\"You want to add a new product\")\n getNewItem();\n } else {\n database.endConnection();\n }\n}","function optionMenu(){\n inquirer\n .prompt({\n name: \"menu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Nothing, I've changed my mind.\"\n ]\n })\n .then(function(answer) {\n switch(answer.menu){\n case \"View Products for Sale\":\n showProducts();\n\n // continuePrompt is delayed to allow showProducts to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n\n // continuePrompt is delayed to allow lowInventory to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"Add to Inventory\":\n showProducts()\n\n // addInventory is delayed to allow lowInventory to be completed\n setTimeout(addInventory,300);\n break;\n\n case \"Add New Product\":\n newProduct();\n break;\n\n case \"Nothing, I've changed my mind.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","function start() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All departments\",\n \"View All employees\",\n \"View All roles\",\n \"Add roles\",\n \"Add departments\",\n \"Add employees\",\n \"Delete roles\",\n \"Delete departments\",\n \"Exit\"\n ]\n })\n .then(function(res) { \n switch (res.action) {\n case \"View departments\":\n viewDep();\n break;\n \n case \"View All employees\":\n viewEmp();\n break;\n \n case \"View All roles\":\n viewRole();\n break;\n \n case \"Add roles\":\n addRole();\n break;\n \n case \"Add departments\":\n addDep();\n break;\n\n case \"Add employees\":\n addEmp();\n break;\n\n case \"Update employee roles\":\n updateEmpRole();\n break;\n \n case \"Delete roles\":\n deleteRole();\n break;\n \n case \"Delete departments\":\n deleteDep();\n break;\n \n case \"Exit\":\n end();\n break\n }\n });\n }","async eatEnergy() {\n await this.updateAvailableEat();\n let response = await this.sendRequest(\"foodSystem.php\", { \"whatneed\": \"eatFrmHldnk\" });\n debug(\"Eating...\", response);\n return response;\n }","function doChoice(e) {\n if (this.selectedIndex>0) {\n var c = favlist[this.options[this.selectedIndex].value];\n\t\tvar fail = false;\n if (c) {\n var i;\n setNotice('Loading fav ...');\n for (i=1;i<=c.length;i++) {\n fail |= setState(i,c[i-1]);\n }\n for (;i<=11;i++) {\n clearState(i);\n }\n }\n this.selectedIndex = 0;\n\t\tif (fail)\n\t\t\taddNotice('Item(s) not found!');\n\t\telse\n\t\t\taddNotice('Fav loaded!');\n }\n}","function initSelectRestaurant(restaurants, searchTerm){\n $(function(){\n\n var getRestaurant = window.LE.restaurants.getRestaurant\n\n userdata.restaurant = null;\n\n //dummy var\n var isSearch = null;\n\n // prepare template\n var source = $(\"#restaurant-dropdown-template\").html();\n var template = Handlebars.compile(source);\n\n html = template(restaurants); \n\n // populate dropdown for restaurants\n var renderingRestaurants = $('#render-restaurants').after(html);\n\n // render confirmation of the search term so the user remembers what they were looking for\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\n\n // when the restaurant changes, we need to display rate and other data\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\n });\n \n $(\"#select-restaurant-continue-button\").on(\"click\", function(){\n // this is the restaurant id to render later\n var selectedVal = $(\"#restaurant\").val();\n\n if(_debug){ console.log(selectedVal); }\n\n if(selectedVal == \"\"){\n document.getElementById(\"restaurant-alert\").innerHTML = \"Required.\";\n }else{\n\n // cleanup old event handlers before leaving home context\n destroyHome();\n\n userdata.currentRestaurant = selectedVal;\n initSelectItem(selectedVal);\n // ease scroll to top of next view\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n });\n });\n}","function continuePrompt(){\n inquirer.prompt({\n type: \"confirm\",\n name: \"continue\",\n message: \"Continue....?\",\n }).then((answer) => {\n if (answer.continue){\n showMainMenu();\n } else{\n exit();\n }\n })\n}","function start (p){\n\tresetting=true;\n\tfoodCounter=0;\n\tdeleteAllFood();\n\treset(p);\n}","function promptAction() {\n inquirer.prompt([{\n type: 'list',\n message: 'Select from list below what action you would like to complete.',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\n name: \"action\"\n }, ]).then(function(selection) {\n switch (selection.action) {\n case 'View Products for Sale':\n viewAllProducts();\n break;\n\n case 'View Low Inventory':\n lowInventoryList();\n break;\n\n case 'Add to Inventory':\n addInventory();\n break;\n\n case 'Add New Product':\n addNewProduct();\n break;\n }\n }).catch(function(error) {\n throw error;\n });\n}","function nextAction() {\n\tinquirer.prompt({\n\t\tmessage: \"What would you like to do next?\",\n\t\ttype: \"list\",\n\t\tname: \"nextAction\",\n\t\tchoices: [\"Add More Items\", \"Remove Items\", \"Alter Item Order Amount\", \"Survey Cart\", \"Checkout\"]\n\t})\n\t\t.then(function (actionAnswer) {\n\t\t\tswitch (actionAnswer.nextAction) {\n\t\t\t\tcase \"Add More Items\":\n\t\t\t\t\t// go to the start function\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Remove Items\":\n\t\t\t\t\t// go to the removal function\n\t\t\t\t\tremoveItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Checkout\":\n\t\t\t\t\t// go to the checkout tree;\n\t\t\t\t\tverifyCheckout();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Alter Item Order Amount\":\n\t\t\t\t\t// go to the function that alters the shopping cart qty\n\t\t\t\t\talterItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Survey Cart\":\n\t\t\t\t\t// look at the cart\n\t\t\t\t\tcheckoutFunction();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: console.log(\"how did you get here?\")\n\t\t\t}\n\t\t})\n}","function continueShopping() {\n inquire.prompt([{\n message: \"Checkout or Continue Shopping?\",\n type: \"list\",\n name: \"continue\",\n choices: [\"Continue\", \"Go to checkout\"]\n }]).then(function (ans) {\n if (ans.continue === \"Continue\") {\n console.log(\" Items Added to Cart!\");\n shoppingCart();\n } else if (ans.continue === \"Go to checkout\") {\n checkOut(itemCart, cartQuant);\n }\n });\n}","function regretsPrompt (res) {\n\tinquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"What would you like to do?\",\n\t\t\t\tchoices: [\"Change Quantity\", \"Start Over\"],\n\t\t\t\tname: \"selection\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tif (inqRes.selection == \"Change Quantity\"){\n\t\t\t\tquantityPrompt(res);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplayAllProducts();\t\n\t\t\t}\n\n\n\t\t});//ends then\n}","function noInventoryOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Do you want to choose a new item or quit?\",\n choices: [\"NEW-ITEM\", \"QUIT\"],\n name: \"startAgain\"\n }\n ])\n .then(function(answer6) {\n if (answer6.startAgain == \"NEW-ITEM\") {\n displayProducts(); \n }\n if (answer6.startAgain == \"QUIT\") {\n console.log(\"Thank you. Good-bye!\");\n connection.end();\n }\n });\n}","function contShopping() {\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Do you want to continue shopping?\",\n name: \"id\",\n\n }\n\n ])\n .then(function (cont) {\n\n if (cont.id === true) {\n readProducts();\n }\n else {\n console.log(\"Have a good day!\");\n connection.end();\n }\n })\n}","function submitClicked () { \n let foodInput = $('#food').val();\n if(foodInput == \"\"){\n $('.noFoodItem').text(\"please enter a food item in the search bar\").css('color','red');\n return; \n }\n $('.noFoodItem').text('');\n food = $(\"#food\").val()\n initAutocomplete();\n changePage();\n}","function menuoption(){\n inquirer.prompt({\n type: \"list\",\n name : \"menu\",\n message : \"What do you want to see ?\",\n choices : [\"\\n\",\"View Products for Sale\",\"View Low Inventory\",\"Add to Inventory\",\"Add New Product\"]\n\n }).then(function(answer){\n // var update;\n // var addnew;\n console.log(answer.menu);\n //if else option to compare user input and call the required function\n if(answer.menu == \"View Products for Sale\" ){\n showitem();\n }else if(answer.menu == \"View Low Inventory\"){\n \n lowinventory();\n }else if(answer.menu == \"Add to Inventory\"){\n updateinventory();\n // updateonecolumn(itemidinput);\n }else if(answer.menu == \"Add New Product\"){\n addnewproduct();\n }\n \n });\n }","function shop() {\n\n inquirer.prompt([{\n name: \"menu\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Update Inventory\", \"Add New Product\"]\n }]).then(function (answer) {\n\n switch (answer.menu) {\n case \"View Products for Sale\":\n forSale();\n break;\n\n case \"View Low Inventory\":\n lowStock();\n break;\n\n case \"Add New Product\":\n addThing();\n break;\n\n case \"Update Inventory\":\n moreStuff();\n break;\n }\n });\n}","function ADMIN() {\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\n flights.sort((a, b) => a.id - b.id);\n for (let i = 0; i < flights.length; i++) {\n flights[i].display = true;\n }\n let ediDel;\n do {\n ediDel = prompt(\n \"Te encuentras en la funci\\u00F3n de ADMINISTRADOR. Indica la funci\\u00F3n a la que quieres acceder: EDIT, DELETE.\",\n \"EDIT,DELETE\"\n );\n salida(ediDel, ADMIN);\n ediDel = ediDel.toUpperCase();\n } while (ediDel !== \"EDIT\" && ediDel !== \"DELETE\");\n\n //JUMP TO NEXT FUNCITON\n if (ediDel === \"EDIT\") {\n EDIT();\n } else if (ediDel === \"DELETE\") {\n DELETE();\n } else {\n alert(\"No te he entendido\");\n ADMIN();\n }\n}","function buyMore() {\n\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want to buy another product?\"\n }\n ]).then(function (answers) {\n if (answers.continue) {\n defId = null;\n defQty = 1;\n dispAll();\n } else {\n connection.end();\n }\n });\n\n}","function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function","function askAgain() {\n inquirer.prompt({\n name: \"choice\",\n type: \"rawlist\",\n message: \"What you like to place another order?\",\n choices: [\"YES\", \"NO\"]\n })\n .then(function (answer) {\n if (answer.choice.toUpperCase() === \"YES\") {\n ask();\n } else {\n console.log(\"Thank you for shopping at Bamazon.\");\n connection.end();\n }\n })\n\n}","onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }","function fightOrRun() {\n var choices = [\"Run\", \"Fight\"];\n var askPlayer = parseInt(readline.keyInSelect(choices, \"Do you want to fight like a shark or run like a shrimp???\\nThe next monster might be scarier.\\n \\n What are you going to do? Press 1 to run...Press 2 to fight.\"));\n if (choices === 1) {\n //call the function for deciding to run \n run();\n } else {\n //call the function for deciding to fight\n console.log('You decided to fight, bring it on!!.');\n fight();\n }\n }","function OrderAgain(){ \r\n\tinquirer.prompt([{ \r\n\t\ttype: 'confirm', \r\n\t\tname: 'choice', \r\n\t\tmessage: 'Would you like to place another order?' \r\n\t}]).then(function(answer){ \r\n\t\tif(answer.choice){ \r\n\t\t\tplaceOrder(); \r\n\t\t} \r\n\t\telse{ \r\n\t\t\tconsole.log('Thank you for shopping at the Bamazon Mercantile!'); \r\n\t\t\tconnection.end(); \r\n\t\t} \r\n\t}) \r\n}","function eat(food)\n\t\t{\n\t\t\t// Add the food's HTML element to a queue of uneaten food elements.\n\t\t\tuneatenFood.push(food.element);\n\n\t\t\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\n\t\t\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\n\t\t\t// removes the food element.\n\t\t\tFish.swimTo(\n\t\t\t\tfood.position,\n\t\t\t\tFish.PathType.AppendPath,\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\tlet eatenFood = uneatenFood.shift();\n\t\t\t\t\teatenFood.parentNode.removeChild(eatenFood);\n\t\t\t\t\tgrow();\n\t\t\t\t});\n\t\t} // end eat()","function restaurantCheck (post) {\n\n\t\tvar zomatoKey = \"8eb908d1e6003b1c7643c94c50ecd283\";\n\n\t\t// J\n\t\t// Q\n\t\t// U\n\t\t// E\n\t\t// R\n\t\t// Y\n\t\t$.ajax ({\n\t\t\tmethod: \"GET\",\n\t\t\turl: \"https://developers.zomato.com/api/v2.1/search?apikey=\"+zomatoKey+\"&count=500&lat=42.4074843&lon=-71.11902320000002&radius=5000\",\n\t\t}).done(function (data) {\n\t\t\tdata.restaurants.forEach(function(element,index) {\n\t\t\t\tif (post.includes(element.restaurant.name)) {\n\t\t\t\t\tfood_list.push(element.restaurant.name);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}","function mainOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View\",\n \"Add\",\n \"Delete\",\n \"Update\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n\n case \"View\":\n viewChoice();\n break;\n\n case \"Add\":\n addChoice();\n break;\n\n case \"Delete\":\n deleteChoice()\n break;\n\n case \"Update\":\n updateChoice()\n break;\n\n\n }\n });\n\n}","function anythingElse() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Anything Else?\",\n name: \"choice\"\n }\n ])\n .then(res => {\n if (res.choice) {\n displayProducts();\n } else {\n console.log(\"Thank You!\");\n console.log(`Total: $${total}`);\n connection.end();\n }\n });\n}","function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}","async promptForMenu(step) {\n return step.prompt(MENU_PROMPT, {\n choices: [\"Donate Food\", \"Find a Food Bank\", \"Contact Food Bank\"],\n prompt: \"Do you have food to donate, do you need food, or are you contacting a food bank?\",\n retryPrompt: \"I'm sorry, that wasn't a valid response. Please select one of the options\"\n });\n }","function checkFood(food){\n\tvar food = [\"chicken\", \"beef\", \"fish\", \"lamb\", \"veal\"];\n\n\t//The first term starts with 0\n\n\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\n\t\talert(\"You are considered as meat\");\n\t}else{\n\t\talert(\"You may or may not be considered as meat\");\n\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \"You are considered as meat\"\n\t//if something else is entered, then a popup will appear saying \"you may or may not be considered as meat\"\t\n\t}\n}","function startPrompt() {\n inquirer\n .prompt([\n {\n name: \"startOrStop\",\n type: \"list\",\n message: \"Would you like to make a purchase?\",\n choices: [\"Yes\", \"No\", \"Show me the choices again\"]\n }\n ])\n .then(function (answer) {\n if (answer.startOrStop === \"No\") {\n console.log(\"Goodbye!\");\n connection.end();\n } else if (answer.startOrStop === \"Show me the choices again\") {\n start();\n } else {\n buyPrompt();\n }\n\n });\n}","function foodClickHandler(foodsitem) {\n setFood(foodsitem);\n }","function keepShopping() {\n inquirer.prompt([{\n type: \"confirm\",\n name: \"shopping\",\n message: \"Would you like to keep shopping?\",\n }]).then(function (answer) {\n if (answer) {\n chooseShop();\n } else {\n // End the database connection\n connection.end();\n }\n })\n}","async captureFood(step) {\n const user = await this.userProfile.get(step.context, {});\n\n // Perform a call to LUIS to retrieve results for the user's message.\n const results = await this.luisRecognizer.recognize(step.context);\n\n // Since the LuisRecognizer was configured to include the raw results, get the `topScoringIntent` as specified by LUIS.\n const topIntent = results.luisResult.topScoringIntent;\n const topEntity = results.luisResult.entities[0];\n\n if (step.result !== -1) {\n\n if (topIntent.intent == 'ChooseTypeOfFood') {\n user.food = topEntity.entity;\n await this.userProfile.set(step.context, user);\n\n //await step.context.sendActivity(`Entity: ${topEntity.entity}`);\n await step.context.sendActivity(`I'm going to find the restaurant to eat : ${topEntity.entity}`);\n //return await step.next();\n }\n else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand or say cancel.`);\n return await step.replaceDialog(WHICH_FOOD);\n }\n\n // await step.context.sendActivity(`I will remember that you want this kind of food : ${ step.result } `);\n } else {// si l'user ne sait pas quelle genre de food il veut\n\n const { ActionTypes, ActivityTypes, CardFactory } = require('botbuilder');\n\n const reply = { type: ActivityTypes.Message };\n\n // // build buttons to display.\n const buttons = [\n { type: ActionTypes.ImBack, title: '1. European 🍝 🍲', value: '1' },\n { type: ActionTypes.ImBack, title: '2. Chinese 🍜 🍚', value: '2' },\n { type: ActionTypes.ImBack, title: '3. American 🍔 🍟', value: '3' }\n ];\n\n // // construct hero card.\n const card = CardFactory.heroCard('', undefined,\n buttons, { text: 'What type of restaurant do you want ?' });\n\n // // add card to Activity.\n reply.attachments = [card];\n\n // // Send hero card to the user.\n await step.context.sendActivity(reply);\n\n }\n //return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","function displayRestaurant() {\n restaurantDrop.on(\"click\", function (event) {\n if ($(event.target).attr(\"class\") === \"yes\") {\n console.log(\"hi\");\n $(\".body-container\").prepend($(\".location\").show());\n restaurantOption.hide();\n }\n if ($(event.target).attr(\"class\") === \"no\") {\n $(\".final-date\").removeClass(\"hide\");\n restaurantOption.hide();\n viewDate.append($(\".movie-display\"));\n $(\".movie-display\").show();\n restaurantStorage.push(\"\")\n localStorage.setItem(\"Restaurants\", JSON.stringify(restaurantStorage))\n }\n });\n}","function start() {\n inquirer\n .prompt({\n name: \"selectOptions\",\n type: \"list\",\n message: \"Choose from the list of available options...\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"View most expensive Inventory\"]\n })\n .then(function (answer) {\n\n // get the user choice and route to appropriate function.\n switch (answer.selectOptions) {\n case \"View Products for Sale\":\n listAllProducts();\n break;\n\n case \"View Low Inventory\":\n listLowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addNewItemToInventory();\n break;\n\n case \"View most expensive Inventory\":\n listExpensiveItems();\n break;\n }\n\n //\n\n });\n}","function nextPrompt(){\n inquirer.prompt([\n {\n name: \"status\",\n type: \"list\",\n message: \"Buy more?\",\n choices: [\"Buy more\", \"Exit\"]\n }\n ]).then(answer => {\n if(answer.status === \"Buy more\"){\n displayInventory();\n promptBuy();\n } else{\n console.log(\"Thank you. Goodbye.\");\n connection.end();\n }\n })\n}","function foodRunnerSelector() {\n \n if (document.getElementById(\"foodRunnerYes\").checked == true) {\n\tdoTipFoodRunner = true;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"Food Runner will be tipped out\";}\n else { \n\tdoTipFoodRunner = false;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"No tip out for Food Runner\"; \n }\n return doTipFoodRunner\n}","function setFoodType(type) {\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\n if(type === 'kebab') {\n $scope.hammered = 'chosen-emotion';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'cafe') {\n $scope.hammered = '';\n $scope.hungover = 'chosen-emotion';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'fastfood') {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = 'chosen-emotion';\n $scope.hardworking = '';\n } else {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = 'chosen-emotion';\n }\n vm.foodType = type;\n }","function askToContinue() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tmessage: 'Do you want to play again?',\n\t\t\t\t\tname: 'confirm',\n\t\t\t\t\tdefault: true\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\tif (response.confirm === true) {\n\t\t\t\t\tstartGame();\n\t\t\t\t} \n\t\t\t});\n\t}","function goPrompt() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What action would you like to do?\",\n name: \"choice\",\n choices: [\n \"Check Departments\",\n \"Check Roles\",\n \"Check Employees\",\n \"Plus Employee\",\n \"Plus Role\",\n \"Plus Department\"\n ]\n }\n // switch replaces else if...selects parameter and javascript will look for the correct function\n ]).then(function (data) {\n switch (data.choice) {\n case \"Check Departments\":\n viewDepartments()\n break;\n case \"Check Roles\":\n viewRoles()\n break;\n case \"Check Employees\":\n viewEmployees()\n break;\n case \"Plus Employee\":\n plusEmployees()\n break;\n case \"Plus Department\":\n plusDepartment()\n break;\n case \"Plus Role\":\n plusRole()\n break;\n }\n })\n}","function userSearch() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do:\",\n choices: [\"View product sales by Department\", \"Create new department\", \"Exit Supervisor Mode\"]\n }\n\n ]).then(function (manager) {\n\n switch (manager.choice) {\n case \"View product sales by Department\":\n viewDepartments();\n break;\n \n case \"Create new department\":\n addNewDepartment();\n break;\n\n case \"Exit Supervisor Mode\":\n console.log(\"\\nSee ya later!\\n\");\n connection.end ();\n break;\n }\n\n });\n\n}","function orderAgain() {\n console.log(\"------\");\n inquirer.prompt({\n name: \"confirm\",\n type: \"list\",\n message: \"Would you like start over and view what's in stock again?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(answer) {\n if (answer.confirm === \"Yes\") {\n displayStock();\n }\n\n else {\n console.log(\"------\")\n console.log(\"Thanks for shopping on Bamazon!\")\n connection.end();\n }\n })\n }","function randomFood() {\n\n\t\tif (Math.random() > 0.5) {\n\t\t\treturn 'pizza';\n\t\t} \n\t\treturn 'ice cream';\n\t}","function frostingChoice(item) {\n frostingChosen = true;\n if (typeof preFrostingChoice !== 'undefined'){\n preFrostingChoice.style.backgroundColor = \"white\";\n }\n\n item.style.backgroundColor = \"lightgray\";\n preFrostingChoice = item;\n\n checkPrice();\n}","function pizzaFlavor() {\n // Logs menu to console after each action\n console.log(\"\");\n console.log(\"Please choose your actions:\");\n console.log(\"\");\n console.log(\"1 - List all the pizza flavors\");\n console.log(\"2 - Add a new pizza flavor\");\n console.log(\"3 - Remove a pizza flavor\");\n console.log(\"4 - Exit this program\");\n console.log(\"\");\n\n // Variable that stores menu option\n let x = Number(readlineSync.question(\"Enter your action's number: \"));\n\n // Logs list of pizza flavors to console when menu option 1 is chosen and returns to menu\n if (x === 1) {\n console.log(flavs);\n pizzaFlavor();\n }\n\n // Enters do while loop to keep asking for new pizza flavor input\n if (x === 2) {\n // Do while loop breaks when \"X\" is entered and returns to menu\n do {\n flavs.push(readlineSync.question(\"Please enter pizza flavor. \"));\n console.log(\"Enter X to return or press enter to add another pizza flavor.\");\n } while (readlineSync.question() != \"X\")\n pizzaFlavor();\n }\n\n // Will remove array item when menu option 3 is chosen\n if (x === 3) {\n // Variable that stores array item to be removed\n let rm = readlineSync.question(\"Please enter pizza flavor number to remove. \");\n\n // If statement to check is input matches an item in array\n if (flavs.includes(rm)) {\n // If item exists the given item will be removed from the array and returns to menu\n flavs.splice(flavs.indexOf(rm), 1);\n pizzaFlavor();\n } else {\n // If item does not exist a message will be logged to console and returns to menu\n console.log(`Pizza flavors does not include ${rm}.`);\n pizzaFlavor();\n }\n\n }\n\n // If menu option 4 is chosen a message will be returned before exiting\n if (x === 4) {\n return console.log(\"Goodbye\");\n }\n}"],"string":"[\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function changeRestaurant() {\\n if (selectedRestaurant < rRestaurants.length - 1) {\\n const next = selectedRestaurant + 1;\\n dispatch(setSelectedRestaurant(next));\\n } else {\\n dispatch(setSelectedRestaurant(0));\\n }\\n }\",\n \"function option() {\\n\\tinquirer\\n\\t\\t.prompt(\\n\\t\\t\\t{\\n\\t\\t\\t\\tname: \\\"option\\\",\\n\\t\\t\\t\\ttype: \\\"rawlist\\\",\\n\\t\\t\\t\\tmessage: \\\"Would you like to continue to shop?\\\",\\n\\t\\t\\t\\tchoices: [\\\"yes\\\", \\\"no\\\"]\\n\\t\\t\\t}\\n\\t\\t)\\n\\t\\t.then(function (answer) {\\n\\t\\t\\tif (answer.option === \\\"yes\\\") {\\n\\t\\t\\t\\tdisplayProducts();\\n\\t\\t\\t}\\n\\n\\t\\t\\telse {\\n\\t\\t\\t\\tconsole.log(\\\"Thank you for shopping with us at Bamazon, now get the hell out of here!\\\")\\n\\t\\t\\t\\tconnection.end()\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"async promptForFood(step) {\\n if (step.result && step.result.value === 'yes') {\\n\\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\\n {\\n retryPrompt: 'Sorry, I do not understand or say cancel.'\\n }\\n );\\n } else {\\n return await step.next(-1);\\n }\\n}\",\n \"function restartMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tname: \\\"restartSelection\\\",\\n\\t\\tmessage: \\\"Would you like to continue shopping?\\\"\\n\\t}]).then(function(restartAnswer){\\n\\t\\tif (restartAnswer.restartSelection === true) {\\n\\t\\t\\tcustomerMenu();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Thank you for shopping!\\\\nYour total is $\\\" + totalCost); \\n\\t\\t}\\n\\t});\\n}\",\n \"function selectRestaurant() {\\n let restaurant = document.getElementById(\\\"dropdown\\\").firstChild.value;\\n let clear;\\n if (restaurant === null) {\\n return;\\n } else if (Object.keys(order.items).length > 0) {\\n //Confirm the if the user wants to proceed to clear the order\\n clear = confirm(\\\"Would you like to clear the current order?\\\");\\n if(!clear) {\\n document.getElementById(\\\"dropdown\\\").firstChild.value = \\\"\\\";\\n return;\\n }\\n }\\n\\n clearOrder(true);\\n\\n changeRestaurant(restaurant);\\n\\n}\",\n \"generateRestaurant(){\\n// we want the user to input the zipcode they want to search, the food type they want to eat\\n// and the rating (1-5) \\n// getRestaurants()\\n\\n\\n}\",\n \"function selectRestaurant(){\\r\\n\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\tlet name = select.options[select.selectedIndex]\\r\\n\\t//checks for undefined\\r\\n\\tif (name !== undefined){\\r\\n\\t\\t//creates custom url that tells server what the currently selected restaurant is\\r\\n\\t\\tname= select.options[select.selectedIndex].text;\\r\\n\\t\\tname = name.replace(/\\\\s+/g, '-');\\r\\n\\t\\tlet request = new XMLHttpRequest();\\r\\n\\t\\r\\n\\t\\trequest.onreadystatechange = function(){\\t\\r\\n\\t\\t\\tif(this.readyState == 4 && this.status == 200){ //if its reggie\\r\\n\\t\\t\\t\\tlet data = JSON.parse(request.responseText);\\r\\n\\t\\t\\t\\t//set menu[0] equal to the data from the server\\r\\n\\t\\t\\t\\tmenu[0] = data;\\r\\n\\t\\t\\t\\tconsole.log(menu);\\r\\n\\t\\t\\t\\tlet result = true;\\r\\n\\t\\r\\n\\t\\t\\t\\t//If order is not empty, confirm the user wants to switch restaurants.\\r\\n\\t\\t\\t\\tif(!isEmpty(order)){\\r\\n\\t\\t\\t\\t\\tresult = confirm(\\\"Are you sure you want to clear your order and switch menus?\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\r\\n\\t\\t\\t\\t//If switch is confirmed, load the new restaurant data\\r\\n\\t\\t\\t\\tif(result){\\r\\n\\t\\t\\t\\t\\t//Get the selected index and set the current restaurant\\r\\n\\t\\t\\t\\t\\tlet selected = select.options[select.selectedIndex].value;\\r\\n\\t\\t\\t\\t\\tcurrentSelectIndex = select.selectedIndex;\\r\\n\\t\\t\\t\\t\\t//In A2, current restaurant will be data you received from the server\\r\\n\\t\\t\\t\\t\\tcurrentRestaurant = menu[0];\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the page contents to contain the new menu\\r\\n\\t\\t\\t\\t\\tif (currentRestaurant !== undefined){\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"left\\\").innerHTML = getCategoryHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"middle\\\").innerHTML = getMenuHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t//Clear the current oder and update the order summary\\r\\n\\t\\t\\t\\t\\torder = {};\\r\\n\\t\\t\\t\\t\\tupdateOrder(currentRestaurant);\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the restaurant info on the page\\r\\n\\t\\t\\t\\t\\tlet info = document.getElementById(\\\"info\\\");\\r\\n\\t\\t\\t\\t\\tinfo.innerHTML = currentRestaurant.name + \\\"
    Minimum Order: $\\\" + currentRestaurant.min_order + \\\"
    Delivery Fee: $\\\" + currentRestaurant.delivery_fee + \\\"

    \\\";\\r\\n\\t\\t\\t\\t}else{\\r\\n\\t\\t\\t\\t\\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\\r\\n\\t\\t\\t\\t\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\t\\t\\t\\t\\tselect.selectedIndex = currentSelectIndex;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t//make request to server with custom url based on the currently selected restaurant\\r\\n\\t\\trequest.open(\\\"GET\\\",\\\"http://localhost:3000/menu-data/\\\"+name,true);\\r\\n\\t\\trequest.send();\\r\\n\\t}\\r\\n}\",\n \"function mainMenu() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"choice\\\",\\n message: \\\"Would you like to place another order?\\\"\\n }\\n ]).then(function (answer) {//response is boolean only\\n if (answer.choice) { //if true, run func\\n startBamazon();\\n } else {\\n console.log(\\\"Thanks for shopping at Bamazon. See you soon!\\\")\\n connection.end();\\n }\\n })\\n}\",\n \"function eatFood() {\\n if (gameState.snakeStart === gameState.food) {\\n gameState.snakeLength++;\\n\\n updateFoodCell(\\\"remove\\\", gameState.food);\\n\\n createFood();\\n updateFoodCell(\\\"add\\\", gameState.food);\\n gameState.score++;\\n increaseSpeed();\\n showScore();\\n return true;\\n }\\n}\",\n \"function startOver() {\\n inquirer\\n .prompt({\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to buy another product?\\\",\\n default: true\\n })\\n .then(function(answer) {\\n if (answer.continue) {\\n purchaseChoice();\\n }\\n else {\\n connection.end();\\n }\\n })\\n}\",\n \"async function makeFood(step) {\\n try {\\n if (step < brusselSprouts.length) {\\n await addFood(brusselSprouts[step], \\\"#brusselSprouts\\\"); // Coloco o passo atual na fila\\n makeFood(step + 1); // Dou o próximo passo na receita\\n } else {\\n throw \\\"End of recipe.\\\";\\n }\\n } catch (err) {\\n console.log(err);\\n }\\n}\",\n \"function reRun(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"reply\\\",\\n message: \\\"Would you like to purchase another item?\\\"\\n }\\n ]).then(function(answer) {\\n if(answer.reply) {\\n buy();\\n } \\n else \\n {\\n console.log(\\\"Thanks for shopping Bamazon!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"async displayFoodChoice(step) {\\n const user = await this.userProfile.get(step.context, {});\\n if (user.food) {\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n } else {\\n const user = await this.userProfile.get(step.context, {});\\n\\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\\n\\n if (step.context.activity.text == 1) {\\n user.food = \\\"European\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 2) {\\n user.food = \\\"Chinese\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 3) {\\n user.food = \\\"American\\\";\\n await this.userProfile.set(step.context, user);\\n }else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\\n return await step.beginDialog(WHICH_FOOD);\\n }\\n\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n }\\n return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"function continueShopping(){\\n inquirer.prompt(\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Do you want to continue shopping?\\\",\\n default: true\\n }\\n ).then(answers=>{\\n if(answers.confirm){\\n displayProducts();\\n }else{\\n connection.end();\\n }\\n });\\n}\",\n \"setSelectedRestaurant(state, resto) {\\n state.selectedRestaurant = resto;\\n }\",\n \"function askAgain(){\\n\\tconsole.log(\\\"=============================================================\\\");\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to do another task?\\\",\\n\\t\\t\\tdefault: false\\n\\t\\t}\\n\\t]).then(function(again){\\n\\t\\tif (again.confirm){\\n\\t\\t\\tsupervisorOptions();\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(\\\"All tasks are done.\\\");\\n\\t\\t\\t// Exits node program execution\\n\\t\\t\\tprocess.exit();\\n\\t\\t}\\n\\t});\\n}\",\n \"function repeat() {\\n inquirer\\n .prompt({\\n name: \\\"gotoMainMenu\\\",\\n type: \\\"list\\\",\\n message: \\\"Do you want to go back to main menu ?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n })\\n .then(function (choice) {\\n if (choice.gotoMainMenu === \\\"Yes\\\") {\\n start();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function askAgain() {\\n\\n inquirer\\n .prompt({\\n name: \\\"nextSteps\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to continue shopping?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n })\\n .then(function(answer) {\\n \\n if (answer.nextSteps.toUpperCase() === \\\"NO\\\") {\\n\\n console.log(chalk.yellow(\\\"\\\\nHope you had a pleasant experience. Come again soon!\\\\n\\\"));\\n\\n //turns off the connection from db\\n connection.end();\\n }\\n\\n else {\\n\\n \\t//the first function is called again\\n \\treadProducts();\\n\\n\\n } \\n\\n });\\n}\",\n \"function continuePrompt(){\\n inquirer\\n .prompt({\\n name: \\\"repeat\\\",\\n type: \\\"list\\\",\\n message: \\\"Is there anything else you'd like to do?\\\",\\n choices: [\\n \\\"Yes\\\",\\n \\\"No, I'm done.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.repeat){\\n case \\\"Yes\\\":\\n optionMenu();\\n break;\\n\\n case \\\"No, I'm done.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function runAgain(){\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function restartFunction() {\\n inquirer.prompt([\\n {\\n name:\\\"action\\\",\\n type:\\\"list\\\",\\n message: \\\"Do you want to do another operation?\\\",\\n choices: [\\n \\\"Yes, please.\\\",\\n \\\"No, I am fine thank you.\\\"\\n ]\\n }\\n ]).then(function(answer) {\\n if(answer.action === \\\"Yes, please.\\\") {\\n menuOptions();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"function fightOrFlight() {\\n var fightOrFlight = ask.question(\\\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\\\n\\\")\\n if (fightOrFlight === \\\"f\\\") {\\n fight();\\n } else {\\n run();\\n }\\n}\",\n \"function startPrompt() {\\n \\n inquirer.prompt([{\\n\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Welcome to Zohar's Bamazon! Wanna check it out?\\\",\\n default: true\\n\\n }]).then(function(user){\\n if (user.confirm === true){\\n inventory();\\n } else {\\n console.log(\\\"FINE.. come back soon\\\")\\n }\\n });\\n }\",\n \"function endStart(){\\n inquirer.prompt({\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"continue shopping?\\\",\\n // default: true\\n }).then(function (data) {\\n if (data.confirm === false)\\n \\n process.exit();\\n else \\n start();\\n });\\n}\",\n \"function shopAgain(){\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"shop\\\",\\n message: \\\"Would you like to buy another item?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n }\\n ]).then(function(answer) {\\n if (answer.shop === \\\"YES\\\") {\\n runBamazon();\\n } else {\\n console.log(\\\"Thank you for shopping with us, have a nice day!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"eat() {\\r\\n let consume = this.food - 2\\r\\n if (consume > 1) {\\r\\n this.isHealthy = true\\r\\n return this.food = consume\\r\\n } if (consume <= 0) {\\r\\n this.isHealthy = false\\r\\n return this.food = 0\\r\\n }\\r\\n else if (consume <= 1) {\\r\\n return this.food = consume\\r\\n //alert(this.name + \\\" food supply reached to 0. It's time for a hunt\\\")\\r\\n //this.isHealthy = true\\r\\n }\\r\\n\\r\\n }\",\n \"function superAsk(){\\n\\n inquirer\\n .prompt([\\n // Here we create a basic text prompt.\\n {\\n type: \\\"rawlist\\\",\\n message: \\\"Greetings, what action would you like to perform today? (select by picking a #)\\\",\\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\\n name: \\\"action\\\", \\n },\\n\\n ])\\n .then(function(response) {\\n\\n switch (response.action) {\\n case 'View Product Sales by Department':\\n viewProdSales();\\n break;\\n case 'Create New Department':\\n createDept();\\n break;\\n case 'Exit':\\n process.exit();\\n break;\\n default:\\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\\n }\\n });\\n}\",\n \"function fightOrCave() {\\n\\n let whereNext = prompt(\\\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\\\").toLowerCase();\\n\\n if (whereNext === \\\"grottan\\\"){\\n goToCaveSecondTime();\\n }\\n else if (whereNext === \\\"fight\\\") {\\n alert(\\\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\\\")\\n goToCaveSecondTime();\\n }\\n else {\\n alert(\\\"Vänligen ange fight eller grottan\\\")\\n fightOrCave()\\n }\\n\\n \\n}\",\n \"function runAgain2(){\\n console.log('That item ID was not found in our records.');\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function handleNewMealRequest(response) {\\n // Get a random meal from the random meals list\\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\\n var meal = RANDOM_MEALS[mealIndex];\\n\\n // Create speech output\\n var speechOutput = \\\"Here's a suggestion: \\\" + meal;\\n\\n response.tellWithCard(speechOutput, \\\"MealRecommendations\\\", speechOutput);\\n}\",\n \"function again() {\\n inquirer.prompt({\\n name: \\\"shop\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to keep shopping?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }).then(function(answer){\\n if(answer.shop == \\\"Yes\\\"){\\n list();\\n } else {\\n console.log(\\\"Please come back soon!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"pickUpFood() {\\n var surTile = this.Survivor.getCurrentTile();\\n for (const f of this.foodStock) {\\n if (surTile === f.getTile() && f.getActive()) {\\n f.setActive(false);\\n this.playerFood += this.foodValue;\\n this.playerScore += 10;\\n }\\n }\\n }\",\n \"function restartPrompt(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Would you like to continue shopping?\\\".question,\\n default: true\\n }\\n ]).then(function(input){\\n // If customer wants to continue show products again\\n if(input.confirm){\\n showProducts();\\n }\\n else{\\n console.log(\\\"Thank you for shopping with Bamazon!\\\".magenta);\\n connection.end();\\n }\\n })\\n}\",\n \"function startOver() {\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to make another selection?\\\"\\n\\t\\t}\\n\\t]).then(function(answer) {\\n\\t\\tif (answer.confirm === true) {\\n\\t\\t\\tdisplayOptions();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Goodbye!\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"function keepShopping(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"do you want to keep shopping for beers?\\\",\\n name: \\\"confirm\\\"\\n }\\n ]).then(function(res){\\n if (res.confirm){\\n console.log(\\\"----------------\\\");\\n showProducts();\\n } else {\\n console.log('Thank you for shopping in our online bar, happy drinking!');\\n connection.end();\\n }\\n })\\n}\",\n \"function endRepeat() {\\n inquirer\\n .prompt([{\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n message: \\\"\\\\nDo you want to perform another operation?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then( answer => {\\n if (answer.wish === \\\"Yes\\\") {\\n showMenu();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"function resetProductView(){\\n \\n inquirer.prompt([\\n {\\n type: \\\"rawlist\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do next?\\\",\\n choices:[\\\"I want to checkout\\\", \\\"I want to continue shopping\\\"]\\n }\\n\\n ]).then(function(answers){\\n if(answers.action === \\\"I want to checkout\\\"){\\n console.log(\\\"Good Bye, hope to see you again!\\\");\\n }else if (answers.action === \\\"I want to continue shopping\\\"){\\n customerview();\\n }\\n });\\n\\n}\",\n \"function pickUp(index) {\\n var pt = self[self.turn];\\n var result = self.food[pt];\\n if (!result) return; // Nothing to do\\n if (result.length == 1) index = 0; // Unique\\n if (index == null) { // Can't decide now...\\n newState.pending = action;\\n return;\\n }\\n reward += self.food[pt][index]; // Take the food\\n newState.food[pt] = null; // Food is now gone\\n }\",\n \"function another() {\\n inquirer\\n .prompt(\\n {\\n name: 'another',\\n type: 'confirm',\\n message: 'Would you like to continue shopping?'\\n },\\n\\n )\\n .then(function (answer) {\\n if (answer.another === true) {\\n start();\\n } else {\\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\\n connection.end();\\n }\\n });\\n\\n}\",\n \"function anotherAction() {\\n\\n inquirer\\n .prompt([\\n {\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to complete another action?\\\"\\n }\\n ])\\n .then(function (answer) {\\n if (answer.confirm == true) {\\n showMenu();\\n }\\n else {\\n console.log(\\\"Goodbye.\\\");\\n connection.end();\\n }\\n\\n });\\n\\n}\",\n \"function systemSelection(option){\\n\\tvar check = option; \\n\\tif(vehicleFuel<=0){\\n\\t\\tgameOverLose();\\n\\t}\\n\\n\\telse{\\n\\n\\n\\tif(currentLocation===check){\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\\\",beginTravel);\\n\\t\\t\\t}\\n\\n\\telse{\\n\\t\\n\\t\\t\\tif(check.toLowerCase() === \\\"e\\\"){\\n\\t\\t\\t\\tvehicleFuel=(vehicleFuel-10);\\n\\t\\t\\t\\tcurrentLocation=\\\"e\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Earth...You used 10 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToEarth);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"m\\\"){\\n\\t\\t\\t//need to add a 'visited' conditional\\n\\t\\t\\tvehicleFuel=(vehicleFuel-20);\\n\\t\\t\\tcurrentLocation=\\\"m\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Mesnides...You used 20 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\", goToMesnides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"l\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-50);\\n\\t\\t\\tcurrentLocation=\\\"l\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Laplides...You used 50 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToLaplides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"k\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-120);\\n\\t\\t\\tcurrentLocation=\\\"k\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Kiyturn...You used 120 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToKiyturn);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"a\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-25);\\n\\t\\t\\tcurrentLocation=\\\"a\\\";\\n\\t\\t\\tgamePrompt(\\\"Flying to Aenides...You used 25 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToAenides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"c\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-200);\\n\\t\\t\\tcurrentLocation=\\\"c\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Cramuthea...You used 200 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToCramuthea);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"s\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-400);\\n\\t\\t\\tcurrentLocation=\\\"s\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Smeon T9Q...You used 400 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToSmeon);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"g\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-85);\\n\\t\\t\\tcurrentLocation=\\\"g\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToGleshan);\\n\\t\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, I did not understand you. I will return you to the main menu\\\",beginTravel);\\n\\t\\t}\\n\\t}\\n\\t}\\n}\",\n \"eat () {\\n if (this.food === 0) {\\n this.isHealthy = false;\\n\\n } else {\\n this.food -= 1;\\n }\\n }\",\n \"function chap19(){\\n var wantChicken = false;\\n var foodArray = [\\\"Salmon\\\", \\\"Tilapia\\\", \\\"Tuna\\\", \\\"Lobster\\\"];\\n var customerOrder = prompt(\\\"What would you like?\\\", \\\"Look the menu\\\");\\n for (var i = 0; i <= 3; i++) {\\n if (customerOrder === foodArray[i]) {\\n wantChicken = true;\\n alert(\\\"We have it on the menu!\\\");\\n break;\\n }\\n }\\n if(wantChicken===false) {\\n\\t\\talert(\\\"We don't serve chicken here, sorry.\\\");\\n\\t}\\n}\",\n \"function start() {\\n inquirer.prompt([{\\n name: \\\"entrance\\\",\\n message: \\\"Would you like to shop with us today?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then(function(answer) {\\n // if yes, proceed to shop menu\\n if (answer.entrance === \\\"Yes\\\") {\\n menu();\\n } else {\\n // if no, end node cli \\n console.log(\\\"---------------------------------------\\\");\\n console.log(\\\"No?!?!?! What do you mean no!?!?!?!?!?\\\");\\n console.log(\\\"---------------------------------------\\\");\\n connection.destroy();\\n return;\\n }\\n });\\n}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"select\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"VIEW SALES\\\", \\\"CREATE NEW DEPARTMENT\\\", \\\"DELETE DEPARTMENT\\\", \\\"EXIT\\\"]\\n }).then(function (answers) {\\n if (answers.select.toUpperCase() === \\\"VIEW SALES\\\") {\\n viewSales();\\n } else if (answers.select.toUpperCase() === \\\"CREATE NEW DEPARTMENT\\\") {\\n newDepartment();\\n } else if (answers.select.toUpperCase() === \\\"DELETE DEPARTMENT\\\") {\\n deleteDepartment();\\n } else {\\n // Selecting \\\"EXIT\\\" just takes the user here\\n connection.end();\\n }\\n });\\n}\",\n \"function start() {\\n inquirer\\n .prompt({\\n name: \\\"choice\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory Less than 30 items in stock\\\",\\n \\\"Update current Items Stock Quantity\\\",\\n \\\"Add New Product to Current Dept\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch (answer.choice) {\\n case \\\"View Products for Sale\\\":\\n viewAll();\\n break;\\n case \\\"View Low Inventory Less than 30 items in stock\\\":\\n viewLowInv();\\n break;\\n case \\\"Update current Items Stock Quantity\\\":\\n // viewAll();\\n addToInv();\\n break;\\n case \\\"Add New Product to Current Dept\\\":\\n addNewProduct();\\n break;\\n }\\n });\\n}\",\n \"findCraving(type) {\\n \\n // Make sure a craving has been selected - if not alert user and abort.\\n if (app.currentCraving === 0) {\\n app.showAlert(\\\"No craving\\\", \\\"Please select a craving to continue!\\\");\\n return;\\n }\\n // Opens the loading screen\\n app.showLoadingScreen();\\n // Builds our call url.\\n // Base URL // Current LAT //Current Lon // CurrentCraving \\n var callUrl = `${ apiUrls.zomatoBase }/search?lat=${ app.latLong[0] }&lon=${ app.latLong[1] }&cuisines=${ app.currentCraving }&radius=3000`;\\n \\n // See if the user opted to hide restaurants they've visited.\\n var hidePrev = $(\\\"#chk-hide-previous\\\").is(\\\":checked\\\");\\n \\n // Zero out our array.\\n app.restaurantResults.length = 0;\\n\\n // Performs the API call.\\n app.callApi(\\\"get\\\", callUrl, apiKeys.zomato.header).then((response) => {\\n // Loops through our responses\\n for (var i = 0; i < response.restaurants.length; i++) {\\n // Gets the current restaurant.\\n var rest = response.restaurants[i].restaurant;\\n // Creates an object\\n var newRestaurant = new Restaurant(rest.id, rest.name, rest.location.address, rest.location.latitude, rest.location.longitude,\\n rest.thumb, rest.price_range, rest.average_cost_for_two, rest.featured_image, rest.user_rating.rating_text, rest.user_rating.aggregate_rating);\\n // Gets the distance as a float\\n newRestaurant.distance = parseFloat(distance(app.latLong[0], app.latLong[1], newRestaurant.lat, newRestaurant.lon));\\n // Assume we can push it into our results array.\\n var canPush = true;\\n // If we want to hide it\\n if (hidePrev) {\\n // Make sure we have a list of restaurants the user has been to\\n if (app.currentUser.restaurants) {\\n // Loop through the users' visited restaurants\\n for (var j = 0; j < app.currentUser.restaurants.length; j++) {\\n // Compare it with our current working restaurant\\n if (newRestaurant.id === app.currentUser.restaurants[j]) {\\n // If it's there, flag we cannot push it to the array.\\n canPush = false;\\n }\\n }\\n }\\n }\\n if (canPush) {\\n // If we made it, push it into our results array.\\n app.restaurantResults.push(newRestaurant);\\n }\\n };\\n // if the user wanted\\n if (type === \\\"fast\\\") {\\n app.restaurantResults.sort(app.sortByDistance);\\n } else {\\n app.restaurantResults.sort(app.sortByQuality);\\n }\\n // Populate our results screen\\n app.populateResults();\\n // Hide the loading overlay\\n app.hideLoadingScreen();\\n // Fade into our results screen\\n app.switchScreens(\\\"#craving-select-screen\\\", \\\"#results-screen\\\", true);\\n });\\n }\",\n \"function askIfDone() {\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to return to the main menu?\\\",\\n name: \\\"decision\\\"\\n }\\n ]).then(function(response){\\n if(response.decision === true) {\\n menu();\\n }\\n else {\\n console.log(\\\"\\\\nThank you. Goodbye.\\\");\\n console.log(\\\"\\\\n============================================\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\\n if(userInput === \\\"1\\\"){\\n \\n randomDestination = yesOrNo(destination,destination);\\n \\n }\\n else if (userInput === \\\"2\\\") {\\n \\n randomRestaurant = yesOrNo(restaurant,restaurant);\\n }\\n else if (userInput === \\\"3\\\") {\\n \\n randomTravelType = yesOrNo(transportation, transportation);\\n }\\n else if (userInput === \\\"4\\\") {\\n \\n randomEntertainment = yesOrNo(entertainment,entertainment);\\n }\\n}\",\n \"function start(){\\n inquirer.prompt({\\n type: \\\"list\\\",\\n message: \\\"What would you like to view?\\\",\\n name: \\\"answer\\\",\\n choices: [\\\"All inventory\\\", \\\"Electronics\\\", \\\"Furniture\\\", \\\"Apparel\\\", \\\"Camping/Outdoors\\\", \\\"Tools\\\", \\\"Exit\\\"]\\n }).then(function(data){\\n if(data.answer === \\\"Exit\\\"){\\n console.log(\\\"\\\\nThanks for shopping with Bamazon!\\\\n\\\".green);\\n connection.end();\\n }\\n else if(data.answer === \\\"All inventory\\\"){\\n query = \\\"SELECT * FROM products\\\"\\n showItems();\\n }\\n else{\\n query = \\\"SELECT * FROM products WHERE department = \\\" + \\\"'\\\" + data.answer.toLowerCase() + \\\"'\\\"\\n showItems();\\n }\\n \\n }) \\n}\",\n \"function callNextActionOrExit(answer) {\\n if (answer.userSelection === \\\"View Products for Sale\\\") {\\n console.log(\\\"You want to view products\\\");\\n viewProducts();\\n } else if (answer.userSelection === \\\"View Low Inventory\\\") {\\n console.log(\\\"You want to view inventory\\\")\\n viewLowInventory();\\n } else if (answer.userSelection === \\\"Add to Inventory\\\") {\\n console.log(\\\"You want to add to inventory\\\")\\n addToInventory();\\n } else if (answer.userSelection === \\\"Add New Product\\\") {\\n console.log(\\\"You want to add a new product\\\")\\n getNewItem();\\n } else {\\n database.endConnection();\\n }\\n}\",\n \"function optionMenu(){\\n inquirer\\n .prompt({\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Nothing, I've changed my mind.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.menu){\\n case \\\"View Products for Sale\\\":\\n showProducts();\\n\\n // continuePrompt is delayed to allow showProducts to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n\\n // continuePrompt is delayed to allow lowInventory to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n showProducts()\\n\\n // addInventory is delayed to allow lowInventory to be completed\\n setTimeout(addInventory,300);\\n break;\\n\\n case \\\"Add New Product\\\":\\n newProduct();\\n break;\\n\\n case \\\"Nothing, I've changed my mind.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View All departments\\\",\\n \\\"View All employees\\\",\\n \\\"View All roles\\\",\\n \\\"Add roles\\\",\\n \\\"Add departments\\\",\\n \\\"Add employees\\\",\\n \\\"Delete roles\\\",\\n \\\"Delete departments\\\",\\n \\\"Exit\\\"\\n ]\\n })\\n .then(function(res) { \\n switch (res.action) {\\n case \\\"View departments\\\":\\n viewDep();\\n break;\\n \\n case \\\"View All employees\\\":\\n viewEmp();\\n break;\\n \\n case \\\"View All roles\\\":\\n viewRole();\\n break;\\n \\n case \\\"Add roles\\\":\\n addRole();\\n break;\\n \\n case \\\"Add departments\\\":\\n addDep();\\n break;\\n\\n case \\\"Add employees\\\":\\n addEmp();\\n break;\\n\\n case \\\"Update employee roles\\\":\\n updateEmpRole();\\n break;\\n \\n case \\\"Delete roles\\\":\\n deleteRole();\\n break;\\n \\n case \\\"Delete departments\\\":\\n deleteDep();\\n break;\\n \\n case \\\"Exit\\\":\\n end();\\n break\\n }\\n });\\n }\",\n \"async eatEnergy() {\\n await this.updateAvailableEat();\\n let response = await this.sendRequest(\\\"foodSystem.php\\\", { \\\"whatneed\\\": \\\"eatFrmHldnk\\\" });\\n debug(\\\"Eating...\\\", response);\\n return response;\\n }\",\n \"function doChoice(e) {\\n if (this.selectedIndex>0) {\\n var c = favlist[this.options[this.selectedIndex].value];\\n\\t\\tvar fail = false;\\n if (c) {\\n var i;\\n setNotice('Loading fav ...');\\n for (i=1;i<=c.length;i++) {\\n fail |= setState(i,c[i-1]);\\n }\\n for (;i<=11;i++) {\\n clearState(i);\\n }\\n }\\n this.selectedIndex = 0;\\n\\t\\tif (fail)\\n\\t\\t\\taddNotice('Item(s) not found!');\\n\\t\\telse\\n\\t\\t\\taddNotice('Fav loaded!');\\n }\\n}\",\n \"function initSelectRestaurant(restaurants, searchTerm){\\n $(function(){\\n\\n var getRestaurant = window.LE.restaurants.getRestaurant\\n\\n userdata.restaurant = null;\\n\\n //dummy var\\n var isSearch = null;\\n\\n // prepare template\\n var source = $(\\\"#restaurant-dropdown-template\\\").html();\\n var template = Handlebars.compile(source);\\n\\n html = template(restaurants); \\n\\n // populate dropdown for restaurants\\n var renderingRestaurants = $('#render-restaurants').after(html);\\n\\n // render confirmation of the search term so the user remembers what they were looking for\\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\\n\\n // when the restaurant changes, we need to display rate and other data\\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\\n });\\n \\n $(\\\"#select-restaurant-continue-button\\\").on(\\\"click\\\", function(){\\n // this is the restaurant id to render later\\n var selectedVal = $(\\\"#restaurant\\\").val();\\n\\n if(_debug){ console.log(selectedVal); }\\n\\n if(selectedVal == \\\"\\\"){\\n document.getElementById(\\\"restaurant-alert\\\").innerHTML = \\\"Required.\\\";\\n }else{\\n\\n // cleanup old event handlers before leaving home context\\n destroyHome();\\n\\n userdata.currentRestaurant = selectedVal;\\n initSelectItem(selectedVal);\\n // ease scroll to top of next view\\n $(\\\"html, body\\\").animate({ scrollTop: 0 }, \\\"slow\\\");\\n }\\n });\\n });\\n}\",\n \"function continuePrompt(){\\n inquirer.prompt({\\n type: \\\"confirm\\\",\\n name: \\\"continue\\\",\\n message: \\\"Continue....?\\\",\\n }).then((answer) => {\\n if (answer.continue){\\n showMainMenu();\\n } else{\\n exit();\\n }\\n })\\n}\",\n \"function start (p){\\n\\tresetting=true;\\n\\tfoodCounter=0;\\n\\tdeleteAllFood();\\n\\treset(p);\\n}\",\n \"function promptAction() {\\n inquirer.prompt([{\\n type: 'list',\\n message: 'Select from list below what action you would like to complete.',\\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\\n name: \\\"action\\\"\\n }, ]).then(function(selection) {\\n switch (selection.action) {\\n case 'View Products for Sale':\\n viewAllProducts();\\n break;\\n\\n case 'View Low Inventory':\\n lowInventoryList();\\n break;\\n\\n case 'Add to Inventory':\\n addInventory();\\n break;\\n\\n case 'Add New Product':\\n addNewProduct();\\n break;\\n }\\n }).catch(function(error) {\\n throw error;\\n });\\n}\",\n \"function nextAction() {\\n\\tinquirer.prompt({\\n\\t\\tmessage: \\\"What would you like to do next?\\\",\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"nextAction\\\",\\n\\t\\tchoices: [\\\"Add More Items\\\", \\\"Remove Items\\\", \\\"Alter Item Order Amount\\\", \\\"Survey Cart\\\", \\\"Checkout\\\"]\\n\\t})\\n\\t\\t.then(function (actionAnswer) {\\n\\t\\t\\tswitch (actionAnswer.nextAction) {\\n\\t\\t\\t\\tcase \\\"Add More Items\\\":\\n\\t\\t\\t\\t\\t// go to the start function\\n\\t\\t\\t\\t\\tstart();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Remove Items\\\":\\n\\t\\t\\t\\t\\t// go to the removal function\\n\\t\\t\\t\\t\\tremoveItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Checkout\\\":\\n\\t\\t\\t\\t\\t// go to the checkout tree;\\n\\t\\t\\t\\t\\tverifyCheckout();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Alter Item Order Amount\\\":\\n\\t\\t\\t\\t\\t// go to the function that alters the shopping cart qty\\n\\t\\t\\t\\t\\talterItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Survey Cart\\\":\\n\\t\\t\\t\\t\\t// look at the cart\\n\\t\\t\\t\\t\\tcheckoutFunction();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tdefault: console.log(\\\"how did you get here?\\\")\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function continueShopping() {\\n inquire.prompt([{\\n message: \\\"Checkout or Continue Shopping?\\\",\\n type: \\\"list\\\",\\n name: \\\"continue\\\",\\n choices: [\\\"Continue\\\", \\\"Go to checkout\\\"]\\n }]).then(function (ans) {\\n if (ans.continue === \\\"Continue\\\") {\\n console.log(\\\" Items Added to Cart!\\\");\\n shoppingCart();\\n } else if (ans.continue === \\\"Go to checkout\\\") {\\n checkOut(itemCart, cartQuant);\\n }\\n });\\n}\",\n \"function regretsPrompt (res) {\\n\\tinquirer\\n \\t\\t.prompt([\\n \\t\\t\\t{\\n\\t\\t\\t\\ttype: \\\"list\\\",\\n\\t\\t\\t\\tmessage: \\\"What would you like to do?\\\",\\n\\t\\t\\t\\tchoices: [\\\"Change Quantity\\\", \\\"Start Over\\\"],\\n\\t\\t\\t\\tname: \\\"selection\\\"\\n\\t\\t }\\n\\t\\t])\\n\\t\\t.then(function(inqRes) {\\n\\t\\t\\tif (inqRes.selection == \\\"Change Quantity\\\"){\\n\\t\\t\\t\\tquantityPrompt(res);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdisplayAllProducts();\\t\\n\\t\\t\\t}\\n\\n\\n\\t\\t});//ends then\\n}\",\n \"function noInventoryOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Do you want to choose a new item or quit?\\\",\\n choices: [\\\"NEW-ITEM\\\", \\\"QUIT\\\"],\\n name: \\\"startAgain\\\"\\n }\\n ])\\n .then(function(answer6) {\\n if (answer6.startAgain == \\\"NEW-ITEM\\\") {\\n displayProducts(); \\n }\\n if (answer6.startAgain == \\\"QUIT\\\") {\\n console.log(\\\"Thank you. Good-bye!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function contShopping() {\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Do you want to continue shopping?\\\",\\n name: \\\"id\\\",\\n\\n }\\n\\n ])\\n .then(function (cont) {\\n\\n if (cont.id === true) {\\n readProducts();\\n }\\n else {\\n console.log(\\\"Have a good day!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function submitClicked () { \\n let foodInput = $('#food').val();\\n if(foodInput == \\\"\\\"){\\n $('.noFoodItem').text(\\\"please enter a food item in the search bar\\\").css('color','red');\\n return; \\n }\\n $('.noFoodItem').text('');\\n food = $(\\\"#food\\\").val()\\n initAutocomplete();\\n changePage();\\n}\",\n \"function menuoption(){\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name : \\\"menu\\\",\\n message : \\\"What do you want to see ?\\\",\\n choices : [\\\"\\\\n\\\",\\\"View Products for Sale\\\",\\\"View Low Inventory\\\",\\\"Add to Inventory\\\",\\\"Add New Product\\\"]\\n\\n }).then(function(answer){\\n // var update;\\n // var addnew;\\n console.log(answer.menu);\\n //if else option to compare user input and call the required function\\n if(answer.menu == \\\"View Products for Sale\\\" ){\\n showitem();\\n }else if(answer.menu == \\\"View Low Inventory\\\"){\\n \\n lowinventory();\\n }else if(answer.menu == \\\"Add to Inventory\\\"){\\n updateinventory();\\n // updateonecolumn(itemidinput);\\n }else if(answer.menu == \\\"Add New Product\\\"){\\n addnewproduct();\\n }\\n \\n });\\n }\",\n \"function shop() {\\n\\n inquirer.prompt([{\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Update Inventory\\\", \\\"Add New Product\\\"]\\n }]).then(function (answer) {\\n\\n switch (answer.menu) {\\n case \\\"View Products for Sale\\\":\\n forSale();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowStock();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addThing();\\n break;\\n\\n case \\\"Update Inventory\\\":\\n moreStuff();\\n break;\\n }\\n });\\n}\",\n \"function ADMIN() {\\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\\n flights.sort((a, b) => a.id - b.id);\\n for (let i = 0; i < flights.length; i++) {\\n flights[i].display = true;\\n }\\n let ediDel;\\n do {\\n ediDel = prompt(\\n \\\"Te encuentras en la funci\\\\u00F3n de ADMINISTRADOR. Indica la funci\\\\u00F3n a la que quieres acceder: EDIT, DELETE.\\\",\\n \\\"EDIT,DELETE\\\"\\n );\\n salida(ediDel, ADMIN);\\n ediDel = ediDel.toUpperCase();\\n } while (ediDel !== \\\"EDIT\\\" && ediDel !== \\\"DELETE\\\");\\n\\n //JUMP TO NEXT FUNCITON\\n if (ediDel === \\\"EDIT\\\") {\\n EDIT();\\n } else if (ediDel === \\\"DELETE\\\") {\\n DELETE();\\n } else {\\n alert(\\\"No te he entendido\\\");\\n ADMIN();\\n }\\n}\",\n \"function buyMore() {\\n\\n inquirer.prompt([\\n {\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Do you want to buy another product?\\\"\\n }\\n ]).then(function (answers) {\\n if (answers.continue) {\\n defId = null;\\n defQty = 1;\\n dispAll();\\n } else {\\n connection.end();\\n }\\n });\\n\\n}\",\n \"function start() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"Purchase Items\\\", \\n \\\"Exit\\\"],\\n }\\n ]).then(function(answer) {\\n\\n // Based on the selection, the user experience will be routed in one of these directions\\n switch (answer.choice) {\\n case \\\"Purchase Items\\\":\\n displayItems();\\n break;\\n case \\\"Exit\\\":\\n exit();\\n break;\\n }\\n });\\n} // End start function\",\n \"function askAgain() {\\n inquirer.prompt({\\n name: \\\"choice\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What you like to place another order?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n })\\n .then(function (answer) {\\n if (answer.choice.toUpperCase() === \\\"YES\\\") {\\n ask();\\n } else {\\n console.log(\\\"Thank you for shopping at Bamazon.\\\");\\n connection.end();\\n }\\n })\\n\\n}\",\n \"onSelectRestaurant(restaurant){\\n this.closeAllRestaurant()\\n restaurant.viewDetailsComments()\\n restaurant.viewImg()\\n\\n }\",\n \"function fightOrRun() {\\n var choices = [\\\"Run\\\", \\\"Fight\\\"];\\n var askPlayer = parseInt(readline.keyInSelect(choices, \\\"Do you want to fight like a shark or run like a shrimp???\\\\nThe next monster might be scarier.\\\\n \\\\n What are you going to do? Press 1 to run...Press 2 to fight.\\\"));\\n if (choices === 1) {\\n //call the function for deciding to run \\n run();\\n } else {\\n //call the function for deciding to fight\\n console.log('You decided to fight, bring it on!!.');\\n fight();\\n }\\n }\",\n \"function OrderAgain(){ \\r\\n\\tinquirer.prompt([{ \\r\\n\\t\\ttype: 'confirm', \\r\\n\\t\\tname: 'choice', \\r\\n\\t\\tmessage: 'Would you like to place another order?' \\r\\n\\t}]).then(function(answer){ \\r\\n\\t\\tif(answer.choice){ \\r\\n\\t\\t\\tplaceOrder(); \\r\\n\\t\\t} \\r\\n\\t\\telse{ \\r\\n\\t\\t\\tconsole.log('Thank you for shopping at the Bamazon Mercantile!'); \\r\\n\\t\\t\\tconnection.end(); \\r\\n\\t\\t} \\r\\n\\t}) \\r\\n}\",\n \"function eat(food)\\n\\t\\t{\\n\\t\\t\\t// Add the food's HTML element to a queue of uneaten food elements.\\n\\t\\t\\tuneatenFood.push(food.element);\\n\\n\\t\\t\\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\\n\\t\\t\\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\\n\\t\\t\\t// removes the food element.\\n\\t\\t\\tFish.swimTo(\\n\\t\\t\\t\\tfood.position,\\n\\t\\t\\t\\tFish.PathType.AppendPath,\\n\\t\\t\\t\\tfunction()\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tlet eatenFood = uneatenFood.shift();\\n\\t\\t\\t\\t\\teatenFood.parentNode.removeChild(eatenFood);\\n\\t\\t\\t\\t\\tgrow();\\n\\t\\t\\t\\t});\\n\\t\\t} // end eat()\",\n \"function restaurantCheck (post) {\\n\\n\\t\\tvar zomatoKey = \\\"8eb908d1e6003b1c7643c94c50ecd283\\\";\\n\\n\\t\\t// J\\n\\t\\t// Q\\n\\t\\t// U\\n\\t\\t// E\\n\\t\\t// R\\n\\t\\t// Y\\n\\t\\t$.ajax ({\\n\\t\\t\\tmethod: \\\"GET\\\",\\n\\t\\t\\turl: \\\"https://developers.zomato.com/api/v2.1/search?apikey=\\\"+zomatoKey+\\\"&count=500&lat=42.4074843&lon=-71.11902320000002&radius=5000\\\",\\n\\t\\t}).done(function (data) {\\n\\t\\t\\tdata.restaurants.forEach(function(element,index) {\\n\\t\\t\\t\\tif (post.includes(element.restaurant.name)) {\\n\\t\\t\\t\\t\\tfood_list.push(element.restaurant.name);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t});\\n\\t}\",\n \"function mainOptions() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View\\\",\\n \\\"Add\\\",\\n \\\"Delete\\\",\\n \\\"Update\\\"\\n ]\\n })\\n .then(function (answer) {\\n switch (answer.action) {\\n\\n case \\\"View\\\":\\n viewChoice();\\n break;\\n\\n case \\\"Add\\\":\\n addChoice();\\n break;\\n\\n case \\\"Delete\\\":\\n deleteChoice()\\n break;\\n\\n case \\\"Update\\\":\\n updateChoice()\\n break;\\n\\n\\n }\\n });\\n\\n}\",\n \"function anythingElse() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Anything Else?\\\",\\n name: \\\"choice\\\"\\n }\\n ])\\n .then(res => {\\n if (res.choice) {\\n displayProducts();\\n } else {\\n console.log(\\\"Thank You!\\\");\\n console.log(`Total: $${total}`);\\n connection.end();\\n }\\n });\\n}\",\n \"function chooseAction() {\\n\\tinquirer\\n\\t\\t.prompt({\\n\\t\\t\\tname: \\\"action\\\", \\n\\t\\t\\ttype: \\\"rawlist\\\", \\n\\t\\t\\tmessage: \\\"What do you want to do?\\\", \\n\\t\\t\\tchoices: [\\\"VIEW PRODUCTS\\\", \\\"VIEW LOW INVENTORY\\\", \\\"ADD TO INVENTORY\\\", \\\"ADD NEW PRODUCT\\\", \\\"QUIT\\\"]\\n\\t\\t})\\n\\t\\t.then(function(ans) {\\n\\t\\t\\tif(ans.action.toUpperCase() ===\\\"VIEW PRODUCTS\\\") {\\n\\t\\t\\t\\tviewProducts(); \\n\\t\\t\\t} \\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"VIEW LOW INVENTORY\\\") {\\n\\t\\t\\t\\tviewLowInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD TO INVENTORY\\\") {\\n\\t\\t\\t\\taddInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD NEW PRODUCT\\\") {\\n\\t\\t\\t\\taddNewProduct(); \\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tendConnection(); \\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"async promptForMenu(step) {\\n return step.prompt(MENU_PROMPT, {\\n choices: [\\\"Donate Food\\\", \\\"Find a Food Bank\\\", \\\"Contact Food Bank\\\"],\\n prompt: \\\"Do you have food to donate, do you need food, or are you contacting a food bank?\\\",\\n retryPrompt: \\\"I'm sorry, that wasn't a valid response. Please select one of the options\\\"\\n });\\n }\",\n \"function checkFood(food){\\n\\tvar food = [\\\"chicken\\\", \\\"beef\\\", \\\"fish\\\", \\\"lamb\\\", \\\"veal\\\"];\\n\\n\\t//The first term starts with 0\\n\\n\\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\\n\\t\\talert(\\\"You are considered as meat\\\");\\n\\t}else{\\n\\t\\talert(\\\"You may or may not be considered as meat\\\");\\n\\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \\\"You are considered as meat\\\"\\n\\t//if something else is entered, then a popup will appear saying \\\"you may or may not be considered as meat\\\"\\t\\n\\t}\\n}\",\n \"function startPrompt() {\\n inquirer\\n .prompt([\\n {\\n name: \\\"startOrStop\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to make a purchase?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\", \\\"Show me the choices again\\\"]\\n }\\n ])\\n .then(function (answer) {\\n if (answer.startOrStop === \\\"No\\\") {\\n console.log(\\\"Goodbye!\\\");\\n connection.end();\\n } else if (answer.startOrStop === \\\"Show me the choices again\\\") {\\n start();\\n } else {\\n buyPrompt();\\n }\\n\\n });\\n}\",\n \"function foodClickHandler(foodsitem) {\\n setFood(foodsitem);\\n }\",\n \"function keepShopping() {\\n inquirer.prompt([{\\n type: \\\"confirm\\\",\\n name: \\\"shopping\\\",\\n message: \\\"Would you like to keep shopping?\\\",\\n }]).then(function (answer) {\\n if (answer) {\\n chooseShop();\\n } else {\\n // End the database connection\\n connection.end();\\n }\\n })\\n}\",\n \"async captureFood(step) {\\n const user = await this.userProfile.get(step.context, {});\\n\\n // Perform a call to LUIS to retrieve results for the user's message.\\n const results = await this.luisRecognizer.recognize(step.context);\\n\\n // Since the LuisRecognizer was configured to include the raw results, get the `topScoringIntent` as specified by LUIS.\\n const topIntent = results.luisResult.topScoringIntent;\\n const topEntity = results.luisResult.entities[0];\\n\\n if (step.result !== -1) {\\n\\n if (topIntent.intent == 'ChooseTypeOfFood') {\\n user.food = topEntity.entity;\\n await this.userProfile.set(step.context, user);\\n\\n //await step.context.sendActivity(`Entity: ${topEntity.entity}`);\\n await step.context.sendActivity(`I'm going to find the restaurant to eat : ${topEntity.entity}`);\\n //return await step.next();\\n }\\n else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand or say cancel.`);\\n return await step.replaceDialog(WHICH_FOOD);\\n }\\n\\n // await step.context.sendActivity(`I will remember that you want this kind of food : ${ step.result } `);\\n } else {// si l'user ne sait pas quelle genre de food il veut\\n\\n const { ActionTypes, ActivityTypes, CardFactory } = require('botbuilder');\\n\\n const reply = { type: ActivityTypes.Message };\\n\\n // // build buttons to display.\\n const buttons = [\\n { type: ActionTypes.ImBack, title: '1. European 🍝 🍲', value: '1' },\\n { type: ActionTypes.ImBack, title: '2. Chinese 🍜 🍚', value: '2' },\\n { type: ActionTypes.ImBack, title: '3. American 🍔 🍟', value: '3' }\\n ];\\n\\n // // construct hero card.\\n const card = CardFactory.heroCard('', undefined,\\n buttons, { text: 'What type of restaurant do you want ?' });\\n\\n // // add card to Activity.\\n reply.attachments = [card];\\n\\n // // Send hero card to the user.\\n await step.context.sendActivity(reply);\\n\\n }\\n //return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"function displayRestaurant() {\\n restaurantDrop.on(\\\"click\\\", function (event) {\\n if ($(event.target).attr(\\\"class\\\") === \\\"yes\\\") {\\n console.log(\\\"hi\\\");\\n $(\\\".body-container\\\").prepend($(\\\".location\\\").show());\\n restaurantOption.hide();\\n }\\n if ($(event.target).attr(\\\"class\\\") === \\\"no\\\") {\\n $(\\\".final-date\\\").removeClass(\\\"hide\\\");\\n restaurantOption.hide();\\n viewDate.append($(\\\".movie-display\\\"));\\n $(\\\".movie-display\\\").show();\\n restaurantStorage.push(\\\"\\\")\\n localStorage.setItem(\\\"Restaurants\\\", JSON.stringify(restaurantStorage))\\n }\\n });\\n}\",\n \"function start() {\\n inquirer\\n .prompt({\\n name: \\\"selectOptions\\\",\\n type: \\\"list\\\",\\n message: \\\"Choose from the list of available options...\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\", \\\"View most expensive Inventory\\\"]\\n })\\n .then(function (answer) {\\n\\n // get the user choice and route to appropriate function.\\n switch (answer.selectOptions) {\\n case \\\"View Products for Sale\\\":\\n listAllProducts();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n listLowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addToInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addNewItemToInventory();\\n break;\\n\\n case \\\"View most expensive Inventory\\\":\\n listExpensiveItems();\\n break;\\n }\\n\\n //\\n\\n });\\n}\",\n \"function nextPrompt(){\\n inquirer.prompt([\\n {\\n name: \\\"status\\\",\\n type: \\\"list\\\",\\n message: \\\"Buy more?\\\",\\n choices: [\\\"Buy more\\\", \\\"Exit\\\"]\\n }\\n ]).then(answer => {\\n if(answer.status === \\\"Buy more\\\"){\\n displayInventory();\\n promptBuy();\\n } else{\\n console.log(\\\"Thank you. Goodbye.\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function foodRunnerSelector() {\\n \\n if (document.getElementById(\\\"foodRunnerYes\\\").checked == true) {\\n\\tdoTipFoodRunner = true;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"Food Runner will be tipped out\\\";}\\n else { \\n\\tdoTipFoodRunner = false;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"No tip out for Food Runner\\\"; \\n }\\n return doTipFoodRunner\\n}\",\n \"function setFoodType(type) {\\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\\n if(type === 'kebab') {\\n $scope.hammered = 'chosen-emotion';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'cafe') {\\n $scope.hammered = '';\\n $scope.hungover = 'chosen-emotion';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'fastfood') {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = 'chosen-emotion';\\n $scope.hardworking = '';\\n } else {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = 'chosen-emotion';\\n }\\n vm.foodType = type;\\n }\",\n \"function askToContinue() {\\n\\t\\tinquirer\\n\\t\\t\\t.prompt([\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\ttype: 'confirm',\\n\\t\\t\\t\\t\\tmessage: 'Do you want to play again?',\\n\\t\\t\\t\\t\\tname: 'confirm',\\n\\t\\t\\t\\t\\tdefault: true\\n\\t\\t\\t\\t}\\n\\t\\t\\t])\\n\\t\\t\\t.then(function(response) {\\n\\t\\t\\t\\tif (response.confirm === true) {\\n\\t\\t\\t\\t\\tstartGame();\\n\\t\\t\\t\\t} \\n\\t\\t\\t});\\n\\t}\",\n \"function goPrompt() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"What action would you like to do?\\\",\\n name: \\\"choice\\\",\\n choices: [\\n \\\"Check Departments\\\",\\n \\\"Check Roles\\\",\\n \\\"Check Employees\\\",\\n \\\"Plus Employee\\\",\\n \\\"Plus Role\\\",\\n \\\"Plus Department\\\"\\n ]\\n }\\n // switch replaces else if...selects parameter and javascript will look for the correct function\\n ]).then(function (data) {\\n switch (data.choice) {\\n case \\\"Check Departments\\\":\\n viewDepartments()\\n break;\\n case \\\"Check Roles\\\":\\n viewRoles()\\n break;\\n case \\\"Check Employees\\\":\\n viewEmployees()\\n break;\\n case \\\"Plus Employee\\\":\\n plusEmployees()\\n break;\\n case \\\"Plus Department\\\":\\n plusDepartment()\\n break;\\n case \\\"Plus Role\\\":\\n plusRole()\\n break;\\n }\\n })\\n}\",\n \"function userSearch() {\\n\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do:\\\",\\n choices: [\\\"View product sales by Department\\\", \\\"Create new department\\\", \\\"Exit Supervisor Mode\\\"]\\n }\\n\\n ]).then(function (manager) {\\n\\n switch (manager.choice) {\\n case \\\"View product sales by Department\\\":\\n viewDepartments();\\n break;\\n \\n case \\\"Create new department\\\":\\n addNewDepartment();\\n break;\\n\\n case \\\"Exit Supervisor Mode\\\":\\n console.log(\\\"\\\\nSee ya later!\\\\n\\\");\\n connection.end ();\\n break;\\n }\\n\\n });\\n\\n}\",\n \"function orderAgain() {\\n console.log(\\\"------\\\");\\n inquirer.prompt({\\n name: \\\"confirm\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like start over and view what's in stock again?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n })\\n .then(function(answer) {\\n if (answer.confirm === \\\"Yes\\\") {\\n displayStock();\\n }\\n\\n else {\\n console.log(\\\"------\\\")\\n console.log(\\\"Thanks for shopping on Bamazon!\\\")\\n connection.end();\\n }\\n })\\n }\",\n \"function randomFood() {\\n\\n\\t\\tif (Math.random() > 0.5) {\\n\\t\\t\\treturn 'pizza';\\n\\t\\t} \\n\\t\\treturn 'ice cream';\\n\\t}\",\n \"function frostingChoice(item) {\\n frostingChosen = true;\\n if (typeof preFrostingChoice !== 'undefined'){\\n preFrostingChoice.style.backgroundColor = \\\"white\\\";\\n }\\n\\n item.style.backgroundColor = \\\"lightgray\\\";\\n preFrostingChoice = item;\\n\\n checkPrice();\\n}\",\n \"function pizzaFlavor() {\\n // Logs menu to console after each action\\n console.log(\\\"\\\");\\n console.log(\\\"Please choose your actions:\\\");\\n console.log(\\\"\\\");\\n console.log(\\\"1 - List all the pizza flavors\\\");\\n console.log(\\\"2 - Add a new pizza flavor\\\");\\n console.log(\\\"3 - Remove a pizza flavor\\\");\\n console.log(\\\"4 - Exit this program\\\");\\n console.log(\\\"\\\");\\n\\n // Variable that stores menu option\\n let x = Number(readlineSync.question(\\\"Enter your action's number: \\\"));\\n\\n // Logs list of pizza flavors to console when menu option 1 is chosen and returns to menu\\n if (x === 1) {\\n console.log(flavs);\\n pizzaFlavor();\\n }\\n\\n // Enters do while loop to keep asking for new pizza flavor input\\n if (x === 2) {\\n // Do while loop breaks when \\\"X\\\" is entered and returns to menu\\n do {\\n flavs.push(readlineSync.question(\\\"Please enter pizza flavor. \\\"));\\n console.log(\\\"Enter X to return or press enter to add another pizza flavor.\\\");\\n } while (readlineSync.question() != \\\"X\\\")\\n pizzaFlavor();\\n }\\n\\n // Will remove array item when menu option 3 is chosen\\n if (x === 3) {\\n // Variable that stores array item to be removed\\n let rm = readlineSync.question(\\\"Please enter pizza flavor number to remove. \\\");\\n\\n // If statement to check is input matches an item in array\\n if (flavs.includes(rm)) {\\n // If item exists the given item will be removed from the array and returns to menu\\n flavs.splice(flavs.indexOf(rm), 1);\\n pizzaFlavor();\\n } else {\\n // If item does not exist a message will be logged to console and returns to menu\\n console.log(`Pizza flavors does not include ${rm}.`);\\n pizzaFlavor();\\n }\\n\\n }\\n\\n // If menu option 4 is chosen a message will be returned before exiting\\n if (x === 4) {\\n return console.log(\\\"Goodbye\\\");\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7001863","0.657572","0.6354631","0.61981887","0.61617345","0.6039793","0.59346044","0.58597845","0.5759057","0.57568675","0.5734756","0.5711459","0.56503254","0.56424713","0.5628671","0.5624591","0.56080526","0.5606945","0.55971736","0.5590472","0.55805224","0.5552525","0.5549805","0.55494136","0.5545532","0.5539159","0.5535191","0.55203235","0.5514501","0.55144423","0.55031675","0.5489432","0.5484783","0.548163","0.5478807","0.54445267","0.5437527","0.54280317","0.5413058","0.54049426","0.5403171","0.53885347","0.53851014","0.5381898","0.53776217","0.53772664","0.5375205","0.5373364","0.5351634","0.53499365","0.5347719","0.53471416","0.5346711","0.5342911","0.5339975","0.53349847","0.5328616","0.5328096","0.5323827","0.5318714","0.5316711","0.53145766","0.5310767","0.5308874","0.5305553","0.52950686","0.52929175","0.5284329","0.5282659","0.52809423","0.5276205","0.5268632","0.52637357","0.5261021","0.5259221","0.525922","0.5252799","0.5247729","0.5239674","0.52379245","0.52361894","0.5234169","0.523282","0.52306706","0.5225386","0.5223008","0.5222767","0.52201265","0.5219727","0.52192503","0.521583","0.52148867","0.5214068","0.52120614","0.5211861","0.520734","0.52044666","0.52024543","0.5200851","0.5200763"],"string":"[\n \"0.7001863\",\n \"0.657572\",\n \"0.6354631\",\n \"0.61981887\",\n \"0.61617345\",\n \"0.6039793\",\n \"0.59346044\",\n \"0.58597845\",\n \"0.5759057\",\n \"0.57568675\",\n \"0.5734756\",\n \"0.5711459\",\n \"0.56503254\",\n \"0.56424713\",\n \"0.5628671\",\n \"0.5624591\",\n \"0.56080526\",\n \"0.5606945\",\n \"0.55971736\",\n \"0.5590472\",\n \"0.55805224\",\n \"0.5552525\",\n \"0.5549805\",\n \"0.55494136\",\n \"0.5545532\",\n \"0.5539159\",\n \"0.5535191\",\n \"0.55203235\",\n \"0.5514501\",\n \"0.55144423\",\n \"0.55031675\",\n \"0.5489432\",\n \"0.5484783\",\n \"0.548163\",\n \"0.5478807\",\n \"0.54445267\",\n \"0.5437527\",\n \"0.54280317\",\n \"0.5413058\",\n \"0.54049426\",\n \"0.5403171\",\n \"0.53885347\",\n \"0.53851014\",\n \"0.5381898\",\n \"0.53776217\",\n \"0.53772664\",\n \"0.5375205\",\n \"0.5373364\",\n \"0.5351634\",\n \"0.53499365\",\n \"0.5347719\",\n \"0.53471416\",\n \"0.5346711\",\n \"0.5342911\",\n \"0.5339975\",\n \"0.53349847\",\n \"0.5328616\",\n \"0.5328096\",\n \"0.5323827\",\n \"0.5318714\",\n \"0.5316711\",\n \"0.53145766\",\n \"0.5310767\",\n \"0.5308874\",\n \"0.5305553\",\n \"0.52950686\",\n \"0.52929175\",\n \"0.5284329\",\n \"0.5282659\",\n \"0.52809423\",\n \"0.5276205\",\n \"0.5268632\",\n \"0.52637357\",\n \"0.5261021\",\n \"0.5259221\",\n \"0.525922\",\n \"0.5252799\",\n \"0.5247729\",\n \"0.5239674\",\n \"0.52379245\",\n \"0.52361894\",\n \"0.5234169\",\n \"0.523282\",\n \"0.52306706\",\n \"0.5225386\",\n \"0.5223008\",\n \"0.5222767\",\n \"0.52201265\",\n \"0.5219727\",\n \"0.52192503\",\n \"0.521583\",\n \"0.52148867\",\n \"0.5214068\",\n \"0.52120614\",\n \"0.5211861\",\n \"0.520734\",\n \"0.52044666\",\n \"0.52024543\",\n \"0.5200851\",\n \"0.5200763\"\n]"},"document_score":{"kind":"string","value":"0.56144774"},"document_rank":{"kind":"string","value":"16"}}},{"rowIdx":63,"cells":{"query":{"kind":"string","value":"Fancy restaurant scene start."},"document":{"kind":"string","value":"function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\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 start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}","function startup() {\n\tsceneTransition(\"start\");\n}","function start() {\n for(var i = 0; i < sceneList.length; i++) {\n addScene(sceneList[i]); // sceneList.js is imported in html-file\n }\n setScene(\"start\");\n }","static start() {\n this.buttonCreate();\n this.buttonHideModal();\n\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\n // Animal.createAnimal('Liutas', 35, 'brown', false);\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\n\n this.load();\n }","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Plague()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","function sceneStart(){\n\t\t\t\tfor (n = 0; n < heroes.length; n++)\n\t\t\t\t\theroes[n].tl.delay(20).fadeIn(35);\n\t\t\t\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\n\t\t\t\tgame.sceneStarted = true;\n\t\t\t\tthreatBar.opacity = 1;\n\t\t\t\tthreatGuage.opacity = 1;\n\t\t\t\tmonsterBox.opacity = 1;\n\t\t\t\tmonsterName.opacity = 1;\n\t\t\t\tpartyBox.opacity = 1;\n\t\t\t\tmuteButton.opacity = 1;\n\t\t\t\tfor (n = 0; n < nameLabels.length; n++){\n\t\t\t\t\tnameLabels[n].opacity = 1;\n\t\t\t\t\thpLabels[n].opacity = 1;\n\t\t\t\t\tmaxhpLabels[n].opacity = 1;\n\t\t\t\t\tmpLabels[n].opacity = 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\t}","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Galaga()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }","function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }","function start() {\n restarts++;\n currentScene = scenes[0];\n currentTextIndex = 0;\n\n setMainImage();\n setMainText();\n hideSetup();\n updateStats();\n}","function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}","function go() {\n console.log('go...')\n \n const masterT = new TimelineMax();\n \n masterT\n .add(clearStage(), 'scene-clear-stage')\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\n .add(enterTreeStuff(), 'scene-enter-treestuff')\n .add(enterGreet(), 'scene-enter-greet')\n ;\n }","function main(){\n\t//Initialice with first episode\n\tvar sel_episodes = [1]\n\t//collage(); //Create a collage with all the images as initial page of the app\n\tpaintCharacters();\n\tpaintEpisodes();\n\tpaintLocations(sel_episodes);\n}","startGame() {\n this.scene.start('MenuScene');\n }","function start(){\n renderGameField();\n resizeGameField();\n spawnSnake();\n spawnFood();\n eatFood();\n renderSnake();\n}","function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}","function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}","function initScene1() {\n if (currentScene === 1) {\n\n $('#game1').show(\"fast\");\n\n //clique sur une porte\n $('.dungeon0Door').on('click', function (e) {\n console.log(currentScene);\n if (consumeEnergy(10)) {\n if (oD10.roll() >= 8) {\n printConsole('Vous vous echappez du donjon');\n loadScene(2);\n } else {\n printConsole(\"Ce n'est pas la bonne porte ..\");\n $('.dungeon0Door').animate({\n opacity: '0'\n }, 'slow', function () {\n $('.dungeon0Door').animate({\n opacity: '1'\n }, 'fast');\n });\n }\n }\n });\n }\n }","create() {\n\n // add animations (for all scenes)\n this.addAnimations();\n\n // change to the \"Home\" scene and provide the default chord progression / sequence\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\n }","function start(){\n\t\n}","function Aside() {\n appStarted = true;\n // all objects added to the stage appear in \"layer order\"\n // add a helloLabel to the stage\n seeMore = new objects.Label(\"Click me to see more of my work\", \"32px\", \"Times New Roman\", \"#000000\", canvasHalfWidth, canvasHalfHeight + 200, true);\n stage.addChild(seeMore);\n // add a clickMeButton to the stage\n treesharksLogo = new objects.Icon(loader, \"treesharksLogo\", canvasHalfWidth, canvasHalfHeight - 100, true);\n stage.addChild(treesharksLogo);\n }","start() {// [3]\n }","function renderStartPage() {\n addView(startPage());\n}","onCreate(scene, custom) {}","function start() {\n startMove = -kontra.canvas.width / 2 | 0;\n startCount = 0;\n\n audio.currentTime = 0;\n audio.volume = options.volume;\n audio.playbackRate = options.gameSpeed;\n\n ship.points = [];\n ship.y = mid;\n\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\n showTutorialBars = true;\n isTutorial = true;\n tutorialScene.show();\n}","function startDemo() {\n View.set('Demo');\n }","function start()\n{\n clear();\n console.log(\"==============================================\\n\");\n console.log(\" *** Welcome to the Interstellar Pawn Shop *** \\n\");\n console.log(\"==============================================\\n\");\n console.log(\"We carry the following items:\\n\");\n readCatalog();\n}","function start() {\n\n console.log(\"\\n\\t ------------Welcome to Bamazon Store-------------\");\n showProducts();\n\n\n\n}","function Start(){\n activeScene.traverse(function(child){\n if(child.awake != undefined){\n child.awake();\n }\n });\n\n activeScene.traverse(function(child){\n if(child.start != undefined){\n child.start();\n }\n });\n activeScene.isReady = true;\n}","function setup_goToStart(){\n // what happens when we move to 'goToStart' section of a trial\n wp.trialSection = 'goToStart';\n unstageArray(fb_array);\n\n // update objects\n choiceSet.arc.visible = false;\n choiceSet.arc_glow.visible = false;\n startPoint.sp.visible = true;\n startPoint.sp_glow.visible = false;\n\n // update messages\n msgs.goToStart.visible = true;\n msgs.tooSlow.visible = false;\n\n stage.update();\n }","function createStart(){\n // scene components\n startScreen = initScene();\n startText = createSkyBox('libs/Images/startscene.png', 10);\n startScreen.add(startText);\n\n // lights\n \t\tvar light = createPointLight();\n \t\tlight.position.set(0,200,20);\n \t\tstartScreen.add(light);\n\n // camera\n \t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\n \t\tstartCam.position.set(0,50,1);\n \t\tstartCam.lookAt(0,0,0);\n }","function start() {\n\n // Make sure we've got all the DOM elements we need\n setupDOM();\n\n // Updates the presentation to match the current configuration values\n configure();\n\n // Read the initial hash\n readURL();\n\n // Notify listeners that the presentation is ready but use a 1ms\n // timeout to ensure it's not fired synchronously after #initialize()\n setTimeout(function () {\n dispatchEvent('ready', {\n 'indexh': indexh,\n 'indexv': indexv,\n 'currentSlide': currentSlide\n });\n }, 1);\n\n }","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n }","function start () {\n gmCtrl.setObj();\n uiCtrl.setUi();\n }","function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}","function gamestart() {\n\t\tshowquestions();\n\t}","function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}","function begin() {\n\tbackgroundBox = document.getElementById(\"BackgroundBox\");\n\n\tbuildGameView();\n\tbuildMenuView();\n\n\tinitSFX();\n\tinitMusic();\n\n\tENGINE_INT.start();\n\n\tswitchToMenu(new TitleMenu());\n\t//startNewGame();\n}","function startScreen() {\n mainContainer.append(startButton)\n }","function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}","function start() {\n\n}","async start() {\n // Navbar in header\n this.navbar = new Navbar();\n this.navbar.render('header');\n\n // Footer renderin\n this.footer = new Footer();\n this.footer.render('footer');\n\n this.myFavorites = new Favorites();\n\n setTimeout(() => {\n this.router = new Router(this.myFavorites);\n }, 0)\n }","initializeScene(){}","function startRitual() {\n\tconsole.log(\"** glitter **\");\n\tflash(pump);\n}","StartGame(player, start){\n this.scene.start('level1');\n }","function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }","start () {\n // Draw the starting point for the view with no elements\n }","start () {\n // Draw the starting point for the view with no elements\n }","doReStart() {\n // Stoppe la musique d'intro\n this.musicIntro.stop();\n // Lance la scene de menus\n this.scene.start('MenuScene');\n }","function start() {\n //Currently does nothing\n }","async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-start/page-start.html\");\n let css = await fetch(\"page-start/page-start.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n this._pageDom = document.createElement(\"div\");\n this._pageDom.innerHTML = html;\n\n await this._renderReciepts(this._pageDom);\n\n this._app.setPageTitle(\"Startseite\", {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(this._pageDom.querySelector(\"header\"));\n this._app.setPageContent(this._pageDom.querySelector(\"main\"));\n\n this._countDown();\n }","function run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}","start() {// Your initialization goes here.\n }","function start() {\n\tdocument.body.appendChild(object({ type: \"main\", id: \"content\" }));\n}","function start() {\n getTodosFromLs();\n addTodoEventListeners();\n sidebar();\n updateTodaysTodoList();\n calendar();\n}","function createFirstScene() {\n makeRect(0, 0, 30000, 3000, \"darkcyan\", 1)\n makeRect(119, 30, 30, 2, \"brown\", 1)\n makeRect(51, 30, 30, 2, \"brown\", 1)\n makeCircle(100, 30, 20, \"white\", 1)\n makeEllipse(100, 10, 12, 10, \"white\", 1)\n makeCircle(100, 60, 30, \"white\", 1)\n \n \n}","function startLevel1(){\n teleMode = false;\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('state0');\n }, this);\n}","function start() {\n INFO(\"start\", clock()+\"msecs\")\n loadThemeScript();\n if (window.MathJax)\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);\n beginInteractionSessions(QTI.ROOT);\n setTimeout(initializeCurrentItem, 100);\n setInterval(updateTimeLimits, 100);\n document.body.style.display=\"block\";\n INFO(\"end start\", clock()+\"msecs\");\n }","function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","function start(){\n // First/starting background\n imageMode(CENTER);\n image(gamebackground, width/2, height/2, width, height);\n fill(255);\n text(\"Master of Pie\", width/2 - width/20, height/4);\n text(\"Start\", width/2 - width/75, height/2);\n text(\"(Landscape Orientation Preferred)\", width/2 - width/10, height/4 + height/14);\n // Pizzas array is cleared\n pizzas = [];\n // Creates the ship\n ship = new Spacecraft();\n // Creates pizzas/asteroids at random places offscreen\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\n }\n // Reset variables\n click3 = true;\n reload = 10;\n piecutter = [];\n pizzaorder = 1;\n level = 1;\n}","create(){\n this.scene.start('MenuGame');\n }","function startApp() {\n displayProducts();\n}","function start() {\n\n id = realtimeUtils.getParam('id');\n if (id) {\n // Load the document id from the URL\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\n init();\n } else {\n // Create a new document, add it to the URL\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\n window.history.pushState(null, null, '?id=' + createResponse.id);\n id=createResponse.id;\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\n init();\n });\n \n }\n \n \n }","function startup() {\n\tsaveSlot('rainyDayZRestart');\n\tfooterVisibility = document.getElementById(\"footer\").style.visibility;\n\tfooterHeight = document.getElementById(\"footer\").style.height;\t\n\tfooterOverflow = document.getElementById(\"footer\").style.overflow;\t\n\twrapper.scrollTop = 0;\n\tupdateMenu();\n\thideStuff();\n\tif(localStorage.getItem('rainyDayZAuto')) {\n\t\tloadSlot('rainyDayZAuto');\n\t}\n\telse{\n\t\tsceneTransition('start');\n\t}\n}","function requestFish() {\n // all_stopped = 1;\n //addFish++;\n\n view.resize(300,300);\n aquarium.viewport(300,300)\n aquarium.prepare();\n}","function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.Clean();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }","function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}","function start() {\n console.log(\"Animation Started\");\n\n let masterTl = new TimelineMax();\n\n //TODO: add childtimelines to master\n masterTl\n .add(clearStage(), \"scene-clear-stage\")\n .add(enterFloorVegetation(), \"scene-floor-vegitation\")\n .add(enterTreeStuff(), \"tree-stuff\");\n }","function start() {\n init();\n run();\n }","function startEncounter(){\n\tthis.scene.start('Battle', {type: 'encounter'})\n}","startScene() {\n console.log('[Game] startScene');\n var that = this;\n\n if (this.scene) {\n console.log('[Game] loading scene');\n this.scene.load().then(() => {\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\n // setTimeout(function() {\n debugger;\n that.scene.start();\n debugger;\n that._runSceneLoop();\n that._renderSceneLoop();\n // }, 0);\n });\n } else {\n console.log('[Game] nothing to start: no scene selected!!');\n }\n }","go() {\n\t\tthis.context.analytics.record(\"Game Loaded\");\n\t\tthis._$template.css({ \"visibility\": \"visible\"}).hide().fadeIn();\n\t\tthis._$start = $(\".start\", this._$template);\n\n\t\tthis._$start.on('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tthis._$template.fadeOut(() => {\n\t\t\t\tthis.nextState(\"playing\");\n\t\t\t});\n\t\t});\n\t}","Main() {\n // add the welcome label to the scene\n this.addChild(this._overLabel);\n // add the backButton to the scene\n this.addChild(this._backButton);\n // event listeners\n this._backButton.on(\"click\", this._backButtonClick);\n }","function start_view() {\n editor_visibility(true);\n button_visibility('view-mode');\n d3.json(resource_url(), editor_callback);\n}","function main() {\n startSlideShowAnimation();\n renderProject();\n}","function start() {\n //switch to scene 1\n window.inventoryActive = \"\";\n window.inventoryActive2 = \"\";\n window.inventory[1]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[2]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[3]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[4]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[5]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[6]= {id:\"\", inspected:false, desciption:\"\"};\n window.timerTime = null;\n window.inspectResultReceived =0;\n window.activeSlot = \"\";\n window.inspectResult= \"\";\n \n}","function start() {\n action(1, 0, 0);\n}","create() {\n // We have nothing left to do here. Start the next scene.\n \n\n this.input.on('pointerdown', function (pointer) {\n\n this.scene.start('Game');\n }, this);\n\n \n }","function initiatePage () {\n\t highlightDayOfTheWeek();\n\t populateHairdresserContainer();\n\t animateContainer(true, '#who');\n\t window.setTimeout(function () { autoScrollSlideshow(); }, 4000);\n\t}","function createFirstScene() {\nmakeRect(0,25,200,100,\"black\",0.6) \n makeCircle(100,52,25,\"orange\",1)\nmakeRect(90,75,20,8,\"red\",1)\nmakeRect(90,37,20,3,\"red\",0.4)\nmakeCircle(115,43,4,\"black\",0.9)\nmakeCircle(85,43,4,\"black\",0.9)\nmakeCircle(100,53,2,\"black\",0.9)\nmakeEllipse(100,27,28,10,1)\nmakeLine(123,61,77,61,\"black\",1)\nmakeCircle(100,112,35,\"black\",0.9)\nmakeLine(124,87,76,87,\"white\",1)\nmakeLine(131,97,69,97,\"white\",1)\nmakeCircle(100,25,2,\"white\")\nmakeImage(\"http://www.drodd.com/images15/canada-flag15.gif\",0,1,70,30,1)\nmakeLine(12,20,12,50,\"white\",4,1)\n var randomstuff= Math.random()\n if(randomstuff <0.4){\n makeText(\"Im a Canadian\",80,80,20,10,\"red\")\n }\n}","function showStart() {\n layout.RemoveChild(loading);\n layout.AddChild(text);\n layout.AddChild(startButton);\n clearInterval(loadTime);\n\n // Setup arrows\n res.arrowTL_png.SetPosition(0, 0);\n res.arrowTR_png.SetPosition(0.9, 0);\n res.arrowBL_png.SetPosition(0, 0.85);\n res.arrowBR_png.SetPosition(0.9, 0.85);\n}","function init() {\n createWelcomeGraphic();\n console.log('WELCOME TO ASSOCIATE MANAGER!');\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\n}","function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.removeAllChildren();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }","function generateScenes() { \n\n\tsceneIndex.push(new Scene(1,'Change the Future',bg.themes.grey,{sel:'#future',offset:0}));\n\tsceneIndex.push(new Scene(2,'Bitcoin Intro',bg.themes.grey,{sel:'#intro',offset:0,segueEnterDown:animations.fadeIntroText}));\n\tsceneIndex.push(new Scene(3,'Bank',bg.themes.white,{sel:'#bank',offset:0,segueEnterDown:animations.decentralize},svg.drawBankLines));\n\tsceneIndex.push(new Scene(4,'Use Case',bg.themes.white,{sel:'#usecase',offset:0,segueEnterDown:interactions.waitUseCase}));\n\tsceneIndex.push(new Scene(5,'Addresses',bg.themes.white,{sel:'#address',offset:0}));\t\n\tsceneIndex.push(new Scene(6,'Pick Address',bg.themes.white,{sel:'#pickaddress',offset:0,segueEnterDown:interactions.waitAddress}));\t\n\tsceneIndex.push(new Scene(7,'Use Address',bg.themes.white,{sel:'#useaddress',offset:0}));\t\n\tsceneIndex.push(new Scene(8,'Secret Key',bg.themes.white,{sel:'#secretkey',offset:0,segueEnterDown:animations.rotateCycle}));\n\tsceneIndex.push(new Scene(9,'Your Account',bg.themes.white,{sel:'#account',offset:0}));\n\tsceneIndex.push(new Scene(10,'Transfer',bg.themes.white,{sel:'#transfer',offset:0,segueEnterDown:interactions.waitTransfer}));\n\tsceneIndex.push(new Scene(11,'Transaction',bg.themes.white,{sel:'#transaction',offset:0}));\n\tsceneIndex.push(new Scene(12,'Ledger',bg.themes.white,{sel:'#ledger',offset:0,segueEnterDown:animations.solveBlock,segueEnterUp:animations.undoBlock}));\n\tsceneIndex.push(new Scene(13,'Package',bg.themes.white,{sel:'#package',offset:0}));\n\tsceneIndex.push(new Scene(14,'Reward',bg.themes.gradient,{sel:'#reward',offset:0}));\n\tsceneIndex.push(new Scene(15,'Network',bg.themes.grey,{sel:'#network',offset:0}));\n\tsceneIndex.push(new Scene(16,'Block Chain',bg.themes.grey,{sel:'#blockchain',offset:0}));\n\tsceneIndex.push(new Scene(17,'Resolution',bg.themes.grey,{sel:'#resolution',offset:0}));\n\tsceneIndex.push(new Scene(18,'Medium',bg.themes.grey,{sel:'#medium',offset:0}));\n\n\t_.indexBy(sceneIndex,'sceneIndex');\n\n\t// Add ScrollMagic listeners for scenes\n\t_.each(sceneIndex, function(val,key) {\n\n\t\tval.init();\n\n\t\t// Animated segues\n\t\tvar trigger = new ScrollMagic.Scene({\n\t\ttriggerElement: val.segue.sel,\n\t\toffset: 200,\n\t\tduration: val.height\n\t\t})\n\t\t.on(\"enter leave\", function(e) {\n\t\t\tvar enter = e.type === \"enter\";\n\t\t\tvar down = e.scrollDirection === \"FORWARD\";\n\t\t\tval.segueScene(enter,down);\n\t\t})\n\t\t//.addIndicators()\n\t\t.addTo(window.controller);\n\n\t\t// Pin the page\n\t\tvar pin = new ScrollMagic.Scene({\n\t\t triggerElement: \".scene\"+val.sceneIndex, // point of execution\n\t\t duration: $(window).height() - val.segue.offset, // pin element for the window height - 1\n\t\t triggerHook: 0, // don't trigger until trigger hits the top of the viewport\n\t\t reverse: true // allows the effect to trigger when scrolled in the reverse direction\n\t\t})\n\t\t//.addIndicators()\n\t\t.setPin(\".scene\"+val.sceneIndex) // the element we want to pin\n\t\t.addTo(window.controller);\n\n\t\t// Background DOWNWARD transitions\n\t\tvar downward = new ScrollMagic.Scene({\n\t\t\ttriggerElement: '.scene'+val.sceneIndex,\n\t\t\toffset: -200,\n\t\t\tduration: val.height\n\t\t})\n\t\t.on(\"enter leave\", function(e) {\n\t\t\tvar enter = e.type === \"enter\";\n\t\t\tvar down = e.scrollDirection === \"FORWARD\";\n\t\t\t(enter && down) && val.bgState();\n\t\t\tenter && breadcrumbs.open(val.sceneIndex);\n\t\t})\n\t\t.addTo(window.controller);\n\n\t\t// Background UPWARD transitions\n\t\tvar upward = new ScrollMagic.Scene({\n\t\t\ttriggerElement: '.scene'+val.sceneIndex,\n\t\t\toffset: 400,\n\t\t\tduration: val.height\n\t\t})\n\t\t.on(\"enter leave\", function(e) {\n\t\t\tvar enter = e.type === \"enter\";\n\t\t\tvar down = e.scrollDirection === \"FORWARD\";\n\t\t\t(val.sceneIndex > 0) && (enter && !down) && sceneIndex[val.sceneIndex-1].bgState();\n\t\t})\n\t\t.addTo(window.controller);\n\t\t\t\t\n\t})\n\n\tgenerateTweens();\n\tgenerateSceneListeners();\n\tbreadcrumbs.init();\n}","function start(){\r\n\t\t// for now, start() will call _draw(), which draws all the objects on the stage\r\n\t\t// but in the next lesson, we'll add an animation loop that calls _draw()\r\n\t\t_draw(ctx);\r\n\t}","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n this._router.resolve();\n }","show ()\n\t{\n\t\t//if the view hasn't been initialised, call setup (of the concrete view e.g. LOView)\n\t\tif(!this.initialised)\n\t\t{\n\t\t\tthis.setup();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//unhide the elements of the scene\n\t\t\tthis.root.style.display = 'block';\n\t\t}\n\t}","function startScreen() {\n\t\t\tinitialScreen =\n\t\t\t\t\"

    Start Quiz

    \";\n\t\t\t$( \".mainArea\" )\n\t\t\t\t.html( initialScreen );\n\t\t}","function startGame() {\r\n if (pressed == 0) {\r\n createRain();\r\n animate();\r\n }\r\n }","function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}","function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }","create(){\n this.add.text(20, 20, \"LoadingGame...\")\n\n this.time.addEvent({\n delay: 3000, // ms\n callback: function(){this.scene.start('MenuScene')},\n //args: [],\n callbackScope: this,\n loop: true \n });\n\n \n }","function frontPage() {\n console.log(\"Welcome to Reddit! the front page of the internet\");\n fpMenu();\n\n\n}","function reactionStart () {\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\n switchButton2(); // Zustand des Schaltknopfs ändern\n enableInput(false); // Eingabefelder deaktivieren\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\n else stopAnimation(); // ... oder stoppen\n reaction(); // Eingegebene Werte übernehmen und rechnen\n paint(); // Neu zeichnen\n }","function onCreate() {\n\n /* -------------------------------*/\n /* Setting the stage */\n /* -------------------------------*/\n\n // **** Create our scene ***\n initScene();\n\n // **** Set up the Renderer ***\n initRenderer();\n\n // **** Setup Container stuff ***\n initContainer();\n\n // *** Setup the Halo stats div ***\n initStatsInfo();\n\n // **** DAT GUI! ***\n initGUI();\n\n // **** Setup our slider ***\n initSlider();\n\n\n /* -------------------------------*/\n /* Organizing our Actors */\n /* -------------------------------*/\n\n // Load Data for Halo // TREE679582 TREE676638\n initHaloTree(TREE676638, true);\n\n // **** Lights! ***\n initLights();\n\n // **** Camera! ***\n initCamera();\n\n // **** Setup our Raycasting stuff ***\n initRayCaster();\n\n // **** Action! Listeners *** //\n initListeners();\n\n\n}","constructor()\n {\n // calling the super to inniciate this class as a scene\n super();\n }","function startGame() {\n let gameBoard = document.getElementById('gameBoard');\n let tutorial = document.getElementById('tutorial');\n gameBoard.style.display = \"block\";\n tutorial.style.display = \"none\";\n addGround();\n addTree(treeCenter, trunkHeight);\n addBush(bushStart);\n addStones(stoneStart);\n addCloud(cloudStartX, cloudStartY);\n addingEventListenersToGame();\n addingEventListenersToTools();\n addInventoryEventListeners()\n}","function FXstart (){\n setTimeout(FXdisplayLaunch, 1500);\n FXweatherGeolocation();\n FXdisplayMarsWeather();\n }","function start() {\n $('#waitPanel').remove();\n\n // build slides dynamically\n const slides = $('div.slides');\n const areyoureadyTemplate = $('#areyouready-template').html();\n slides.append(areyoureadyTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n const wordTemplate = $('#word-template').html();\n $.each(sessionData['wordList'], function(idx, data) {\n slides.append(wordTemplate\n .replace(/ID/g, idx+1)\n );\n });\n const goodjobTemplate = $('#goodjob-template').html();\n slides.append(goodjobTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n\n Reveal.initialize({\n controlsLayout: \"edges\",\n overview: false,\n autoPlayMedia: true,\n hash: false,\n viewDistance: Number.MAX_VALUE,\n keyboard: {\n 13: listenAgain,\n 65: listenAgain, // A - again\n 82: listenAgain, // R - repeat\n }\n });\n\n Reveal.addEventListener('slidechanged', function(p) {\n const slideNum = p['indexh'];\n playSound(slideNum);\n });\n\n // change to first (later changes will be captured above\n playSound(0);\n}","start(event){\n console.warn(\"ZOOTYMON GO!\");\n $('.firstpage').hide();\n $('.dino2').hide();\n zootyMon.progressbar();\n const $name = $('input').val();\n $('.nameInput').text($name);\n zootyMon.increaseAge();\n zootyMon.morph();\n zootyMon.animateZootymon();\n \n \n }","function Start() {\n console.log(`%c Start Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = Config.Game.FPS;\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\n Main();\n }"],"string":"[\n \"function start() {\\n // To present a scene, use the following line, replacing 'sample' with\\n // the id of any scene you want to present.\\n\\n SceneManager.getSharedInstance().presentScene('newScene1');\\n}\",\n \"function startup() {\\n\\tsceneTransition(\\\"start\\\");\\n}\",\n \"function start() {\\n for(var i = 0; i < sceneList.length; i++) {\\n addScene(sceneList[i]); // sceneList.js is imported in html-file\\n }\\n setScene(\\\"start\\\");\\n }\",\n \"static start() {\\n this.buttonCreate();\\n this.buttonHideModal();\\n\\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\\n // Animal.createAnimal('Liutas', 35, 'brown', false);\\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\\n\\n this.load();\\n }\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Plague()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"function sceneStart(){\\n\\t\\t\\t\\tfor (n = 0; n < heroes.length; n++)\\n\\t\\t\\t\\t\\theroes[n].tl.delay(20).fadeIn(35);\\n\\t\\t\\t\\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\\n\\t\\t\\t\\tgame.sceneStarted = true;\\n\\t\\t\\t\\tthreatBar.opacity = 1;\\n\\t\\t\\t\\tthreatGuage.opacity = 1;\\n\\t\\t\\t\\tmonsterBox.opacity = 1;\\n\\t\\t\\t\\tmonsterName.opacity = 1;\\n\\t\\t\\t\\tpartyBox.opacity = 1;\\n\\t\\t\\t\\tmuteButton.opacity = 1;\\n\\t\\t\\t\\tfor (n = 0; n < nameLabels.length; n++){\\n\\t\\t\\t\\t\\tnameLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\thpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmaxhpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmpLabels[n].opacity = 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t\\t}\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Galaga()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"_start() {\\n\\n this._menuView = new MenuView(\\n document.querySelector('nav'),\\n this.sketches\\n );\\n\\n for (var key in this.sketches) {\\n this.DEFAULT_SKETCH = key;\\n break;\\n }\\n\\n this._setupScroll();\\n this._setupWindow();\\n this._onHashChange();\\n }\",\n \"function App() {\\n var mouse = DreamsArk.module('Mouse');\\n //\\n // /**\\n // * start Loading the basic scene\\n // */\\n DreamsArk.load();\\n //\\n // mouse.click('#start', function () {\\n //\\n // start();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.skipper', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('#skip', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.reseter', function () {\\n //\\n // location.reload();\\n //\\n // return true;\\n //\\n // });\\n }\",\n \"function start() {\\n restarts++;\\n currentScene = scenes[0];\\n currentTextIndex = 0;\\n\\n setMainImage();\\n setMainText();\\n hideSetup();\\n updateStats();\\n}\",\n \"function start(action) {\\r\\n\\t\\r\\n\\t\\tswitch (action) {\\r\\n\\t\\t\\tcase 'go look':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: What are you going to look at??\\\", 1000);\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'explore':\\r\\n\\t\\t\\t\\texploreship(gameobj.explore);\\r\\n\\t\\t\\t\\tgameobj.explore++;\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'sit tight':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: Good choice we should probably wait for John to get back.\\\", 1000);\\r\\n\\t\\t\\t\\tgameobj.sittight++;\\r\\n\\t\\t\\tbreak;\\t\\r\\n\\t\\t}\\r\\n}\",\n \"function go() {\\n console.log('go...')\\n \\n const masterT = new TimelineMax();\\n \\n masterT\\n .add(clearStage(), 'scene-clear-stage')\\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\\n .add(enterTreeStuff(), 'scene-enter-treestuff')\\n .add(enterGreet(), 'scene-enter-greet')\\n ;\\n }\",\n \"function main(){\\n\\t//Initialice with first episode\\n\\tvar sel_episodes = [1]\\n\\t//collage(); //Create a collage with all the images as initial page of the app\\n\\tpaintCharacters();\\n\\tpaintEpisodes();\\n\\tpaintLocations(sel_episodes);\\n}\",\n \"startGame() {\\n this.scene.start('MenuScene');\\n }\",\n \"function start(){\\n renderGameField();\\n resizeGameField();\\n spawnSnake();\\n spawnFood();\\n eatFood();\\n renderSnake();\\n}\",\n \"function loadStart() {\\n // Prepare the screen and load new content\\n collapseHeader(false);\\n wipeContents();\\n loadHTML('#info-content', 'ajax/info.html');\\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\\n loadScript(\\\"js/flag-events.js\\\");\\n });\\n}\",\n \"function start(){\\n\\t\\t //Initialize this Game. \\n newGame(); \\n //Add mouse click event listeners. \\n addListeners();\\n\\t\\t}\",\n \"function initScene1() {\\n if (currentScene === 1) {\\n\\n $('#game1').show(\\\"fast\\\");\\n\\n //clique sur une porte\\n $('.dungeon0Door').on('click', function (e) {\\n console.log(currentScene);\\n if (consumeEnergy(10)) {\\n if (oD10.roll() >= 8) {\\n printConsole('Vous vous echappez du donjon');\\n loadScene(2);\\n } else {\\n printConsole(\\\"Ce n'est pas la bonne porte ..\\\");\\n $('.dungeon0Door').animate({\\n opacity: '0'\\n }, 'slow', function () {\\n $('.dungeon0Door').animate({\\n opacity: '1'\\n }, 'fast');\\n });\\n }\\n }\\n });\\n }\\n }\",\n \"create() {\\n\\n // add animations (for all scenes)\\n this.addAnimations();\\n\\n // change to the \\\"Home\\\" scene and provide the default chord progression / sequence\\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\\n }\",\n \"function start(){\\n\\t\\n}\",\n \"function Aside() {\\n appStarted = true;\\n // all objects added to the stage appear in \\\"layer order\\\"\\n // add a helloLabel to the stage\\n seeMore = new objects.Label(\\\"Click me to see more of my work\\\", \\\"32px\\\", \\\"Times New Roman\\\", \\\"#000000\\\", canvasHalfWidth, canvasHalfHeight + 200, true);\\n stage.addChild(seeMore);\\n // add a clickMeButton to the stage\\n treesharksLogo = new objects.Icon(loader, \\\"treesharksLogo\\\", canvasHalfWidth, canvasHalfHeight - 100, true);\\n stage.addChild(treesharksLogo);\\n }\",\n \"start() {// [3]\\n }\",\n \"function renderStartPage() {\\n addView(startPage());\\n}\",\n \"onCreate(scene, custom) {}\",\n \"function start() {\\n startMove = -kontra.canvas.width / 2 | 0;\\n startCount = 0;\\n\\n audio.currentTime = 0;\\n audio.volume = options.volume;\\n audio.playbackRate = options.gameSpeed;\\n\\n ship.points = [];\\n ship.y = mid;\\n\\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\\n showTutorialBars = true;\\n isTutorial = true;\\n tutorialScene.show();\\n}\",\n \"function startDemo() {\\n View.set('Demo');\\n }\",\n \"function start()\\n{\\n clear();\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\" *** Welcome to the Interstellar Pawn Shop *** \\\\n\\\");\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\"We carry the following items:\\\\n\\\");\\n readCatalog();\\n}\",\n \"function start() {\\n\\n console.log(\\\"\\\\n\\\\t ------------Welcome to Bamazon Store-------------\\\");\\n showProducts();\\n\\n\\n\\n}\",\n \"function Start(){\\n activeScene.traverse(function(child){\\n if(child.awake != undefined){\\n child.awake();\\n }\\n });\\n\\n activeScene.traverse(function(child){\\n if(child.start != undefined){\\n child.start();\\n }\\n });\\n activeScene.isReady = true;\\n}\",\n \"function setup_goToStart(){\\n // what happens when we move to 'goToStart' section of a trial\\n wp.trialSection = 'goToStart';\\n unstageArray(fb_array);\\n\\n // update objects\\n choiceSet.arc.visible = false;\\n choiceSet.arc_glow.visible = false;\\n startPoint.sp.visible = true;\\n startPoint.sp_glow.visible = false;\\n\\n // update messages\\n msgs.goToStart.visible = true;\\n msgs.tooSlow.visible = false;\\n\\n stage.update();\\n }\",\n \"function createStart(){\\n // scene components\\n startScreen = initScene();\\n startText = createSkyBox('libs/Images/startscene.png', 10);\\n startScreen.add(startText);\\n\\n // lights\\n \\t\\tvar light = createPointLight();\\n \\t\\tlight.position.set(0,200,20);\\n \\t\\tstartScreen.add(light);\\n\\n // camera\\n \\t\\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\\n \\t\\tstartCam.position.set(0,50,1);\\n \\t\\tstartCam.lookAt(0,0,0);\\n }\",\n \"function start() {\\n\\n // Make sure we've got all the DOM elements we need\\n setupDOM();\\n\\n // Updates the presentation to match the current configuration values\\n configure();\\n\\n // Read the initial hash\\n readURL();\\n\\n // Notify listeners that the presentation is ready but use a 1ms\\n // timeout to ensure it's not fired synchronously after #initialize()\\n setTimeout(function () {\\n dispatchEvent('ready', {\\n 'indexh': indexh,\\n 'indexv': indexv,\\n 'currentSlide': currentSlide\\n });\\n }, 1);\\n\\n }\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n }\",\n \"function start () {\\n gmCtrl.setObj();\\n uiCtrl.setUi();\\n }\",\n \"function startGame(mapName = 'galaxy'){\\n toggleMenu(currentMenu);\\n if (showStats)\\n $('#statsOutput').show();\\n $('#ammoBarsContainer').show();\\n scene.stopTheme();\\n scene.createBackground(mapName);\\n if (firstTime) {\\n firstTime = false;\\n createGUI(true);\\n render();\\n } else {\\n requestAnimationFrame(render);\\n }\\n}\",\n \"function gamestart() {\\n\\t\\tshowquestions();\\n\\t}\",\n \"function fastFoodRestaurantScene() {\\n subTitle.innerText = fastfoodWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fastDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFastRestaurantChoice();\\n}\",\n \"function begin() {\\n\\tbackgroundBox = document.getElementById(\\\"BackgroundBox\\\");\\n\\n\\tbuildGameView();\\n\\tbuildMenuView();\\n\\n\\tinitSFX();\\n\\tinitMusic();\\n\\n\\tENGINE_INT.start();\\n\\n\\tswitchToMenu(new TitleMenu());\\n\\t//startNewGame();\\n}\",\n \"function startScreen() {\\n mainContainer.append(startButton)\\n }\",\n \"function startGame() {\\n\\t\\tstatus.show();\\n\\t\\tinsertStatusLife();\\n\\t\\tsetLife(100);\\n\\t\\tsetDayPast(1);\\n\\t}\",\n \"function start() {\\n\\n}\",\n \"async start() {\\n // Navbar in header\\n this.navbar = new Navbar();\\n this.navbar.render('header');\\n\\n // Footer renderin\\n this.footer = new Footer();\\n this.footer.render('footer');\\n\\n this.myFavorites = new Favorites();\\n\\n setTimeout(() => {\\n this.router = new Router(this.myFavorites);\\n }, 0)\\n }\",\n \"initializeScene(){}\",\n \"function startRitual() {\\n\\tconsole.log(\\\"** glitter **\\\");\\n\\tflash(pump);\\n}\",\n \"StartGame(player, start){\\n this.scene.start('level1');\\n }\",\n \"function startGame(){\\n getDictionary();\\n var state = $.deparam.fragment();\\n options.variant = state.variant || options.variant;\\n makeGameBoard();\\n loadState();\\n }\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"doReStart() {\\n // Stoppe la musique d'intro\\n this.musicIntro.stop();\\n // Lance la scene de menus\\n this.scene.start('MenuScene');\\n }\",\n \"function start() {\\n //Currently does nothing\\n }\",\n \"async show() {\\n // Anzuzeigenden Seiteninhalt nachladen\\n let html = await fetch(\\\"page-start/page-start.html\\\");\\n let css = await fetch(\\\"page-start/page-start.css\\\");\\n\\n if (html.ok && css.ok) {\\n html = await html.text();\\n css = await css.text();\\n } else {\\n console.error(\\\"Fehler beim Laden des HTML/CSS-Inhalts\\\");\\n return;\\n }\\n\\n // Seite zur Anzeige bringen\\n this._pageDom = document.createElement(\\\"div\\\");\\n this._pageDom.innerHTML = html;\\n\\n await this._renderReciepts(this._pageDom);\\n\\n this._app.setPageTitle(\\\"Startseite\\\", {isSubPage: true});\\n this._app.setPageCss(css);\\n this._app.setPageHeader(this._pageDom.querySelector(\\\"header\\\"));\\n this._app.setPageContent(this._pageDom.querySelector(\\\"main\\\"));\\n\\n this._countDown();\\n }\",\n \"function run() { \\n\\n moveToNewspaper();\\n pickBeeper();\\n returnHome();\\n\\n}\",\n \"start() {// Your initialization goes here.\\n }\",\n \"function start() {\\n\\tdocument.body.appendChild(object({ type: \\\"main\\\", id: \\\"content\\\" }));\\n}\",\n \"function start() {\\n getTodosFromLs();\\n addTodoEventListeners();\\n sidebar();\\n updateTodaysTodoList();\\n calendar();\\n}\",\n \"function createFirstScene() {\\n makeRect(0, 0, 30000, 3000, \\\"darkcyan\\\", 1)\\n makeRect(119, 30, 30, 2, \\\"brown\\\", 1)\\n makeRect(51, 30, 30, 2, \\\"brown\\\", 1)\\n makeCircle(100, 30, 20, \\\"white\\\", 1)\\n makeEllipse(100, 10, 12, 10, \\\"white\\\", 1)\\n makeCircle(100, 60, 30, \\\"white\\\", 1)\\n \\n \\n}\",\n \"function startLevel1(){\\n teleMode = false;\\n fadeAll();\\n game.time.events.add(500, function() {\\n game.state.start('state0');\\n }, this);\\n}\",\n \"function start() {\\n INFO(\\\"start\\\", clock()+\\\"msecs\\\")\\n loadThemeScript();\\n if (window.MathJax)\\n MathJax.Hub.Queue([\\\"Typeset\\\", MathJax.Hub]);\\n beginInteractionSessions(QTI.ROOT);\\n setTimeout(initializeCurrentItem, 100);\\n setInterval(updateTimeLimits, 100);\\n document.body.style.display=\\\"block\\\";\\n INFO(\\\"end start\\\", clock()+\\\"msecs\\\");\\n }\",\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"function start(){\\n // First/starting background\\n imageMode(CENTER);\\n image(gamebackground, width/2, height/2, width, height);\\n fill(255);\\n text(\\\"Master of Pie\\\", width/2 - width/20, height/4);\\n text(\\\"Start\\\", width/2 - width/75, height/2);\\n text(\\\"(Landscape Orientation Preferred)\\\", width/2 - width/10, height/4 + height/14);\\n // Pizzas array is cleared\\n pizzas = [];\\n // Creates the ship\\n ship = new Spacecraft();\\n // Creates pizzas/asteroids at random places offscreen\\n for(let i = 0; i < pizzaorder; i++){\\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\\n }\\n // Reset variables\\n click3 = true;\\n reload = 10;\\n piecutter = [];\\n pizzaorder = 1;\\n level = 1;\\n}\",\n \"create(){\\n this.scene.start('MenuGame');\\n }\",\n \"function startApp() {\\n displayProducts();\\n}\",\n \"function start() {\\n\\n id = realtimeUtils.getParam('id');\\n if (id) {\\n // Load the document id from the URL\\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\\n init();\\n } else {\\n // Create a new document, add it to the URL\\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\\n window.history.pushState(null, null, '?id=' + createResponse.id);\\n id=createResponse.id;\\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\\n init();\\n });\\n \\n }\\n \\n \\n }\",\n \"function startup() {\\n\\tsaveSlot('rainyDayZRestart');\\n\\tfooterVisibility = document.getElementById(\\\"footer\\\").style.visibility;\\n\\tfooterHeight = document.getElementById(\\\"footer\\\").style.height;\\t\\n\\tfooterOverflow = document.getElementById(\\\"footer\\\").style.overflow;\\t\\n\\twrapper.scrollTop = 0;\\n\\tupdateMenu();\\n\\thideStuff();\\n\\tif(localStorage.getItem('rainyDayZAuto')) {\\n\\t\\tloadSlot('rainyDayZAuto');\\n\\t}\\n\\telse{\\n\\t\\tsceneTransition('start');\\n\\t}\\n}\",\n \"function requestFish() {\\n // all_stopped = 1;\\n //addFish++;\\n\\n view.resize(300,300);\\n aquarium.viewport(300,300)\\n aquarium.prepare();\\n}\",\n \"function Main() {\\n console.log(\\\"%c Scene Switched...\\\", \\\"color: green; font-size: 16px;\\\");\\n // clean up\\n if (currentSceneState != scenes.State.NO_SCENE) {\\n currentScene.Clean();\\n stage.removeAllChildren();\\n }\\n // switch to the new scene\\n switch (config.Game.SCENE) {\\n case scenes.State.START:\\n console.log(\\\"switch to Start Scene\\\");\\n currentScene = new scenes.Start();\\n break;\\n case scenes.State.PLAY:\\n console.log(\\\"switch to Play Scene\\\");\\n currentScene = new scenes.Play();\\n break;\\n case scenes.State.END:\\n console.log(\\\"switch to End Scene\\\");\\n currentScene = new scenes.End();\\n break;\\n }\\n currentSceneState = config.Game.SCENE;\\n stage.addChild(currentScene);\\n }\",\n \"function startGame(){\\n \\t\\tGameJam.sound.play('start');\\n \\t\\tGameJam.sound.play('run');\\n\\t\\t\\n\\t\\t// Put items in the map\\n\\t\\titemsToObstacles(true);\\n\\n\\t\\t// Create the prisoner path\\n\\t\\tGameJam.movePrisoner();\\n\\n\\t\\t// Reset items, we dont want the user to be able to drag and drop them\\n \\t\\tGameJam.items = [];\\n \\t\\t\\n \\t\\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\\n \\t\\t\\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\\n \\t\\t}\\n\\n\\t\\t// Reset prisoner speed\\n\\t\\tGameJam.prisoner[0].sprite.speed = 5;\\n\\n\\t\\t// Reset game time\\n\\t\\tGameJam.tileCounter = 0;\\n\\t\\tGameJam.timer.className = 'show';\\n\\t\\tdocument.getElementById('obstacles').className = 'hide';\\n\\t\\tdocument.getElementById('slider').className = 'hide';\\n\\t\\tdocument.getElementById('start-button-wrapper').className = 'hide';\\n\\n\\t\\t// Game has started\\n\\t\\tGameJam.gameStarted = true;\\n\\n\\t\\tGameJam.gameEnded = false;\\n\\n\\t\\tdocument.getElementById('static-canvas').className = 'started';\\n\\n\\t\\tconsole.log('-- Game started');\\n\\t}\",\n \"function start() {\\n console.log(\\\"Animation Started\\\");\\n\\n let masterTl = new TimelineMax();\\n\\n //TODO: add childtimelines to master\\n masterTl\\n .add(clearStage(), \\\"scene-clear-stage\\\")\\n .add(enterFloorVegetation(), \\\"scene-floor-vegitation\\\")\\n .add(enterTreeStuff(), \\\"tree-stuff\\\");\\n }\",\n \"function start() {\\n init();\\n run();\\n }\",\n \"function startEncounter(){\\n\\tthis.scene.start('Battle', {type: 'encounter'})\\n}\",\n \"startScene() {\\n console.log('[Game] startScene');\\n var that = this;\\n\\n if (this.scene) {\\n console.log('[Game] loading scene');\\n this.scene.load().then(() => {\\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\\n // setTimeout(function() {\\n debugger;\\n that.scene.start();\\n debugger;\\n that._runSceneLoop();\\n that._renderSceneLoop();\\n // }, 0);\\n });\\n } else {\\n console.log('[Game] nothing to start: no scene selected!!');\\n }\\n }\",\n \"go() {\\n\\t\\tthis.context.analytics.record(\\\"Game Loaded\\\");\\n\\t\\tthis._$template.css({ \\\"visibility\\\": \\\"visible\\\"}).hide().fadeIn();\\n\\t\\tthis._$start = $(\\\".start\\\", this._$template);\\n\\n\\t\\tthis._$start.on('click', (e) => {\\n\\t\\t\\te.preventDefault();\\n\\t\\t\\tthis._$template.fadeOut(() => {\\n\\t\\t\\t\\tthis.nextState(\\\"playing\\\");\\n\\t\\t\\t});\\n\\t\\t});\\n\\t}\",\n \"Main() {\\n // add the welcome label to the scene\\n this.addChild(this._overLabel);\\n // add the backButton to the scene\\n this.addChild(this._backButton);\\n // event listeners\\n this._backButton.on(\\\"click\\\", this._backButtonClick);\\n }\",\n \"function start_view() {\\n editor_visibility(true);\\n button_visibility('view-mode');\\n d3.json(resource_url(), editor_callback);\\n}\",\n \"function main() {\\n startSlideShowAnimation();\\n renderProject();\\n}\",\n \"function start() {\\n //switch to scene 1\\n window.inventoryActive = \\\"\\\";\\n window.inventoryActive2 = \\\"\\\";\\n window.inventory[1]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[2]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[3]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[4]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[5]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[6]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.timerTime = null;\\n window.inspectResultReceived =0;\\n window.activeSlot = \\\"\\\";\\n window.inspectResult= \\\"\\\";\\n \\n}\",\n \"function start() {\\n action(1, 0, 0);\\n}\",\n \"create() {\\n // We have nothing left to do here. Start the next scene.\\n \\n\\n this.input.on('pointerdown', function (pointer) {\\n\\n this.scene.start('Game');\\n }, this);\\n\\n \\n }\",\n \"function initiatePage () {\\n\\t highlightDayOfTheWeek();\\n\\t populateHairdresserContainer();\\n\\t animateContainer(true, '#who');\\n\\t window.setTimeout(function () { autoScrollSlideshow(); }, 4000);\\n\\t}\",\n \"function createFirstScene() {\\nmakeRect(0,25,200,100,\\\"black\\\",0.6) \\n makeCircle(100,52,25,\\\"orange\\\",1)\\nmakeRect(90,75,20,8,\\\"red\\\",1)\\nmakeRect(90,37,20,3,\\\"red\\\",0.4)\\nmakeCircle(115,43,4,\\\"black\\\",0.9)\\nmakeCircle(85,43,4,\\\"black\\\",0.9)\\nmakeCircle(100,53,2,\\\"black\\\",0.9)\\nmakeEllipse(100,27,28,10,1)\\nmakeLine(123,61,77,61,\\\"black\\\",1)\\nmakeCircle(100,112,35,\\\"black\\\",0.9)\\nmakeLine(124,87,76,87,\\\"white\\\",1)\\nmakeLine(131,97,69,97,\\\"white\\\",1)\\nmakeCircle(100,25,2,\\\"white\\\")\\nmakeImage(\\\"http://www.drodd.com/images15/canada-flag15.gif\\\",0,1,70,30,1)\\nmakeLine(12,20,12,50,\\\"white\\\",4,1)\\n var randomstuff= Math.random()\\n if(randomstuff <0.4){\\n makeText(\\\"Im a Canadian\\\",80,80,20,10,\\\"red\\\")\\n }\\n}\",\n \"function showStart() {\\n layout.RemoveChild(loading);\\n layout.AddChild(text);\\n layout.AddChild(startButton);\\n clearInterval(loadTime);\\n\\n // Setup arrows\\n res.arrowTL_png.SetPosition(0, 0);\\n res.arrowTR_png.SetPosition(0.9, 0);\\n res.arrowBL_png.SetPosition(0, 0.85);\\n res.arrowBR_png.SetPosition(0.9, 0.85);\\n}\",\n \"function init() {\\n createWelcomeGraphic();\\n console.log('WELCOME TO ASSOCIATE MANAGER!');\\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\\n}\",\n \"function Main() {\\n console.log(\\\"%c Scene Switched...\\\", \\\"color: green; font-size: 16px;\\\");\\n // clean up\\n if (currentSceneState != scenes.State.NO_SCENE) {\\n currentScene.removeAllChildren();\\n stage.removeAllChildren();\\n }\\n // switch to the new scene\\n switch (config.Game.SCENE) {\\n case scenes.State.START:\\n console.log(\\\"switch to Start Scene\\\");\\n currentScene = new scenes.Start();\\n break;\\n case scenes.State.PLAY:\\n console.log(\\\"switch to Play Scene\\\");\\n currentScene = new scenes.Play();\\n break;\\n case scenes.State.END:\\n console.log(\\\"switch to End Scene\\\");\\n currentScene = new scenes.End();\\n break;\\n }\\n currentSceneState = config.Game.SCENE;\\n stage.addChild(currentScene);\\n }\",\n \"function generateScenes() { \\n\\n\\tsceneIndex.push(new Scene(1,'Change the Future',bg.themes.grey,{sel:'#future',offset:0}));\\n\\tsceneIndex.push(new Scene(2,'Bitcoin Intro',bg.themes.grey,{sel:'#intro',offset:0,segueEnterDown:animations.fadeIntroText}));\\n\\tsceneIndex.push(new Scene(3,'Bank',bg.themes.white,{sel:'#bank',offset:0,segueEnterDown:animations.decentralize},svg.drawBankLines));\\n\\tsceneIndex.push(new Scene(4,'Use Case',bg.themes.white,{sel:'#usecase',offset:0,segueEnterDown:interactions.waitUseCase}));\\n\\tsceneIndex.push(new Scene(5,'Addresses',bg.themes.white,{sel:'#address',offset:0}));\\t\\n\\tsceneIndex.push(new Scene(6,'Pick Address',bg.themes.white,{sel:'#pickaddress',offset:0,segueEnterDown:interactions.waitAddress}));\\t\\n\\tsceneIndex.push(new Scene(7,'Use Address',bg.themes.white,{sel:'#useaddress',offset:0}));\\t\\n\\tsceneIndex.push(new Scene(8,'Secret Key',bg.themes.white,{sel:'#secretkey',offset:0,segueEnterDown:animations.rotateCycle}));\\n\\tsceneIndex.push(new Scene(9,'Your Account',bg.themes.white,{sel:'#account',offset:0}));\\n\\tsceneIndex.push(new Scene(10,'Transfer',bg.themes.white,{sel:'#transfer',offset:0,segueEnterDown:interactions.waitTransfer}));\\n\\tsceneIndex.push(new Scene(11,'Transaction',bg.themes.white,{sel:'#transaction',offset:0}));\\n\\tsceneIndex.push(new Scene(12,'Ledger',bg.themes.white,{sel:'#ledger',offset:0,segueEnterDown:animations.solveBlock,segueEnterUp:animations.undoBlock}));\\n\\tsceneIndex.push(new Scene(13,'Package',bg.themes.white,{sel:'#package',offset:0}));\\n\\tsceneIndex.push(new Scene(14,'Reward',bg.themes.gradient,{sel:'#reward',offset:0}));\\n\\tsceneIndex.push(new Scene(15,'Network',bg.themes.grey,{sel:'#network',offset:0}));\\n\\tsceneIndex.push(new Scene(16,'Block Chain',bg.themes.grey,{sel:'#blockchain',offset:0}));\\n\\tsceneIndex.push(new Scene(17,'Resolution',bg.themes.grey,{sel:'#resolution',offset:0}));\\n\\tsceneIndex.push(new Scene(18,'Medium',bg.themes.grey,{sel:'#medium',offset:0}));\\n\\n\\t_.indexBy(sceneIndex,'sceneIndex');\\n\\n\\t// Add ScrollMagic listeners for scenes\\n\\t_.each(sceneIndex, function(val,key) {\\n\\n\\t\\tval.init();\\n\\n\\t\\t// Animated segues\\n\\t\\tvar trigger = new ScrollMagic.Scene({\\n\\t\\ttriggerElement: val.segue.sel,\\n\\t\\toffset: 200,\\n\\t\\tduration: val.height\\n\\t\\t})\\n\\t\\t.on(\\\"enter leave\\\", function(e) {\\n\\t\\t\\tvar enter = e.type === \\\"enter\\\";\\n\\t\\t\\tvar down = e.scrollDirection === \\\"FORWARD\\\";\\n\\t\\t\\tval.segueScene(enter,down);\\n\\t\\t})\\n\\t\\t//.addIndicators()\\n\\t\\t.addTo(window.controller);\\n\\n\\t\\t// Pin the page\\n\\t\\tvar pin = new ScrollMagic.Scene({\\n\\t\\t triggerElement: \\\".scene\\\"+val.sceneIndex, // point of execution\\n\\t\\t duration: $(window).height() - val.segue.offset, // pin element for the window height - 1\\n\\t\\t triggerHook: 0, // don't trigger until trigger hits the top of the viewport\\n\\t\\t reverse: true // allows the effect to trigger when scrolled in the reverse direction\\n\\t\\t})\\n\\t\\t//.addIndicators()\\n\\t\\t.setPin(\\\".scene\\\"+val.sceneIndex) // the element we want to pin\\n\\t\\t.addTo(window.controller);\\n\\n\\t\\t// Background DOWNWARD transitions\\n\\t\\tvar downward = new ScrollMagic.Scene({\\n\\t\\t\\ttriggerElement: '.scene'+val.sceneIndex,\\n\\t\\t\\toffset: -200,\\n\\t\\t\\tduration: val.height\\n\\t\\t})\\n\\t\\t.on(\\\"enter leave\\\", function(e) {\\n\\t\\t\\tvar enter = e.type === \\\"enter\\\";\\n\\t\\t\\tvar down = e.scrollDirection === \\\"FORWARD\\\";\\n\\t\\t\\t(enter && down) && val.bgState();\\n\\t\\t\\tenter && breadcrumbs.open(val.sceneIndex);\\n\\t\\t})\\n\\t\\t.addTo(window.controller);\\n\\n\\t\\t// Background UPWARD transitions\\n\\t\\tvar upward = new ScrollMagic.Scene({\\n\\t\\t\\ttriggerElement: '.scene'+val.sceneIndex,\\n\\t\\t\\toffset: 400,\\n\\t\\t\\tduration: val.height\\n\\t\\t})\\n\\t\\t.on(\\\"enter leave\\\", function(e) {\\n\\t\\t\\tvar enter = e.type === \\\"enter\\\";\\n\\t\\t\\tvar down = e.scrollDirection === \\\"FORWARD\\\";\\n\\t\\t\\t(val.sceneIndex > 0) && (enter && !down) && sceneIndex[val.sceneIndex-1].bgState();\\n\\t\\t})\\n\\t\\t.addTo(window.controller);\\n\\t\\t\\t\\t\\n\\t})\\n\\n\\tgenerateTweens();\\n\\tgenerateSceneListeners();\\n\\tbreadcrumbs.init();\\n}\",\n \"function start(){\\r\\n\\t\\t// for now, start() will call _draw(), which draws all the objects on the stage\\r\\n\\t\\t// but in the next lesson, we'll add an animation loop that calls _draw()\\r\\n\\t\\t_draw(ctx);\\r\\n\\t}\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n this._router.resolve();\\n }\",\n \"show ()\\n\\t{\\n\\t\\t//if the view hasn't been initialised, call setup (of the concrete view e.g. LOView)\\n\\t\\tif(!this.initialised)\\n\\t\\t{\\n\\t\\t\\tthis.setup();\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t//unhide the elements of the scene\\n\\t\\t\\tthis.root.style.display = 'block';\\n\\t\\t}\\n\\t}\",\n \"function startScreen() {\\n\\t\\t\\tinitialScreen =\\n\\t\\t\\t\\t\\\"

    Start Quiz

    \\\";\\n\\t\\t\\t$( \\\".mainArea\\\" )\\n\\t\\t\\t\\t.html( initialScreen );\\n\\t\\t}\",\n \"function startGame() {\\r\\n if (pressed == 0) {\\r\\n createRain();\\r\\n animate();\\r\\n }\\r\\n }\",\n \"function start(){\\n\\tautoCompleteSearch();\\n\\tsubmitButton();\\n\\tsubmitButtonRandom();\\n\\tnewSearch();\\n\\trandomChar();\\n\\thideCarouselNav();\\n}\",\n \"function tl_start() {\\n $('#futureman_face, #menu-open').css('display', 'inherit');\\n $('.menu-open').css('visibility', 'inherit');\\n }\",\n \"create(){\\n this.add.text(20, 20, \\\"LoadingGame...\\\")\\n\\n this.time.addEvent({\\n delay: 3000, // ms\\n callback: function(){this.scene.start('MenuScene')},\\n //args: [],\\n callbackScope: this,\\n loop: true \\n });\\n\\n \\n }\",\n \"function frontPage() {\\n console.log(\\\"Welcome to Reddit! the front page of the internet\\\");\\n fpMenu();\\n\\n\\n}\",\n \"function reactionStart () {\\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\\n switchButton2(); // Zustand des Schaltknopfs ändern\\n enableInput(false); // Eingabefelder deaktivieren\\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\\n else stopAnimation(); // ... oder stoppen\\n reaction(); // Eingegebene Werte übernehmen und rechnen\\n paint(); // Neu zeichnen\\n }\",\n \"function onCreate() {\\n\\n /* -------------------------------*/\\n /* Setting the stage */\\n /* -------------------------------*/\\n\\n // **** Create our scene ***\\n initScene();\\n\\n // **** Set up the Renderer ***\\n initRenderer();\\n\\n // **** Setup Container stuff ***\\n initContainer();\\n\\n // *** Setup the Halo stats div ***\\n initStatsInfo();\\n\\n // **** DAT GUI! ***\\n initGUI();\\n\\n // **** Setup our slider ***\\n initSlider();\\n\\n\\n /* -------------------------------*/\\n /* Organizing our Actors */\\n /* -------------------------------*/\\n\\n // Load Data for Halo // TREE679582 TREE676638\\n initHaloTree(TREE676638, true);\\n\\n // **** Lights! ***\\n initLights();\\n\\n // **** Camera! ***\\n initCamera();\\n\\n // **** Setup our Raycasting stuff ***\\n initRayCaster();\\n\\n // **** Action! Listeners *** //\\n initListeners();\\n\\n\\n}\",\n \"constructor()\\n {\\n // calling the super to inniciate this class as a scene\\n super();\\n }\",\n \"function startGame() {\\n let gameBoard = document.getElementById('gameBoard');\\n let tutorial = document.getElementById('tutorial');\\n gameBoard.style.display = \\\"block\\\";\\n tutorial.style.display = \\\"none\\\";\\n addGround();\\n addTree(treeCenter, trunkHeight);\\n addBush(bushStart);\\n addStones(stoneStart);\\n addCloud(cloudStartX, cloudStartY);\\n addingEventListenersToGame();\\n addingEventListenersToTools();\\n addInventoryEventListeners()\\n}\",\n \"function FXstart (){\\n setTimeout(FXdisplayLaunch, 1500);\\n FXweatherGeolocation();\\n FXdisplayMarsWeather();\\n }\",\n \"function start() {\\n $('#waitPanel').remove();\\n\\n // build slides dynamically\\n const slides = $('div.slides');\\n const areyoureadyTemplate = $('#areyouready-template').html();\\n slides.append(areyoureadyTemplate\\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\\n );\\n const wordTemplate = $('#word-template').html();\\n $.each(sessionData['wordList'], function(idx, data) {\\n slides.append(wordTemplate\\n .replace(/ID/g, idx+1)\\n );\\n });\\n const goodjobTemplate = $('#goodjob-template').html();\\n slides.append(goodjobTemplate\\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\\n );\\n\\n Reveal.initialize({\\n controlsLayout: \\\"edges\\\",\\n overview: false,\\n autoPlayMedia: true,\\n hash: false,\\n viewDistance: Number.MAX_VALUE,\\n keyboard: {\\n 13: listenAgain,\\n 65: listenAgain, // A - again\\n 82: listenAgain, // R - repeat\\n }\\n });\\n\\n Reveal.addEventListener('slidechanged', function(p) {\\n const slideNum = p['indexh'];\\n playSound(slideNum);\\n });\\n\\n // change to first (later changes will be captured above\\n playSound(0);\\n}\",\n \"start(event){\\n console.warn(\\\"ZOOTYMON GO!\\\");\\n $('.firstpage').hide();\\n $('.dino2').hide();\\n zootyMon.progressbar();\\n const $name = $('input').val();\\n $('.nameInput').text($name);\\n zootyMon.increaseAge();\\n zootyMon.morph();\\n zootyMon.animateZootymon();\\n \\n \\n }\",\n \"function Start() {\\n console.log(`%c Start Function`, \\\"color: grey; font-size: 14px; font-weight: bold;\\\");\\n stage = new createjs.Stage(canvas);\\n createjs.Ticker.framerate = Config.Game.FPS;\\n createjs.Ticker.on('tick', Update);\\n stage.enableMouseOver(20);\\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\\n Main();\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.74389476","0.7310588","0.70975536","0.6952484","0.6715637","0.66859394","0.663983","0.6638555","0.6571287","0.65618575","0.65270853","0.6473177","0.646615","0.64646536","0.6458617","0.64431214","0.6443038","0.6418837","0.6404111","0.64015144","0.6380875","0.6348404","0.63479435","0.6347251","0.634585","0.63456863","0.6344421","0.6331548","0.6305322","0.63032794","0.62967074","0.6293326","0.6290774","0.6289273","0.6284763","0.62712044","0.62665856","0.625361","0.6251022","0.6232611","0.6229435","0.6222703","0.62118804","0.6211269","0.61995584","0.6193853","0.6193189","0.6193189","0.6161966","0.61595094","0.61471444","0.6140593","0.61356044","0.6129856","0.6129199","0.6126119","0.6125271","0.6099707","0.6095008","0.60944366","0.60938627","0.60920066","0.6088571","0.60833126","0.6081371","0.6071361","0.6069223","0.60576355","0.60474247","0.6045314","0.60429096","0.60364366","0.6033361","0.60257286","0.6025719","0.6018825","0.6015323","0.6014897","0.6010746","0.5998373","0.599543","0.59927905","0.5991143","0.598838","0.59868","0.5986538","0.5985335","0.59825665","0.59821886","0.59819","0.5981512","0.59686005","0.5966992","0.5966366","0.596506","0.59634614","0.59591883","0.59558636","0.59542066","0.59533006","0.59526473"],"string":"[\n \"0.74389476\",\n \"0.7310588\",\n \"0.70975536\",\n \"0.6952484\",\n \"0.6715637\",\n \"0.66859394\",\n \"0.663983\",\n \"0.6638555\",\n \"0.6571287\",\n \"0.65618575\",\n \"0.65270853\",\n \"0.6473177\",\n \"0.646615\",\n \"0.64646536\",\n \"0.6458617\",\n \"0.64431214\",\n \"0.6443038\",\n \"0.6418837\",\n \"0.6404111\",\n \"0.64015144\",\n \"0.6380875\",\n \"0.6348404\",\n \"0.63479435\",\n \"0.6347251\",\n \"0.634585\",\n \"0.63456863\",\n \"0.6344421\",\n \"0.6331548\",\n \"0.6305322\",\n \"0.63032794\",\n \"0.62967074\",\n \"0.6293326\",\n \"0.6290774\",\n \"0.6289273\",\n \"0.6284763\",\n \"0.62712044\",\n \"0.62665856\",\n \"0.625361\",\n \"0.6251022\",\n \"0.6232611\",\n \"0.6229435\",\n \"0.6222703\",\n \"0.62118804\",\n \"0.6211269\",\n \"0.61995584\",\n \"0.6193853\",\n \"0.6193189\",\n \"0.6193189\",\n \"0.6161966\",\n \"0.61595094\",\n \"0.61471444\",\n \"0.6140593\",\n \"0.61356044\",\n \"0.6129856\",\n \"0.6129199\",\n \"0.6126119\",\n \"0.6125271\",\n \"0.6099707\",\n \"0.6095008\",\n \"0.60944366\",\n \"0.60938627\",\n \"0.60920066\",\n \"0.6088571\",\n \"0.60833126\",\n \"0.6081371\",\n \"0.6071361\",\n \"0.6069223\",\n \"0.60576355\",\n \"0.60474247\",\n \"0.6045314\",\n \"0.60429096\",\n \"0.60364366\",\n \"0.6033361\",\n \"0.60257286\",\n \"0.6025719\",\n \"0.6018825\",\n \"0.6015323\",\n \"0.6014897\",\n \"0.6010746\",\n \"0.5998373\",\n \"0.599543\",\n \"0.59927905\",\n \"0.5991143\",\n \"0.598838\",\n \"0.59868\",\n \"0.5986538\",\n \"0.5985335\",\n \"0.59825665\",\n \"0.59821886\",\n \"0.59819\",\n \"0.5981512\",\n \"0.59686005\",\n \"0.5966992\",\n \"0.5966366\",\n \"0.596506\",\n \"0.59634614\",\n \"0.59591883\",\n \"0.59558636\",\n \"0.59542066\",\n \"0.59533006\",\n \"0.59526473\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":64,"cells":{"query":{"kind":"string","value":"Dish menu for fancy restaurant scene."},"document":{"kind":"string","value":"function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\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 displayMenu() {\n const menu = document.querySelector(\"#menu\");\n let dishes = hard_coded_dishes;\n\n dishes.forEach(dish => {\n // generate template for main ingredient and the name of the dish\n const main = displayDish(\n dish.course,\n dish.name,\n dish.price,\n dish.ingredient\n );\n\n // generate options for each dish\n const options = [];\n\n if (dish.options) {\n dish.options.forEach(option => {\n options.push(displayOption(option.option, option.price));\n });\n }\n\n // add this to the DOM\n menu.insertAdjacentHTML(\"beforeend\", main + options.join(\"\"));\n });\n}","addDishToMenu(dish) {\n if(this.menu.includes(dish))\n {\n this.removeDishFromMenu(dish.id);\n }\n this.menu.push(dish);\n }","function showMenu(arg)\r\n\t{\r\n\t\tswitch(arg)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$('#menu').html(\"\");\r\n\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$('#menu').html(\"

    Sheep's Snake

    Press A to play!

    Press B for some help !

    \");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}","function foodMenuItems() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\twaypoint = new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.find('.nectar_food_menu_item').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\t}, i * 150);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\toffset: $foodItemOffsetPos\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}","getMenu() {alert(\"entering grocery.js getMenu()\")\n\t\t// Assemble the menu list (meal nodes)\n\t\tthis.menuCloset.destructBoxes()\n\t\tlet mealNodes = graph.getNodesByID_partial(\"meal\", \"\")\n\t\tfor (let meal of mealNodes) {\n\t\t\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\n\t\t\t\tthis.menuCloset.add(meal)\n\t\t\t}\n\t\t}\n\t\tthis.updateGroceryList()\n\t}","function thememascot_menuzord() {\n $(\"#menuzord\").menuzord({\n align: \"left\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n $(\"#menuzord-right\").menuzord({\n align: \"right\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n }","constructor(props) {\n super(props);\n\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\n this.state = {\n selectedDish: null\n }\n console.log('menu constructor is invoke')\n \n }","function onOpen() {\n createMenu();\n}","function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}","function menu() {\n this.meal1 = \"Ham and Cheese Sandwich\",\n this.meal2 = \"Roastbeef Sandwich\"\n }","function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}","function lijstSubMenuItem() {\n\n if ($mLess.text() == \"meer\") {\n $mLess.text(\"minder\")\n } else {\n $mLess.text(\"meer\");\n\n }\n $list.toggleClass('hidden')\n $resum.get(0).scrollIntoView('slow');\n event.preventDefault()\n }","function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}","function showMenu() {\n // clear the console\n console.log('\\033c');\n // menu selection\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"wish\",\n choices: [\"View Product Sales by Department\", \"Create New Department\", \"Exit\"],\n message: '\\nWhat would you like to do? '\n }\n ]).then( answer => {\n switch (answer.wish){\n case \"View Product Sales by Department\":\n showSale();\n break;\n case \"Create New Department\":\n createDept();\n break;\n case \"Exit\":\n connection.end();\n break;\n default:\n console.log( `\\x1b[1m \\x1b[31m\\nERROR! Invalid Selection\\x1b[0m`);\n }\n })\n}","function createMenu() {\n const menu = document.createElement(\"div\");\n for (let section in Menu) {\n menu.appendChild(createDishSection(Menu[section].name));\n menu.appendChild(createDishList(Menu[section].dishes));\n }\n return menu;\n}","function menuhrres() {\r\n\r\n}","function menuOptions() {}","function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}","function onOpen() { CUSTOM_MENU.add(); }","function clickAddnewMenu(){\n\t\t\n\t\t$(\"#menuAddNew\").show();\n\t\t//$(\".categorydropList\").load(jssitebaseUrl+\"/ajaxActionRestaurant.php?action=categoryDropList\");\n\t\t$(\"#menuEdit\").hide();\n\t\t//$(\"#addnew_buttun\").hide();\n\t\t$(\".restaurantMenuContent\").hide();\n\t}","function menuShow() {\n ui.appbarElement.addClass('open');\n ui.mainMenuContainer.addClass('open');\n ui.darkbgElement.addClass('open');\n}","function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Great Explorations')\n .addItem('Match Girls to Workshops', 'matchGirls')\n .addToUi();\n}","function showMenu(){\n // shows panel for piano\n rectMode(CENTER);\n fill(0, 100, 255);\n rect(width/2, height/2 - 100, 400, 150);\n textAlign(CENTER, CENTER), textSize(75);\n fill(0);\n text('Piano', width/2, height/2 - 100);\n \n // shows panel for guitar\n rectMode(CENTER);\n fill(0, 240 , 250);\n rect(width/2, height/2 + 100, 400, 150);\n textAlign(CENTER, CENTER), textSize(75);\n fill(0);\n text('Guitar', width/2, height/2 + 100);\n}","function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}","expandMenu() {\r\n\t}","function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}","function setMenu() {\n var menu = gId('menu');\n var menu_elements = menu.children;\n for (var i = 0; i < menu_elements.length; i++) {\n if (menu_elements[i].textContent != \"my stories\") {\n menu_elements[i].style.display = 'none';\n }\n }\n}","function _createFoodMenu( data ) {\n var html = '', note = data.notification ? \n '
    '+data.notification+'
    ' : '';\n \n if ( data.headline ) {\n var id = getAutoId(); \n html = '

    '+data.headline+'

    '+note;\n } else if ( data.subline ) {\n html = '

    '+data.subline+'

    '+note;\n } else if ( data.type === 'setmenu-price' ) {\n html = '
    '+data.price+'
    '+note;\n } else {\n var name = data.name ? '
    '+data.name+'
    ' : '';\n var number = data.number ? '
    '+data.number+'
    ' : '';\n var price = data.price ? '
    '+data.price+'
    ' : '';\n\n var description = data.description ? \n '
    '+data.description+'
    ' : '';\n var sashimi = data.sashimi ? \n '
    '+data.sashimi+'
    ' : '';\n var type = 'food' + (data.type ? (' -'+data.type) : '') +\n (sashimi ? ' -has-sashimi' : '') + (number ? '' : ' -no-number');\n\n html = '
    ' +\n number + name + price + sashimi + description + note +\n '
    '; \n }\n return html;\n}","function renderMenu() {\n\tvar menu = com.dawgpizza.menu;\n\t// grab templates for duplication\n\tvar pizzaTemplate = $('.pizza-template');\n\tvar drinkDessertTemplate = $('.drink-dessert-template');\n\t$.each(com.dawgpizza.menu.pizzas, function() {\n\t\tvar pizzaTemplateClone = pizzaTemplate.clone();\n\t\t// populate the clone's fields\n \tpizzaTemplateClone.find('.name').html(this.name);\n \tpizzaTemplateClone.find('.description').html(this.description + \" \" \n \t\t+ this.prices[0]+\"/\"+this.prices[1]+\"/\"+this.prices[2]);\n\n \t// data-type=\"\" data-name=\"\" data-qty=\"\" data-price=\"\"\n \tpizzaTemplateClone.find('button.form-control').attr({\n \t\t\"data-type\": this.type,\n \t\t\"data-name\": this.name\n \t});\n \t// add prices to select options\n \tvar pizza = this;\n\t $.each(pizzaTemplateClone.find('select').children(), function(idx) {\n\t \t$(this).val(pizza.prices[idx]);\n\t });\n\t if(this.vegetarian) { // put in the vegetarian menu.\n\t \t$('#veggie-spot').append(pizzaTemplateClone);\n\t } else { // put in the carnivore menu.\n\t \t$('#meat-spot').append(pizzaTemplateClone);\n\t }\n\t});\n\n\t$.each(com.dawgpizza.menu.drinks, function() {\n\t\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\n\t\t// populate the clone's fields\n\t\tdrinkDessertTemplateClone.find('.name').html(this.name);\n\n\t\t// data-type=\"\" data-name=\"\" data-qty=\"\" data-price=\"\"\n \tdrinkDessertTemplateClone.find('button.form-control').attr({\n \t\t\"data-type\": this.type,\n \t\t\"data-name\": this.name,\n \t\t\"data-price\": this.price\n \t});\n\n\t\t$('#drinks').append(drinkDessertTemplateClone);\n\t});\n\n\t$.each(com.dawgpizza.menu.desserts, function() {\n\t\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\n\t\t// populate the clone's fields\n\t\tdrinkDessertTemplateClone.find('.name').html(this.name);\n\t\t// data-type=\"\" data-name=\"\" data-qty=\"\" data-price=\"\"\n \tdrinkDessertTemplateClone.find('button.form-control').attr({\n \t\t\"data-type\": this.type,\n \t\t\"data-name\": this.name,\n \t\t\"data-price\": this.price\n \t});\n\n\t\t$('#desserts').append(drinkDessertTemplateClone);\n\t});\n}","function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}","function Estiliza_menu_itens()\n{\n //PARA CADA ITEM DO MENU, BASTA CHAMAR A FUNÇÃO ABAIXO, ESPECIFICANDO\n //SEU INDICE(NUMERO), SUA COR(STRING), SEU CONTEUDO(STRING), SEU LABEL(STRING)\n //Estiliza_item(Indice, Cor, Conteudo, Texto Lateral);\n Estiliza_item(0,\"blue\",\"+\",\"Adicionar\");\n Estiliza_item(1,\"red\",\"Botão\");\n}","function gameMenuStartableDrawer() {\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\n }\n }","function ciniki_musicfestivals_main() {\n //\n // The panel to list the festival\n //\n this.menu = new M.panel('Music Festivals', 'ciniki_musicfestivals_main', 'menu', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.menu');\n this.menu.data = {};\n this.menu.nplist = [];\n this.menu.sections = {\n// 'search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':1,\n// 'cellClasses':[''],\n// 'hint':'Search festival',\n// 'noData':'No festival found',\n// },\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'festivals',\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x40); },\n 'tabs':{\n 'festivals':{'label':'Festivals', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\"festivals\");'},\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\"trophies\");'},\n }},\n 'festivals':{'label':'Festival', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'festivals' ? 'yes' : 'no';},\n 'noData':'No Festivals',\n 'addTxt':'Add Festival',\n 'addFn':'M.ciniki_musicfestivals_main.edit.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',0,null);'\n },\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'trophies' ? 'yes' : 'no';},\n 'noData':'No Trophies',\n// 'headerValues':['Category', 'Name'],\n 'addTxt':'Add Trophy',\n 'addFn':'M.ciniki_musicfestivals_main.trophy.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',0,null);'\n },\n }\n this.menu.liveSearchCb = function(s, i, v) {\n if( s == 'search' && v != '' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.festivalSearch', {'tnid':M.curTenantID, 'start_needle':v, 'limit':'25'}, function(rsp) {\n M.ciniki_musicfestivals_main.menu.liveSearchShow('search',null,M.gE(M.ciniki_musicfestivals_main.menu.panelUID + '_' + s), rsp.festivals);\n });\n }\n }\n this.menu.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n this.menu.liveSearchResultRowFn = function(s, f, i, j, d) {\n return 'M.ciniki_musicfestivals_main.festival.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',\\'' + d.id + '\\');';\n }\n this.menu.switchTab = function(tab) {\n if( tab != null ) { this.sections._tabs.selected = tab; }\n this.open();\n }\n this.menu.cellValue = function(s, i, j, d) {\n if( s == 'festivals' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return d.status_text;\n }\n }\n if( s == 'trophies' ) {\n switch(j) {\n case 0: return d.category;\n case 1: return d.name;\n }\n }\n }\n this.menu.rowFn = function(s, i, d) {\n if( s == 'festivals' ) {\n return 'M.ciniki_musicfestivals_main.festival.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.nplist);';\n }\n if( s == 'trophies' ) {\n return 'M.ciniki_musicfestivals_main.trophy.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.menu.nplist);';\n }\n }\n this.menu.open = function(cb) {\n if( this.sections._tabs.selected == 'trophies' ) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.menu;\n p.data = rsp;\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\n p.refresh();\n p.show(cb);\n });\n } else {\n M.api.getJSONCb('ciniki.musicfestivals.festivalList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.menu;\n p.data = rsp;\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\n p.refresh();\n p.show(cb);\n });\n }\n }\n this.menu.addClose('Back');\n\n //\n // The panel to display Festival\n //\n this.festival = new M.panel('Festival', 'ciniki_musicfestivals_main', 'festival', 'mc', 'large narrowaside', 'sectioned', 'ciniki.musicfestivals.main.festival');\n this.festival.data = null;\n this.festival.festival_id = 0;\n this.festival.section_id = 0;\n this.festival.schedulesection_id = 0;\n this.festival.scheduledivision_id = 0;\n this.festival.invoice_typestatus = '';\n this.festival.list_id = 0;\n this.festival.listsection_id = 0;\n this.festival.nplists = {};\n this.festival.nplist = [];\n this.festival.messages_status = 10;\n this.festival.city_prov = 'All';\n this.festival.province = 'All';\n this.festival.registration_tag = '';\n this.festival.sections = {\n '_tabs':{'label':'', 'type':'menutabs', 'selected':'sections', 'tabs':{\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'sections\\');'},\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'registrations\\');'},\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'schedule\\');'},\n 'videos':{'label':'Videos', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'videos\\');',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\n },\n 'comments':{'label':'Comments', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'comments\\');',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\n },\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'competitors\\');'},\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'adjudicators\\');'},\n// 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'files\\');'},\n 'photos':{'label':'Photos', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x04); },\n 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'photos\\');',\n },\n// 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'sponsors\\');',\n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\n// },\n 'messages':{'label':'Messages', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'messages\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0400); },\n },\n// 'sponsors-old':{'label':'Sponsors', \n// 'visible':function() { \n// return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \n// },\n// 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'sponsors-old\\');',\n// },\n 'more':{'label':'More...', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'more\\');'},\n }},\n '_moretabs':{'label':'', 'type':'menutabs', 'selected':'adjudicators', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'more' ? 'yes' : 'no'; },\n 'tabs':{\n 'invoices':{'label':'Invoices', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'invoices\\');'},\n 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'adjudicators\\');'},\n 'certificates':{'label':'Certificates', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'certificates\\');'},\n 'lists':{'label':'Lists', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'lists\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x20); },\n },\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'emails\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0200); },\n },\n 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'files\\');'},\n 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'sponsors\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\n },\n/* 'sponsors-old':{'label':'Sponsors', \n 'visible':function() { \n return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \n },\n 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'sponsors-old\\');',\n }, */\n }},\n 'details':{'label':'Details', 'aside':'yes', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\n 'list':{\n 'name':{'label':'Name'},\n 'start_date':{'label':'Start'},\n 'end_date':{'label':'End'},\n 'num_registrations':{'label':'# Reg'},\n }},\n// '_more':{'label':'', 'aside':'yes', \n// 'list':{\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'adjudicators\\');'},\n// }},\n 'download_buttons':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\n 'buttons':{\n 'download':{'label':'Download Syllabus (PDF)', \n 'fn':'M.ciniki_musicfestivals_main.festival.syllabusDownload();',\n },\n }},\n 'syllabus_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\n 'hint':'Search class names',\n 'noData':'No classes found',\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\n },\n '_stabs':{'label':'', 'type':'paneltabs', 'selected':'sections', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\n 'tabs':{\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\'sections\\');'},\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\'categories\\');'},\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\'classes\\');'},\n }},\n 'sections':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\n 'sortable':'yes',\n 'sortTypes':['text', 'number'],\n 'headerValues':['Section', 'Registrations'],\n 'addTxt':'Add Section',\n 'addFn':'M.ciniki_musicfestivals_main.section.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.section\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n 'editFn':function(s,i,d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.section.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\n }\n return '';\n },\n },\n 'si_buttons':{'label':'', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.data.sections.length == 0 ? 'yes' : 'no'; },\n 'buttons':{\n 'copy':{'label':'Copy Previous Syllabus, Lists & Settings', \n 'fn':'M.ciniki_musicfestivals_main.festival.festivalCopy(\"previous\");',\n },\n }},\n 'categories':{'label':'', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'categories' ? 'yes' : 'no'; },\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'number'],\n 'headerValues':['Section', 'Category', 'Registrations'],\n 'addTxt':'Add Category',\n 'addFn':'M.ciniki_musicfestivals_main.category.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.category\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'classes':{'label':'', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'classes' ? 'yes' : 'no'; },\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'number', 'number'],\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\n 'addTxt':'Add Class',\n 'addFn':'M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.class\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'registration_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'sections',\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\n 'tabs':{\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\"sections\");'},\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\"teachers\");'},\n 'tags':{'label':'Tags', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\"tags\");',\n },\n }}, \n 'ipv_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\n 'visible':function() { return (['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\n 'tabs':{\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\"all\");'},\n 'inperson':{'label':'Live', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\"inperson\");'},\n 'virtual':{'label':'Virtual', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\"virtual\");'},\n }}, \n 'registration_sections':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'sections' ? 'yes' : 'no'; },\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.section\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'registration_teachers':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'teachers' ? 'yes' : 'no'; },\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.students\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'registration_tags':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'tags' ? 'yes' : 'no'; },\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.registrationtag\\',\\'' + d.name + '\\');';\n } \n return '';\n },\n },\n 'registration_buttons':{'label':'', 'aside':'yes', \n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\n 'buttons':{\n 'excel':{'label':'Export to Excel', \n 'fn':'M.ciniki_musicfestivals_main.festival.downloadExcel(M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'pdf':{'label':'Registrations PDF ', \n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected=='sections'?'yes':'no';},\n 'fn':'M.ciniki_musicfestivals_main.festival.downloadPDF(M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n }},\n 'registration_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\n 'hint':'Search',\n 'noData':'No registrations found',\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\n },\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':6,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'registrations' ? 'yes' : 'no'; },\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'altnumber', 'altnumber', 'text'],\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\n },\n 'registrations_emailbutton':{'label':'', \n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations' && M.ciniki_musicfestivals_main.festival.teacher_customer_id > 0 ?'yes':'no';},\n 'buttons':{\n 'email':{'label':'Email List to Teacher', 'fn':'M.ciniki_musicfestivals_main.festival.emailTeacherRegistrations();'},\n 'comments':{'label':'Download Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherComments();'},\n 'registrations':{'label':'Download Registrations PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherRegistrations();'},\n }},\n 'schedule_sections':{'label':'Schedules', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\n 'cellClasses':['', 'multiline alignright'],\n 'addTxt':'Unscheduled',\n 'addFn':'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\'unscheduled\\',\"Unscheduled\");',\n 'changeTxt':'Add Schedule',\n 'changeFn':'M.ciniki_musicfestivals_main.schedulesection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return null;\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return null;\n }\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.schedulesection\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n 'editFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return '';\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return '';\n }\n return 'M.ciniki_musicfestivals_main.schedulesection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'schedule_divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\n 'cellClasses':['multiline', 'multiline alignright'],\n 'addTxt':'Add Division',\n 'addFn':'M.ciniki_musicfestivals_main.scheduledivision.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return null;\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return null;\n }\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.scheduledivision\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n 'editFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return '';\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return '';\n }\n return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'program_options':{'label':'Download Program', 'aside':'yes',\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\n 'fields':{\n 'ipv':{'label':'Type', 'type':'toggle', 'default':'all', \n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\n },\n }},\n 'program_buttons':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\n 'buttons':{\n 'pdf':{'label':'Download Program PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadProgramPDF();'},\n }},\n 'schedule_download':{'label':'Schedule PDF', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\n 'fields':{\n 'names':{'label':'Full Names', 'type':'toggle', 'default':'public', 'toggles':{'public':'No', 'private':'Yes'}},\n 's_titles':{'label':'Titles', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\n 's_ipv':{'label':'Type', 'type':'toggle', 'default':'all', \n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\n },\n 'footerdate':{'label':'Footer Date', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\n }},\n 'schedule_buttons':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\n 'buttons':{\n 'pdf':{'label':'Download Schedule PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadSchedulePDF();'},\n 'certs':{'label':'Certificates PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCertificatesPDF();'},\n 'comments':{'label':'Adjudicators Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCommentsPDF();'},\n }},\n 'schedule_timeslots':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':2, \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\n 'cellClasses':['label multiline', 'multiline', 'fabuttons'],\n 'addTxt':'Add Time Slot',\n 'addFn':'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n },\n 'timeslot_photos':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\n 'cellClasses':['multiline', 'thumbnails', 'alignright fabuttons'],\n },\n 'timeslot_comments':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':5, \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\n 'headerValues':['Time', 'Name', '', '', ''],\n 'headerClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\n 'cellClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\n },\n 'unscheduled_registrations':{'label':'Unscheduled', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id == 'unscheduled' ? 'yes' : 'no'; },\n 'headerValues':['Class', 'Registrant', 'Status'],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text'],\n 'cellClasses':['', 'multiline', ''],\n },\n 'video_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='videos'?'yes':'no';},\n 'hint':'Search',\n 'noData':'No registrations found',\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status'],\n 'cellClasses':['', '', '', '', ''],\n },\n 'videos':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'videos' ? 'yes' : 'no'; },\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status', ''],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'text', 'altnumber', ''],\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\n// 'addTxt':'Add Registration',\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n },\n 'competitor_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'cities',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\n 'tabs':{\n 'cities':{'label':'Cities', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\"cities\");'},\n 'provinces':{'label':'Provinces', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\"provinces\");'},\n }}, \n 'competitor_cities':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'cities' ? 'yes' : 'no'; },\n 'editFn':function(s, i, d) {\n if( d.city != null && d.province != null ) {\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + escape(d.city) + '\\',\\'' + escape(d.province) + '\\');';\n }\n return '';\n },\n },\n 'competitor_provinces':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'provinces' ? 'yes' : 'no'; },\n 'editFn':function(s, i, d) {\n if( d.province != null ) {\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',null,\\'' + escape(d.province) + '\\');';\n }\n return '';\n },\n },\n 'competitors':{'label':'', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\n 'headerValues':['Name', 'Classes', 'Waiver'],\n },\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\n 'addTxt':'Add List',\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'editFn':function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'listsections':{'label':'Sections', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.list_id > 0) ? 'yes' : 'no'; },\n 'addTxt':'Add Section',\n 'addFn':'M.ciniki_musicfestivals_main.listsection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.list_id,null);',\n 'editFn':function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.listsection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.list_id,null);';\n },\n },\n 'listentries':{'label':'Sections', 'type':'simplegrid', 'num_cols':4, \n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.listsection_id > 0) ? 'yes' : 'no'; },\n 'headerValues':['Award', 'Amount', 'Donor', 'Winner'],\n 'addTxt':'Add Entry',\n 'addFn':'M.ciniki_musicfestivals_main.listentry.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.listsection_id,null);',\n 'seqDrop':function(e,from,to) {\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, \n 'action':'listentrysequenceupdate',\n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\n 'lists':'yes',\n 'list_id':M.ciniki_musicfestivals_main.festival.list_id,\n 'listsection_id':M.ciniki_musicfestivals_main.festival.listsection_id,\n 'entry_id':M.ciniki_musicfestivals_main.festival.data.listentries[from].id, \n 'sequence':M.ciniki_musicfestivals_main.festival.data.listentries[to].sequence, \n }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.festival;\n p.data.listentries = rsp.festival.listentries;\n p.refreshSection(\"listentries\");\n });\n },\n },\n 'invoice_statuses':{'label':'Status', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\n },\n 'invoices':{'label':'Invoices', 'type':'simplegrid', 'num_cols':6,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\n 'headerValues':['#', 'Customer', 'Students', 'Total', 'Status'],\n 'noData':'No invoices',\n 'sortable':'yes',\n 'sortTypes':['number', 'text', 'text', 'number', 'text', ''],\n },\n 'adjudicators':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'adjudicators'); },\n 'addTxt':'Add Adjudicator',\n 'addFn':'M.ciniki_musicfestivals_main.adjudicator.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n },\n 'files':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'files'); },\n 'addTxt':'Add File',\n 'addFn':'M.ciniki_musicfestivals_main.addfile.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'certificates':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'certificates'); },\n 'headerValues':['Name', 'Section', 'Min Score'],\n 'addTxt':'Add Certificate',\n 'addFn':'M.ciniki_musicfestivals_main.certificate.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\n 'addTxt':'Add List',\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'editFn':function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'message_statuses':{'label':'', 'type':'simplegrid', 'aside':'yes', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\n },\n 'message_buttons':{'label':'', 'aside':'yes', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\n 'buttons':{\n 'add':{'label':'Add Message', 'fn':'M.ciniki_musicfestivals_main.message.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id);'},\n }},\n 'messages':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\n 'headerValues':['Subject', 'Date'],\n 'noData':'No Messages',\n },\n 'emails_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\n 'tabs':{\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\"all\");'},\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\"teachers\");'},\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\"competitors\");'},\n }}, \n 'emails_sections':{'label':'Sections', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\n },\n 'emails_html':{'label':'Emails', 'type':'html', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\n },\n 'sponsors':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors'); },\n 'headerValues':['Name', 'Level'],\n 'addTxt':'Add Sponsor',\n 'addFn':'M.ciniki_musicfestivals_main.sponsor.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'sponsors-old':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors-old'); },\n 'addTxt':'Manage Sponsors',\n 'addFn':'M.startApp(\\'ciniki.sponsors.ref\\',null,\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'mc\\',{\\'object\\':\\'ciniki.musicfestivals.festival\\',\\'object_id\\':M.ciniki_musicfestivals_main.festival.festival_id});',\n },\n }\n this.festival.isSelected = function(t, m) {\n if( this.sections._tabs.selected == t ) {\n if( t == 'more' ) {\n return this.sections._moretabs.selected == m ? 'yes' : 'no';\n }\n return 'yes';\n }\n return 'no';\n }\n this.festival.sectionData = function(s) {\n if( s == 'videos' ) {\n return this.data.registrations;\n }\n return M.panel.prototype.sectionData.call(this, s);\n }\n this.festival.downloadProgramPDF = function() {\n var args = {\n 'tnid':M.curTenantID, \n 'festival_id':this.festival_id, \n 'ipv':this.formValue('ipv'),\n };\n M.api.openPDF('ciniki.musicfestivals.programPDF',args);\n }\n this.festival.downloadSchedulePDF = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'schedulesection_id':this.schedulesection_id,\n 'names':this.formValue('names'),\n 'ipv':this.formValue('s_ipv'),\n 'titles':this.formValue('s_titles'),\n 'footerdate':this.formValue('footerdate'),\n };\n M.api.openPDF('ciniki.musicfestivals.schedulePDF',args);\n }\n this.festival.downloadCertificatesPDF = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'schedulesection_id':this.schedulesection_id,\n 'ipv':this.formValue('s_ipv'),\n };\n M.api.openFile('ciniki.musicfestivals.certificatesPDF',args);\n }\n this.festival.downloadCommentsPDF = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'schedulesection_id':this.schedulesection_id,\n 'ipv':this.formValue('s_ipv'),\n };\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\n }\n this.festival.downloadTeacherComments = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'teacher_customer_id':this.teacher_customer_id,\n };\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\n }\n this.festival.downloadTeacherRegistrations = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'teacher_customer_id':this.teacher_customer_id,\n };\n M.api.openPDF('ciniki.musicfestivals.teacherRegistrationsPDF',args);\n }\n this.festival.listLabel = function(s, i, d) { \n if( s == 'details' ) {\n return d.label; \n }\n return '';\n }\n this.festival.listValue = function(s, i, d) { \n if( s == 'details' ) {\n return this.data[i]; \n }\n if( s == '_more' ) {\n return d.label;\n }\n }\n this.festival.fieldValue = function(s, i, d) { \n if( this.data[i] == null ) { return ''; }\n return this.data[i]; \n }\n this.festival.liveSearchCb = function(s, i, v) {\n if( s == 'syllabus_search' && v != '' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.syllabusSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.classes);\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\n }\n });\n }\n if( (s == 'registration_search' || s == 'video_search') && v != '' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.registrationSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.registrations);\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\n }\n });\n }\n }\n this.festival.liveSearchResultValue = function(s, f, i, j, d) {\n if( s == 'syllabus_search' ) { \n return this.cellValue(s, i, j, d);\n }\n if( s == 'registration_search' ) { \n return this.cellValue(s, i, j, d);\n/* switch(j) {\n case 0: return d.class_code;\n case 1: return d.display_name;\n case 2: return d.teacher_name;\n case 3: return '$' + d.fee;\n case 4: return d.status_text;\n } */\n }\n if( s == 'video_search' ) { \n switch(j) {\n case 0: return d.class_code;\n case 1: return d.display_name;\n case 2: return M.hyperlink(d.video_url1);\n case 3: return d.music_orgfilename;\n case 4: return d.status_text;\n }\n }\n }\n this.festival.liveSearchResultRowFn = function(s, f, i, j, d) {\n if( s == 'syllabus_search' ) { \n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.festival.reopen();\\',\\'' + d.id + '\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\n }\n if( s == 'registration_search' || s == 'video_search' ) { \n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.reopen();\\',\\'' + d.id + '\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\'festival\\');';\n }\n }\n this.festival.cellValue = function(s, i, j, d) {\n if( s == 'sections' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return (d.num_registrations!=0 ? d.num_registrations : '');\n }\n }\n if( s == 'categories' ) {\n switch(j) {\n case 0: return d.section_name;\n case 1: return d.name;\n case 2: return (d.num_registrations!=0 ? d.num_registrations : '');\n }\n }\n if( s == 'classes' || s == 'syllabus_search' ) {\n switch(j) {\n case 0: return d.section_name;\n case 1: return d.category_name;\n case 2: return d.code + ' - ' + d.name;\n case 3: return d.earlybird_fee + '/' + d.fee;\n case 4: return (d.num_registrations!=0 ? d.num_registrations : '');\n }\n }\n if( s == 'unscheduled_registrations' ) {\n switch (j) {\n case 0: return d.class_code;\n case 1: return '' + d.display_name + '' + d.title1 + '';\n case 2: return d.status_text;\n }\n }\n if( s == 'registrations' || s == 'registration_search' ) {\n switch (j) {\n case 0: return d.class_code;\n case 1: return '' + d.display_name + '' + d.title1 + '';\n case 2: return d.teacher_name;\n case 3: return '$' + d.fee;\n case 4: return d.status_text;\n }\n if( j == 5 && (this.data.flags&0x10) == 0x10 ) {\n return (d.participation == 2 ? 'Plus' : '');\n } else if( j == 5 && (this.data.flags&0x02) == 0x02 ) {\n return (d.participation == 2 ? 'Virtual' : 'In Person');\n }\n }\n if( s == 'registration_sections' || s == 'emails_sections' ) {\n return M.textCount(d.name, d.num_registrations);\n }\n if( s == 'registration_teachers' ) {\n return M.textCount(d.display_name, d.num_registrations);\n }\n if( s == 'registration_tags' ) {\n return M.textCount(d.name, d.num_registrations);\n }\n if( s == 'schedule_sections' ) {\n switch(j) {\n case 0: return d.name;\n// case 1: return '';\n }\n }\n if( s == 'adjudicators' ) {\n return d.name;\n }\n if( s == 'certificates' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return d.section_name;\n case 2: return d.min_score;\n }\n }\n if( s == 'files' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return (d.webflags&0x01) == 0x01 ? 'Visible' : 'Hidden';\n }\n }\n if( s == 'message_statuses' ) {\n return M.textCount(d.label, d.num_messages);\n }\n if( s == 'messages' ) {\n switch(j) {\n case 0: return d.subject;\n case 1: return d.date_text;\n }\n }\n if( s == 'lists' ) {\n switch(j) { \n case 0: return d.name;\n }\n }\n if( s == 'listsections' ) {\n switch(j) { \n case 0: return d.name;\n }\n }\n if( s == 'listentries' ) {\n switch(j) { \n case 0: return d.award;\n case 1: return d.amount;\n case 2: return d.donor;\n case 3: return d.winner;\n }\n }\n if( s == 'sponsors' ) {\n switch(j) { \n case 0: return d.name;\n case 1: return d.level;\n }\n }\n if( s == 'sponsors-old' && j == 0 ) {\n return '' + d.sponsor.title + '';\n }\n }\n this.festival.cellSortValue = function(s, i , j, d) {\n if( s == 'registrations' ) {\n switch(j) {\n case 3: return d.fee;\n case 4: return d.status;\n }\n }\n if( s == 'videos' ) {\n switch(j) {\n case 4: return d.status;\n }\n }\n return '';\n }\n this.festival.rowFn = function(s, i, d) {\n switch(s) {\n// case 'sections': return 'M.ciniki_musicfestivals_main.section.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\n case 'sections': return 'M.ciniki_musicfestivals_main.classes.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\n case 'categories': return 'M.ciniki_musicfestivals_main.category.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',\\'' + d.section_id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.categories);';\n case 'classes': return 'M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\n case 'unscheduled_registrations': \n case 'registrations': \n case 'videos':\n return 'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\'festival\\');';\n case 'registration_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'emails_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'registration_teachers': return 'M.ciniki_musicfestivals_main.festival.openTeacher(\\'' + d.id + '\\',\"' + M.eU(d.display_name) + '\");';\n case 'registration_tags': return 'M.ciniki_musicfestivals_main.festival.openTag(\\'' + M.eU(d.name) + '\\',\"' + M.eU(d.display_name) + '\");';\n case 'schedule_sections': return 'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.festival.openScheduleDivision(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n// case 'schedule_sections': return 'M.ciniki_musicfestivals_main.schedulesection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n// case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n case 'schedule_timeslots': return 'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n case 'timeslot_comments': return 'M.ciniki_musicfestivals_main.timeslotcomments.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n case 'timeslot_photos': return null;\n case 'competitor_cities': return 'M.ciniki_musicfestivals_main.festival.openCompetitorCity(\\'' + escape(d.name) + '\\');';\n case 'competitor_provinces': return 'M.ciniki_musicfestivals_main.festival.openCompetitorProv(\\'' + escape(d.name) + '\\');';\n case 'competitors': return 'M.ciniki_musicfestivals_main.competitor.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id);';\n case 'invoice_statuses': return 'M.ciniki_musicfestivals_main.festival.openInvoiceStatus(\\'' + d.typestatus + '\\');';\n case 'invoices': return 'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'mc\\',{\\'invoice_id\\':\\'' + d.id + '\\'});';\n case 'adjudicators': return 'M.ciniki_musicfestivals_main.adjudicator.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.adjudicators);';\n case 'certificates': return 'M.ciniki_musicfestivals_main.certificate.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'files': return 'M.ciniki_musicfestivals_main.editfile.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'message_statuses': return 'M.ciniki_musicfestivals_main.festival.openMessageStatus(' + d.status + ');';\n case 'messages': return 'M.ciniki_musicfestivals_main.message.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'lists': return 'M.ciniki_musicfestivals_main.festival.openList(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'listsections': return 'M.ciniki_musicfestivals_main.festival.openListSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'listentries': return 'M.ciniki_musicfestivals_main.listentry.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'sponsors': return 'M.ciniki_musicfestivals_main.sponsor.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'sponsors-old': return 'M.startApp(\\'ciniki.sponsors.ref\\',null,\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'mc\\',{\\'ref_id\\':\\'' + d.sponsor.ref_id + '\\'});';\n }\n return '';\n }\n this.festival.rowClass = function(s, i, d) {\n if( s == 'competitor_cities' && this.city_prov == d.name ) {\n return 'highlight';\n }\n if( s == 'competitor_provinces' && this.province == d.name ) {\n return 'highlight';\n }\n if( s == 'schedule_sections' && this.schedulesection_id == d.id ) {\n return 'highlight';\n }\n if( s == 'schedule_divisions' && this.scheduledivision_id == d.id ) {\n return 'highlight';\n }\n if( (s == 'registration_sections' || s == 'emails_sections') && this.section_id == d.id ) {\n return 'highlight';\n }\n if( s == 'registration_teachers' && this.teacher_customer_id == d.id ) {\n return 'highlight';\n }\n if( s == 'registration_tags' && this.registration_tag == d.name ) {\n return 'highlight';\n }\n if( s == 'lists' && this.list_id == d.id ) {\n return 'highlight';\n }\n if( s == 'listsections' && this.listsection_id == d.id ) {\n return 'highlight';\n }\n if( s == 'message_statuses' && this.messages_status == d.status ) {\n return 'highlight';\n }\n if( s == 'invoice_statuses' && this.invoice_typestatus == d.typestatus ) {\n return 'highlight';\n }\n if( s == 'invoices' && this.invoice_typestatus == '' && s == 'invoices' ) {\n switch(d.status) { \n case '10': return 'statusorange';\n case '15': return 'statusorange';\n case '40': return 'statusorange';\n case '42': return 'statusred';\n case '50': return 'statusgreen';\n case '55': return 'statusorange';\n case '60': return 'statusgrey';\n case '65': return 'statusgrey';\n }\n }\n }\n this.festival.switchTab = function(tab, stab) {\n if( tab != null ) { this.sections._tabs.selected = tab; }\n if( stab != null ) { this.sections._stabs.selected = stab; }\n this.open();\n }\n this.festival.switchMTab = function(t) {\n this.sections._moretabs.selected = t;\n this.open();\n }\n this.festival.switchRegTab = function(t) {\n this.sections.registration_tabs.selected = t;\n this.open();\n }\n this.festival.switchCompTab = function(t) {\n this.sections.competitor_tabs.selected = t;\n this.open();\n }\n this.festival.switchLVTab = function(t) {\n this.sections.ipv_tabs.selected = t;\n this.open();\n }\n this.festival.switchEmailsTab = function(t) {\n this.sections.emails_tabs.selected = t;\n this.open();\n }\n this.festival.emailTeacherRegistrations = function() {\n M.ciniki_musicfestivals_main.emailregistrations.open('M.ciniki_musicfestivals_main.festival.show();');\n }\n this.festival.openSection = function(id,n) {\n this.lastY = 0;\n this.section_id = id;\n this.teacher_customer_id = 0;\n this.registration_tag = '';\n if( id > 0 ) {\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\n// this.sections.emails_list.label = 'Emails - ' + M.dU(n);\n this.sections.emails_html.label = 'Emails - ' + M.dU(n);\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\n } else {\n this.sections.registrations.label = 'Registrations';\n// this.sections.emails_list.label = 'Emails';\n this.sections.emails_html.label = 'Emails';\n this.sections.videos.label = 'Registrations';\n }\n this.open();\n }\n this.festival.openTeacher = function(id,n) {\n this.lastY = 0;\n this.teacher_customer_id = id;\n this.section_id = 0;\n this.registration_tag = '';\n if( id > 0 ) {\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\n } else {\n this.sections.registrations.label = 'Registrations';\n this.sections.videos.label = 'Registrations';\n }\n this.open();\n }\n this.festival.openTag = function(name, n) {\n this.lastY = 0;\n this.section_id = 0;\n this.teacher_customer_id = 0;\n this.registration_tag = unescape(name);\n if( name != '' ) {\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\n } else {\n this.sections.registrations.label = 'Registrations';\n this.sections.videos.label = 'Registrations';\n }\n this.open();\n \n }\n this.festival.openScheduleSection = function(i, n) {\n this.schedulesection_id = i;\n this.sections.schedule_divisions.label = M.dU(n);\n this.scheduledivision_id = 0;\n this.open();\n }\n this.festival.openScheduleDivision = function(i, n) {\n this.lastY = 0;\n this.scheduledivision_id = i;\n this.sections.schedule_timeslots.label = M.dU(n);\n this.open();\n }\n this.festival.openList = function(i, n) {\n this.list_id = i;\n this.sections.listsections.label = M.dU(n);\n this.scheduledivision_id = 0;\n this.open();\n }\n this.festival.openListSection = function(i, n) {\n this.lastY = 0;\n this.listsection_id = i;\n this.sections.listentries.label = M.dU(n);\n this.open();\n }\n this.festival.downloadExcel = function(fid) {\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\n } else if( this.sections.registration_tabs.selected == 'teachers' && this.teacher_customer_id > 0 ) {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'teacher_customer_id':this.teacher_customer_id});\n } else if( this.sections.registration_tabs.selected == 'tags' && this.registration_tag != '' ) {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'registration_tag':this.registration_tag});\n } else {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid});\n }\n }\n this.festival.downloadPDF = function(fid) {\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\n } else {\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid});\n }\n }\n this.festival.openInvoiceStatus = function(s) {\n this.lastY = 0;\n this.invoice_typestatus = s;\n this.open();\n }\n this.festival.invoiceTransaction = function(i, t) {\n M.startApp('ciniki.sapos.invoice', null, 'M.ciniki_musicfestivals_main.festival.open();', 'mc', {'invoice_id':i, 'transaction_amount':t});\n }\n this.festival.openCompetitorCity = function(c) {\n this.lastY = 0;\n this.city_prov = unescape(c);\n this.open();\n }\n this.festival.openCompetitorProv = function(c) {\n this.lastY = 0;\n this.province = unescape(c);\n this.open();\n }\n this.festival.openMessageStatus = function(s) {\n this.messages_status = s;\n this.open();\n }\n this.festival.reopen = function(cb,fid,list) {\n if( this.sections._tabs.selected == 'sections' ) {\n if( M.gE(this.panelUID + '_syllabus_search').value != '' ) {\n this.sections.syllabus_search.lastsearch = M.gE(this.panelUID + '_syllabus_search').value;\n }\n }\n if( this.sections._tabs.selected == 'registrations' ) {\n if( M.gE(this.panelUID + '_registration_search').value != '' ) {\n this.sections.registration_search.lastsearch = M.gE(this.panelUID + '_registration_search').value;\n }\n }\n this.open(cb,fid,list);\n }\n this.festival.open = function(cb, fid, list) {\n if( fid != null ) { this.festival_id = fid; }\n var args = {'tnid':M.curTenantID, 'festival_id':this.festival_id};\n this.size = 'xlarge narrowaside';\n if( this.sections._tabs.selected == 'sections' ) {\n if( this.sections._stabs.selected == 'sections' ) {\n args['sections'] = 'yes';\n } else if( this.sections._stabs.selected == 'categories' ) {\n args['categories'] = 'yes';\n } else if( this.sections._stabs.selected == 'classes' ) {\n args['classes'] = 'yes';\n }\n } else if( this.sections._tabs.selected == 'registrations' || this.sections._tabs.selected == 'videos' ) {\n this.size = 'xlarge narrowaside';\n args['sections'] = 'yes';\n args['registrations'] = 'yes';\n args['ipv'] = this.sections.ipv_tabs.selected;\n\n } else if( this.sections._tabs.selected == 'schedule' ) {\n this.size = 'medium mediumaside';\n args['schedule'] = 'yes';\n args['ssection_id'] = this.schedulesection_id;\n args['sdivision_id'] = this.scheduledivision_id;\n this.sections.schedule_sections.changeTxt = 'Add Schedule';\n this.sections.schedule_sections.addTxt = 'Unscheduled';\n this.sections.schedule_divisions.addTxt = 'Add Division';\n } else if( this.sections._tabs.selected == 'comments' ) {\n this.size = 'xlarge narrowaside';\n args['schedule'] = 'yes';\n args['comments'] = 'yes';\n args['ssection_id'] = this.schedulesection_id;\n args['sdivision_id'] = this.scheduledivision_id;\n args['adjudicators'] = 'yes';\n this.sections.schedule_sections.addTxt = '';\n this.sections.schedule_sections.changeTxt = '';\n this.sections.schedule_divisions.addTxt = '';\n } else if( this.sections._tabs.selected == 'competitors' ) {\n this.size = 'xlarge narrowaside';\n args['competitors'] = 'yes';\n if( this.sections.competitor_tabs.selected == 'cities' ) {\n args['city_prov'] = M.eU(this.city_prov);\n } else if( this.sections.competitor_tabs.selected == 'provinces' ) {\n args['province'] = M.eU(this.province);\n } \n } else if( this.sections._tabs.selected == 'photos' ) {\n this.size = 'xlarge narrowaside';\n args['schedule'] = 'yes';\n args['photos'] = 'yes';\n args['ssection_id'] = this.schedulesection_id;\n args['sdivision_id'] = this.scheduledivision_id;\n args['adjudicators'] = 'no';\n this.sections.schedule_sections.addTxt = '';\n this.sections.schedule_sections.changeTxt = '';\n this.sections.schedule_divisions.addTxt = '';\n this.sections.schedule_divisions.changeTxt = '';\n } else if( this.isSelected('more', 'lists') == 'yes' ) {\n args['lists'] = 'yes';\n args['list_id'] = this.list_id;\n args['listsection_id'] = this.listsection_id;\n } else if( this.isSelected('more', 'invoices') == 'yes' ) {\n this.size = 'xlarge narrowaside';\n args['invoices'] = 'yes';\n if( this.invoice_typestatus > 0 ) {\n args['invoice_typestatus'] = this.invoice_typestatus;\n }\n } else if( this.isSelected('more', 'adjudicators') == 'yes' ) {\n this.size = 'xlarge';\n args['adjudicators'] = 'yes';\n } else if( this.isSelected('more', 'files') == 'yes' ) {\n this.size = 'xlarge';\n args['files'] = 'yes';\n } else if( this.isSelected('more', 'certificates') == 'yes' ) {\n this.size = 'xlarge';\n args['certificates'] = 'yes';\n } else if( this.sections._tabs.selected == 'messages' ) {\n args['messages'] = 'yes';\n // Which emails to get\n args['messages_status'] = this.messages_status;\n this.sections.messages.headerValues[1] = 'Date';\n if( this.messages_status == 30 ) {\n this.sections.messages.headerValues[1] = 'Scheduled';\n } else if( this.messages_status == 50 ) {\n this.sections.messages.headerValues[1] = 'Sent';\n }\n } else if( this.isSelected('more', 'emails') == 'yes' ) {\n args['sections'] = 'yes';\n // Which emails to get\n args['emails_list'] = this.sections.emails_tabs.selected;\n } else if( this.isSelected('more', 'sponsors') == 'yes' ) {\n //} else if( this.sections._tabs.selected == 'sponsors' ) {\n this.size = 'xlarge';\n args['sponsors'] = 'yes';\n } else if( this.isSelected('more', 'sponsors-old') == 'yes' ) {\n args['sponsors'] = 'yes';\n }\n if( this.section_id > 0 ) {\n args['section_id'] = this.section_id;\n }\n if( this.teacher_customer_id > 0 ) {\n args['teacher_customer_id'] = this.teacher_customer_id;\n }\n if( this.registration_tag != '' ) {\n args['registration_tag'] = this.registration_tag;\n }\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', args, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.festival;\n p.data = rsp.festival;\n p.label = rsp.festival.name;\n p.sections.registration_search.livesearchcols = 5;\n p.sections.registrations.num_cols = 5;\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status'];\n if( (rsp.festival.flags&0x10) == 0x10 ) {\n p.sections.registration_search.livesearchcols = 6;\n p.sections.registrations.num_cols = 6;\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Plus'];\n } else if( (rsp.festival.flags&0x02) == 0x02 ) {\n p.sections.registration_search.livesearchcols = 6;\n p.sections.registrations.num_cols = 6;\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'];\n }\n p.sections.timeslot_comments.headerValues[2] = '';\n p.sections.timeslot_comments.headerValues[3] = '';\n p.sections.timeslot_comments.headerValues[4] = '';\n if( rsp.festival.sections != null ) {\n p.data.registration_sections = [];\n p.data.emails_sections = [];\n p.data.registration_sections.push({'id':0, 'name':'All'});\n p.data.emails_sections.push({'id':0, 'name':'All'});\n for(var i in rsp.festival.sections) {\n// p.data.registration_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\n p.data.registration_sections.push(rsp.festival.sections[i]);\n p.data.emails_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\n }\n// p.data.registration_sections = rsp.festival.sections;\n }\n if( rsp.festival.schedule_sections != null ) {\n for(var i in rsp.festival.schedule_sections) {\n if( p.schedulesection_id > 0 && rsp.festival.schedule_sections[i].id == p.schedulesection_id ) {\n if( rsp.festival.schedule_sections[i].adjudicator1_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id] != null ) {\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id].name;\n }\n if( rsp.festival.schedule_sections[i].adjudicator2_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id] != null ) {\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id].name;\n }\n if( rsp.festival.schedule_sections[i].adjudicator3_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id] != null ) {\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id].name;\n }\n }\n }\n }\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.refresh();\n p.show(cb);\n // \n // Auto remember last search\n //\n if( p.sections['syllabus_search'].lastsearch != null \n && p.sections['syllabus_search'].lastsearch != '' \n ) {\n M.gE(p.panelUID + '_syllabus_search').value = p.sections['syllabus_search'].lastsearch;\n var t = M.gE(p.panelUID + '_syllabus_search_livesearch_grid');\n t.style.display = 'table';\n p.liveSearchCb('syllabus_search', null, p.sections['syllabus_search'].lastsearch);\n delete p.sections['syllabus_search'].lastsearch;\n }\n else if( p.sections['registration_search'].lastsearch != null \n && p.sections['registration_search'].lastsearch != '' \n ) {\n M.gE(p.panelUID + '_registration_search').value = p.sections['registration_search'].lastsearch;\n var t = M.gE(p.panelUID + '_registration_search_livesearch_grid');\n t.style.display = 'table';\n p.liveSearchCb('registration_search', null, p.sections['registration_search'].lastsearch);\n delete p.sections['registration_search'].lastsearch;\n }\n });\n }\n this.festival.timeslotImageAdd = function(tid, row) {\n this.timeslot_image_uploader_tid = tid;\n this.timeslot_image_uploader_row = row;\n this.image_uploader = M.aE('input', this.panelUID + '_' + tid + '_upload', 'file_uploader');\n this.image_uploader.setAttribute('name', tid);\n this.image_uploader.setAttribute('type', 'file');\n this.image_uploader.setAttribute('onchange', 'M.ciniki_musicfestivals_main.festival.timeslotImageUpload();');\n this.image_uploader.click();\n }\n this.festival.timeslotImageUpload = function() {\n var files = this.image_uploader.files;\n M.startLoad();\n M.api.postJSONFile('ciniki.musicfestivals.timeslotImageDrop', {'tnid':M.curTenantID, 'festival_id':this.festival_id, \n 'timeslot_id':this.timeslot_image_uploader_tid},\n files[0],\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.stopLoad();\n M.api.err(rsp);\n return false;\n }\n M.stopLoad();\n var p = M.ciniki_musicfestivals_main.festival;\n var t = M.gE(p.panelUID + '_timeslot_photos_grid');\n var cell = t.children[0].children[p.timeslot_image_uploader_row].children[1];\n cell.innerHTML += '';\n });\n }\n this.festival.festivalCopy = function(old_fid) {\n M.api.getJSONCb('ciniki.musicfestivals.festivalCopy', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'old_festival_id':old_fid}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.festival.open();\n });\n }\n this.festival.syllabusDownload = function() {\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id});\n }\n this.festival.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.festival.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');';\n }\n return null;\n }\n this.festival.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');';\n }\n return null;\n }\n this.festival.addButton('edit', 'Edit', 'M.ciniki_musicfestivals_main.edit.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id);');\n this.festival.addClose('Back');\n this.festival.addButton('next', 'Next');\n this.festival.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Festival\n //\n this.edit = new M.panel('Festival', 'ciniki_musicfestivals_main', 'edit', 'mc', 'large mediumaside', 'sectioned', 'ciniki.musicfestivals.main.edit');\n this.edit.data = null;\n this.edit.festival_id = 0;\n this.edit.nplist = [];\n this.edit.sections = {\n/* '_document_logo_id':{'label':'Document Header Logo', 'type':'imageform', 'aside':'yes', 'fields':{\n 'header_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue('header_logo_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\n return true;\n },\n },\n }}, */\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'name':{'label':'Name', 'type':'text'},\n 'start_date':{'label':'Start', 'type':'date'},\n 'end_date':{'label':'End', 'type':'date'},\n 'status':{'label':'Status', 'type':'toggle', 'toggles':{'10':'Active', '30':'Current', '60':'Archived'}},\n 'flags1':{'label':'Registrations Open', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags'},\n 'flags2':{'label':'Virtual Option', 'type':'flagtoggle', 'default':'off', 'bit':0x02, 'field':'flags',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x4000); },\n 'on_fields':['flags3','virtual_date', 'upload_end_dt'],\n },\n 'flags3':{'label':'Virtual Pricing', 'type':'flagtoggle', 'default':'off', 'bit':0x04, 'field':'flags', 'visible':'no'},\n 'flags4':{'label':'Section End Dates', 'type':'flagtoggle', 'default':'off', 'bit':0x08, 'field':'flags'},\n 'flags5':{'label':'Adjudication Plus', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\n },\n 'earlybird_date':{'label':'Earlybird Deadline', 'type':'datetime'},\n 'live_date':{'label':'Live Deadline', 'type':'datetime'},\n 'virtual_date':{'label':'Virtual Deadline', 'type':'datetime', 'visible':'no'},\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime'},\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime', 'visible':'no'},\n }},\n '_settings':{'label':'', 'aside':'yes', 'fields':{\n 'age-restriction-msg':{'label':'Age Restriction Message', 'type':'text'},\n 'president-name':{'label':'President Name', 'type':'text'},\n }},\n// Remove 2022, could be readded in future\n// '_hybrid':{'label':'In Person/Virtual Choices', 'aside':'yes', 'fields':{\n// 'inperson-choice-msg':{'label':'In Person Choice', 'type':'text', 'hint':'in person on a scheduled date'},\n// 'virtual-choice-msg':{'label':'Virtual Choice', 'type':'text', 'hint':'virtually and submit a video'},\n// }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'documents', 'tabs':{\n// 'website':{'label':'Website', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\'website\\');'},\n 'documents':{'label':'Documents', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\'documents\\');'},\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\'registrations\\');'},\n }},\n '_primary_image_id':{'label':'Primary Image', 'type':'imageform', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\n 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue('primary_image_id', iid, null, null);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\n return true;\n },\n },\n }},\n '_description':{'label':'Description', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\n 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_document_logo_id':{'label':'Document Image', 'type':'imageform',\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'document_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue('document_logo_id', iid, null, null);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\n return true;\n },\n },\n }},\n '_document_header_msg':{'label':'Header Message', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'document_header_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n '_document_footer_msg':{'label':'Footer Message', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'document_footer_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n '_comments_pdf':{'label':'Comments PDF Options', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'flags6':{'label':'Header Adjudicator Name', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\n 'flags7':{'label':'Timeslot Date/Time', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\n 'comments_grade_label':{'label':'Grade Label', 'default':'Mark', 'type':'text'},\n 'comments_footer_msg':{'label':'Footer Message', 'type':'text'},\n }},\n '_certificates_pdf':{'label':'Certificates PDF Options', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'flags8':{'label':'Include Pronouns', 'type':'flagtoggle', 'default':'off', 'bit':0x80, 'field':'flags'},\n }},\n '_syllabus':{'label':'Syllabus Options', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'flags5':{'label':'Include Section/Category as Class Name', 'type':'flagtoggle', 'default':'off', 'bit':0x0100, 'field':'flags'},\n }},\n '_registration_parent_msg':{'label':'Registration Form', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'registration-parent-msg':{'label':'Parents Intro', 'type':'textarea', 'size':'medium'},\n 'registration-teacher-msg':{'label':'Teachers Intro', 'type':'textarea', 'size':'medium'},\n 'registration-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\n }},\n '_competitor_parent_msg':{'label':'Individual Competitor Form', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'competitor-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-individual-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\n }},\n }},\n '_competitor_group_parent_msg':{'label':'Group/Ensemble Competitor Form', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'competitor-group-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-group-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-group-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-group-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\n }},\n }},\n '_waiver':{'label':'Waiver Message', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'waiver-title':{'label':'Title', 'type':'text'},\n 'waiver-msg':{'label':'Message', 'type':'textarea', 'size':'medium'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\n 'updatename':{'label':'Update Public Names', \n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.edit.updateNames();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\n }},\n };\n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.festivalHistory', 'args':{'tnid':M.curTenantID, 'festival_id':this.festival_id, 'field':i}};\n }\n this.edit.switchTab = function(tab) {\n this.sections._tabs.selected = tab;\n this.showHideSection('_primary_image_id');\n this.showHideSection('_description');\n this.showHideSection('_document_logo_id');\n this.showHideSection('_document_header_msg');\n this.showHideSection('_document_footer_msg');\n this.showHideSection('_comments_pdf');\n this.showHideSection('_certificates_pdf');\n this.showHideSection('_syllabus');\n this.showHideSection('_registration_parent_msg');\n this.showHideSection('_registration_teacher_msg');\n this.showHideSection('_registration_adult_msg');\n this.showHideSection('_competitor_parent_msg');\n this.showHideSection('_competitor_teacher_msg');\n this.showHideSection('_competitor_adult_msg');\n this.showHideSection('_competitor_group_parent_msg');\n this.showHideSection('_competitor_group_teacher_msg');\n this.showHideSection('_competitor_group_adult_msg');\n this.showHideSection('_waiver');\n this.refreshSection('_tabs');\n }\n this.edit.updateNames = function() {\n M.api.getJSONCb('ciniki.musicfestivals.registrationNamesUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.alert(\"Done\");\n });\n }\n this.edit.open = function(cb, fid, list) {\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.edit;\n p.data = rsp.festival;\n if( (rsp.festival.flags&0x02) == 0x02 ) {\n p.sections.general.fields.flags3.visible = 'yes';\n p.sections.general.fields.virtual_date.visible = 'yes';\n p.sections.general.fields.upload_end_dt.visible = 'yes';\n } else {\n p.sections.general.fields.virtual_date.visible = 'no';\n p.sections.general.fields.upload_end_dt.visible = 'no';\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.edit.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.edit.close();'; }\n if( this.festival_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.festivalUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.festivalAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.edit.festival_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.edit.remove = function() {\n M.confirm('Are you sure you want to remove festival?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.festivalDelete', {'tnid':M.curTenantID, 'festival_id':M.ciniki_musicfestivals_main.edit.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.edit.close();\n });\n });\n }\n this.edit.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.edit.save(\\'M.ciniki_musicfestivals_main.edit.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');\\');';\n }\n return null;\n }\n this.edit.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.edit.save(\\'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');\\');';\n }\n return null;\n }\n this.edit.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.edit.save();');\n this.edit.addClose('Cancel');\n this.edit.addButton('next', 'Next');\n this.edit.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Section\n //\n this.section = new M.panel('Section', 'ciniki_musicfestivals_main', 'section', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.section');\n this.section.data = null;\n this.section.festival_id = 0;\n this.section.section_id = 0;\n this.section.nplists = {};\n this.section.nplist = [];\n this.section.sections = {\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id',0);\n return true;\n },\n },\n }},\n 'general':{'label':'Section', 'aside':'yes', 'fields':{\n 'name':{'label':'Name', 'type':'text', 'required':'yes'},\n 'sequence':{'label':'Order', 'type':'text', 'required':'yes', 'size':'small'},\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Hidden'}}},\n 'live_end_dt':{'label':'Live Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x08) == 0x08 ? 'yes' : 'no';},\n },\n 'virtual_end_dt':{'label':'Virtual Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\n },\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\n },\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\n },\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'categories', 'tabs':{\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\'categories\\');'},\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\'synopsis\\');'},\n }},\n '_synopsis':{'label':'Synopsis', \n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\n },\n '_description':{'label':'Description', \n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\n },\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'categories' ? 'yes' : 'hidden'; },\n 'addTxt':'Add Category',\n 'addFn':'M.ciniki_musicfestivals_main.section.openCategory(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\n }},\n };\n this.section.fieldValue = function(s, i, d) { return this.data[i]; }\n this.section.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.sectionHistory', 'args':{'tnid':M.curTenantID, 'section_id':this.section_id, 'field':i}};\n }\n this.section.cellValue = function(s, i, j, d) {\n switch (j) {\n case 0: return d.name;\n }\n }\n this.section.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.section.openCategory(\\'' + d.id + '\\');';\n }\n this.section.openCategory = function(cid) {\n this.save(\"M.ciniki_musicfestivals_main.category.open('M.ciniki_musicfestivals_main.section.open();', '\" + cid + \"', this.section_id, this.festival_id, this.nplists.categories);\");\n }\n this.section.switchTab = function(tab) {\n this.sections._tabs.selected = tab;\n this.refresh();\n this.show();\n }\n this.section.downloadSyllabusPDF = function() {\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\n }\n this.section.open = function(cb, sid, fid, list) {\n if( sid != null ) { this.section_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.sectionGet', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'categories':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.section;\n p.data = rsp.section;\n p.festival_id = rsp.section.festival_id;\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.section.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.section.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.section_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.sectionUpdate', {'tnid':M.curTenantID, 'section_id':this.section_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.sectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.section.section_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.section.remove = function() {\n M.confirm('Are you sure you want to remove section?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.sectionDelete', {'tnid':M.curTenantID, 'section_id':M.ciniki_musicfestivals_main.section.section_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.section.close();\n });\n });\n }\n this.section.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.section.save(\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');\\');';\n }\n return null;\n }\n this.section.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.section.save(\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');\\');';\n }\n return null;\n }\n this.section.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\n this.section.addClose('Cancel');\n this.section.addButton('next', 'Next');\n this.section.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Section Classes\n //\n this.classes = new M.panel('Section', 'ciniki_musicfestivals_main', 'classes', 'mc', 'full', 'sectioned', 'ciniki.musicfestivals.main.classes');\n this.classes.data = null;\n this.classes.festival_id = 0;\n this.classes.section_id = 0;\n this.classes.nplists = {};\n this.classes.nplist = [];\n this.classes.sections = {\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'fees', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x40); },\n 'tabs':{\n 'fees':{'label':'Fees', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\"fees\");'},\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\"trophies\");'},\n }},\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':7,\n 'headerValues':['Order', 'Category', 'Code', 'Class', 'Levels', 'Earlybird', 'Live', 'Virtual'],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'text', 'number', 'number', 'number'],\n 'dataMaps':['joined_sequence', 'category_name', 'code', 'class_name', 'level', 'earlybird_fee', 'fee', 'virtual_fee'],\n },\n/* '_buttons':{'label':'', 'halfsize':'yes', 'buttons':{\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\n }}, */\n };\n this.classes.switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.open();\n }\n this.classes.cellValue = function(s, i, j, d) {\n if( this.sections.classes.dataMaps[j] != null ) {\n if( this.sections.classes.dataMaps[j].match(/fee/) ) {\n return M.formatDollar(d[this.sections.classes.dataMaps[j]]);\n }\n if( this.sections.classes.dataMaps[j] == 'num_registrations' && d[this.sections.classes.dataMaps[j]] == 0 ) {\n return '';\n }\n return d[this.sections.classes.dataMaps[j]];\n }\n }\n this.classes.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.classes.open();\\',\\'' + d.id + '\\',\\'' + d.category_id + '\\',\\'' + this.festival_id + '\\',M.ciniki_musicfestivals_main.classes.nplists.classes);';\n }\n this.classes.downloadSyllabusPDF = function() {\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\n }\n this.classes.open = function(cb, sid, fid, list) {\n if( sid != null ) { this.section_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.sectionClasses', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'list':this.sections._tabs.selected}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.classes;\n p.data = rsp;\n p.sections.classes.headerValues = ['Order', 'Category', 'Code', 'Class'];\n p.sections.classes.sortTypes = ['text', 'text', 'text', 'text'];\n p.sections.classes.dataMaps = ['joined_sequence', 'category_name', 'code', 'class_name'];\n if( p.sections._tabs.selected == 'trophies' ) {\n p.sections.classes.headerValues.push('Trophies');\n p.sections.classes.sortTypes.push('text');\n p.sections.classes.dataMaps.push('trophies');\n } else {\n if( M.modFlagOn('ciniki.musicfestivals', 0x1000) ) {\n p.sections.classes.headerValues.push('Levels');\n p.sections.classes.sortTypes.push('text');\n p.sections.classes.dataMaps.push('levels');\n }\n p.sections.classes.headerValues.push('Earlybird');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('earlybird_fee');\n p.sections.classes.headerValues.push('Fee');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('fee');\n if( (rsp.festival.flags&0x04) == 0x04 ) {\n p.sections.classes.headerValues.push('Virtual');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('virtual_fee');\n }\n if( M.modFlagOn('ciniki.musicfestivals', 0x0800) ) {\n p.sections.classes.headerValues.push('Earlybird Plus');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('earlybird_plus_fee');\n p.sections.classes.headerValues.push('Plus');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('plus_fee');\n }\n p.sections.classes.headerValues.push('Registrations');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('num_registrations');\n p.sections.classes.num_cols = p.sections.classes.headerValues.length;\n }\n\n p.festival_id = rsp.section.festival_id;\n p.sections.classes.label = rsp.section.name + ' - Classes';\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.classes.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');';\n }\n return null;\n }\n this.classes.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');';\n }\n return null;\n }\n this.classes.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\n this.classes.addClose('Cancel');\n this.classes.addButton('next', 'Next');\n this.classes.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Category\n //\n this.category = new M.panel('Category', 'ciniki_musicfestivals_main', 'category', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.category');\n this.category.data = null;\n this.category.category_id = 0;\n this.category.nplists = {};\n this.category.nplist = [];\n this.category.sections = {\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.category.setFieldValue('primary_image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.category.setFieldValue(fid,0);\n return true;\n },\n },\n }},\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'section_id':{'label':'Section', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'sequence':{'label':'Order', 'required':'yes', 'type':'text'},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'classes', 'tabs':{\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\'classes\\');'},\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\'synopsis\\');'},\n }},\n '_synopsis':{'label':'Synopsis', \n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\n },\n '_description':{'label':'Description', \n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\n },\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'classes' ? 'yes' : 'hidden'; },\n 'headerValues':['Code', 'Name', 'Earlybird', 'Fee', 'Virtual'],\n 'addTxt':'Add Class',\n 'addFn':'M.ciniki_musicfestivals_main.category.openClass(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.category.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.category.category_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.category.remove();'},\n }},\n };\n this.category.fieldValue = function(s, i, d) { return this.data[i]; }\n this.category.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.categoryHistory', 'args':{'tnid':M.curTenantID, 'category_id':this.category_id, 'field':i}};\n }\n this.category.cellValue = function(s, i, j, d) {\n switch (j) {\n case 0: return d.code;\n case 1: return d.name;\n case 2: return (d.earlybird_fee > 0 ? M.formatDollar(d.earlybird_fee) : '');\n case 3: return (d.fee > 0 ? M.formatDollar(d.fee) : '');\n case 4: return (d.virtual_fee > 0 ? M.formatDollar(d.virtual_fee) : '');\n }\n }\n this.category.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.category.openClass(\\'' + d.id + '\\');';\n }\n this.category.openClass = function(cid) {\n this.save(\"M.ciniki_musicfestivals_main.class.open('M.ciniki_musicfestivals_main.category.open();','\" + cid + \"', this.category_id, this.festival_id, this.nplists.classes);\");\n }\n this.category.switchTab = function(tab) {\n this.sections._tabs.selected = tab;\n this.refresh();\n this.show();\n }\n this.category.open = function(cb, cid, sid,fid,list) {\n if( cid != null ) { this.category_id = cid; }\n if( sid != null ) { this.section_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.categoryGet', {'tnid':M.curTenantID, \n 'category_id':this.category_id, 'festival_id':this.festival_id, 'section_id':this.section_id,\n 'sections':'yes', 'classes':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.category;\n p.data = rsp.category;\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.sections.general.fields.section_id.options = rsp.sections;\n if( M.ciniki_musicfestivals_main.festival.data.flags != null \n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \n ) {\n p.sections.classes.num_cols = 5;\n } else {\n p.sections.classes.num_cols = 4;\n }\n\n p.refresh();\n p.show(cb);\n });\n }\n this.category.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.category.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.category_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.categoryUpdate', {'tnid':M.curTenantID, 'category_id':this.category_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.categoryAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.category.category_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.category.remove = function() {\n M.confirm('Are you sure you want to remove category?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.categoryDelete', {'tnid':M.curTenantID, 'category_id':M.ciniki_musicfestivals_main.category.category_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.category.close();\n });\n });\n }\n this.category.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.category.save(\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) + 1] + ');\\');';\n }\n return null;\n }\n this.category.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.category.save(\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) - 1] + ');\\');';\n }\n return null;\n }\n this.category.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.category.save();');\n this.category.addClose('Cancel');\n this.category.addButton('next', 'Next');\n this.category.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Class\n //\n this.class = new M.panel('Class', 'ciniki_musicfestivals_main', 'class', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.class');\n this.class.data = null;\n this.class.festival_id = 0;\n this.class.class_id = 0;\n this.class.nplists = {};\n this.class.nplist = [];\n this.class.sections = {\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'category_id':{'label':'Category', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'code':{'label':'Code', 'type':'text', 'size':'small'},\n 'name':{'label':'Name', 'type':'text'},\n// 'level':{'label':'Level', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n// 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\n// },\n 'levels':{'label':'Level', 'type':'tags', 'tags':[], 'hint':'Enter a new level:', 'sort':'no',\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\n },\n 'sequence':{'label':'Order', 'type':'text'},\n 'earlybird_fee':{'label':'Earlybird Fee', 'type':'text', 'size':'small'},\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\n 'virtual_fee':{'label':'Virtual Fee', 'type':'text', 'size':'small',\n 'visible':function() { \n if( M.ciniki_musicfestivals_main.festival.data.flags != null \n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \n ) {\n return 'yes';\n }\n return 'no';\n },\n },\n 'earlybird_plus_fee':{'label':'Earlybird Plus Fee', 'type':'text', 'size':'small',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\n },\n 'plus_fee':{'label':'Plus Fee', 'type':'text', 'size':'small',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\n },\n }},\n// '_tags':{'label':'Tags', \n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n// 'fields':{\n// }},\n 'registration':{'label':'Registration Options', 'aside':'yes', 'fields':{\n 'flags1':{'label':'Online Registrations', 'type':'flagtoggle', 'default':'on', 'bit':0x01, 'field':'flags'},\n 'flags2':{'label':'Multiple/Registrant', 'type':'flagtoggle', 'default':'on', 'bit':0x02, 'field':'flags'},\n 'flags5':{'label':'2nd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags'},\n 'flags6':{'label':'3rd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\n 'flags7':{'label':'4th Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\n 'flags13':{'label':'2nd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x1000, 'field':'flags'},\n 'flags14':{'label':'2nd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x2000, 'field':'flags'},\n 'flags15':{'label':'3rd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x4000, 'field':'flags'},\n 'flags16':{'label':'3rd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x8000, 'field':'flags'},\n }},\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':3, \n 'headerValues':['Competitor', 'Teacher', 'Status'],\n 'noData':'No registrations',\n// 'addTxt':'Add Registration',\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.class.class_id,M.ciniki_musicfestivals_main.festival.festival_id,null,\\'festival\\');',\n },\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':3, \n 'headerValues':['Category', 'Name'],\n 'cellClasses':['', '', 'alignright'],\n 'noData':'No trophies',\n 'addTxt':'Add Trophy',\n 'addFn':'M.ciniki_musicfestivals_main.class.save(\"M.ciniki_musicfestivals_main.class.addTrophy();\");',\n },\n '_buttons':{'label':'', 'aside':'yes', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.class.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.class.class_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.class.remove();'},\n }},\n };\n this.class.fieldValue = function(s, i, d) { return this.data[i]; }\n this.class.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.classHistory', 'args':{'tnid':M.curTenantID, 'class_id':this.class_id, 'field':i}};\n }\n this.class.cellValue = function(s, i, j, d) {\n if( s == 'registrations' ) {\n switch(j) {\n case 0: return d.display_name; // + M.subdue(' (',d.pronoun,')');\n case 1: return d.teacher_name;\n case 2: return d.status_text;\n }\n }\n if( s == 'trophies' ) {\n switch(j) {\n case 0: return d.category;\n case 1: return d.name;\n case 2: return '';\n }\n }\n }\n this.class.rowFn = function(s, i, d) {\n if( s == 'registrations' ) {\n return 'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.class.open();\\',\\'' + d.id + '\\',0,0,M.ciniki_musicfestivals_main.class.festival_id, null,\\'festival\\');';\n }\n return '';\n }\n this.class.addTrophy = function() {\n M.ciniki_musicfestivals_main.classtrophy.open('M.ciniki_musicfestivals_main.class.open();',this.class_id);\n }\n this.class.attachTrophy = function(i) {\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyAdd', {'tnid':M.curTenantID, 'class_id':this.class_id, 'trophy_id':i}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.open();\n });\n }\n this.class.removeTrophy = function(i) {\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyRemove', {'tnid':M.curTenantID, 'class_id':this.class_id, 'tc_id':i}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.open();\n });\n }\n/* this.class.liveSearchCb = function(s, i, value) {\n if( i == 'level' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.classFieldSearch', {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'festival_id':M.ciniki_musicfestivals_main.class.festival_id, 'limit':15}, \n function(rsp) {\n M.ciniki_musicfestivals_main.class.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.class.panelUID + '_' + i), rsp.results); \n });\n }\n }\n this.class.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n this.class.liveSearchResultRowFn = function(s, f, i, j, d) {\n if( f == 'level' ) {\n return 'M.ciniki_musicfestivals_main.class.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.name) + '\\');';\n }\n }\n this.class.updateField = function(s, f, r) {\n M.gE(this.panelUID + '_' + f).value = unescape(r);\n this.removeLiveSearch(s, f);\n } */\n this.class.open = function(cb, iid, cid, fid, list) {\n if( iid != null ) { this.class_id = iid; }\n if( cid != null ) { this.category_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.classGet', {'tnid':M.curTenantID, 'class_id':this.class_id, 'festival_id':this.festival_id, 'category_id':this.category_id, \n 'registrations':'yes', 'categories':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.class;\n p.data = rsp.class;\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.sections.general.fields.category_id.options = rsp.categories;\n p.sections.general.fields.levels.tags = [];\n if( rsp.levels != null ) {\n p.sections.general.fields.levels.tags = rsp.levels;\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.class.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.class.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.class_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.classUpdate', {'tnid':M.curTenantID, 'class_id':this.class_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.classAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.class_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.class.remove = function() {\n M.confirm('Are you sure you want to remove class?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.classDelete', {'tnid':M.curTenantID, 'class_id':M.ciniki_musicfestivals_main.class.class_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.close();\n });\n });\n }\n this.class.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.class.save(\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) + 1] + ');\\');';\n }\n return null;\n }\n this.class.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.class.save(\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) - 1] + ');\\');';\n }\n return null;\n }\n this.class.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.class.save();');\n this.class.addClose('Cancel');\n this.class.addButton('next', 'Next');\n this.class.addLeftButton('prev', 'Prev');\n\n //\n // This panel lets the user select a trophy to attach to a class\n //\n this.classtrophy = new M.panel('Select Trophy', 'ciniki_musicfestivals_main', 'classtrophy', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophyclass');\n this.classtrophy.sections = {\n 'trophies':{'label':'Select Trophy', 'type':'simplegrid', 'num_cols':3,\n 'noData':'No trophies',\n },\n };\n this.classtrophy.cellValue = function(s, i, j, d) {\n if( s == 'trophies' ) {\n switch(j) {\n case 0: return d.category;\n case 1: return d.name;\n case 2: return '';\n }\n }\n }\n this.classtrophy.open = function(cb, cid) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID, 'class_id':cid}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.classtrophy;\n p.data = rsp;\n p.refresh();\n p.show(cb);\n });\n }\n this.classtrophy.addClose('Back');\n\n //\n // Registration\n //\n this.registration = new M.panel('Registration', 'ciniki_musicfestivals_main', 'registration', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.registration');\n this.registration.data = null;\n this.registration.festival_id = 0;\n this.registration.teacher_customer_id = 0;\n this.registration.competitor1_id = 0;\n this.registration.competitor2_id = 0;\n this.registration.competitor3_id = 0;\n this.registration.competitor4_id = 0;\n// this.registration.competitor5_id = 0;\n this.registration.registration_id = 0;\n this.registration.nplist = [];\n this.registration._source = '';\n this.registration.sections = {\n// '_tabs':{'label':'', 'type':'paneltabs', 'field_id':'rtype', 'selected':'30', 'tabs':{\n// '30':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"30\");'},\n// '50':{'label':'Duet', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"50\");'},\n// '60':{'label':'Trio', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"60\");'},\n// '90':{'label':'Ensemble', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"90\");'},\n// }},\n 'teacher_details':{'label':'Teacher', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\',\\'customer_id\\':M.ciniki_musicfestivals_main.registration.teacher_customer_id});',\n 'changeTxt':'Change',\n 'changeFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\',\\'customer_id\\':0});',\n },\n '_display_name':{'label':'Duet/Trio/Ensemble Name', 'aside':'yes',\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\n 'fields':{ \n 'display_name':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n 'competitor1_details':{'label':'Competitor 1', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['label', ''],\n 'addTxt':'',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 1);',\n 'changeTxt':'Add',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 1);',\n },\n 'competitor2_details':{'label':'Competitor 2', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>30?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 2);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 2);',\n },\n 'competitor3_details':{'label':'Competitor 3', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>50?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 3);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 3);',\n },\n 'competitor4_details':{'label':'Competitor 4', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 4);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 4);',\n },\n/* 'competitor5_details':{'label':'Competitor 5', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 5);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 5);',\n }, */\n 'invoice_details':{'label':'Invoice', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['label', ''],\n },\n '_class':{'label':'Registration', 'fields':{\n// 'status':{'label':'Status', 'required':'yes', 'type':'toggle', 'toggles':{'5':'Draft', '10':'Applied', '50':'Paid', '60':'Cancelled'}},\n// 'payment_type':{'label':'Payment', 'type':'toggle', 'toggles':{'20':'Square', '50':'Visa', '55':'Mastercard', '100':'Cash', '105':'Cheque', '110':'Email', '120':'Other', '121':'Online'}},\n 'class_id':{'label':'Class', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\n },\n 'title1':{'label':'Title', 'type':'text'},\n 'perf_time1':{'label':'Perf Time', 'type':'minsec', 'size':'small'},\n 'title2':{'label':'2nd Title', 'type':'text',\n 'visible':'no',\n },\n 'perf_time2':{'label':'2nd Time', 'type':'minsec', 'max_minutes':30, 'second_interval':5, 'size':'small',\n 'visible':'no',\n },\n 'title3':{'label':'3rd Title', 'type':'text',\n 'visible':'no',\n },\n 'perf_time3':{'label':'3rd Time', 'type':'minsec', 'size':'small',\n 'visible':'no',\n },\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\n 'participation':{'label':'Participate', 'type':'select', \n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x12) > 0 ? 'yes' : 'no'},\n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\n 'options':{\n '0':'in person on a date to be scheduled',\n '1':'virtually and submit a video online',\n }},\n 'video_url1':{'label':'1st Video', 'type':'text', \n 'visible':'no',\n },\n 'music_orgfilename1':{'label':'1st Music', 'type':'file',\n 'visible':'no',\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(1);',\n },\n 'video_url2':{'label':'2nd Video', 'type':'text', \n 'visible':'no',\n },\n 'music_orgfilename2':{'label':'2nd Music', 'type':'file',\n 'visible':'no',\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(2);',\n },\n 'video_url3':{'label':'3rd Video', 'type':'text', \n 'visible':'no',\n },\n 'music_orgfilename3':{'label':'3rd Music', 'type':'file',\n 'visible':'no',\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(3);',\n },\n 'placement':{'label':'Placement', 'type':'text',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x08); },\n },\n }},\n '_tags':{'label':'Tags', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n 'fields':{\n 'tags':{'label':'', 'hidelabel':'yes', 'type':'tags', 'tags':[], 'hint':'Enter a new tag:'},\n }},\n/* 'music_buttons':{'label':'', \n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x02) == 0x02 ? 'yes' : 'no'},\n 'buttons':{\n 'add':{'label':'Upload Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename == '' ? 'yes' : 'no'},\n },\n 'upload':{'label':'Replace Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\n },\n 'download':{'label':'Download PDF', 'fn':'M.ciniki_musicfestivals_main.registration.downloadPDF();',\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\n },\n }}, */\n '_notes':{'label':'Registration Notes', 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_internal_notes':{'label':'Internal Admin Notes', 'fields':{\n 'internal_notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.registration.save();'},\n 'printcert':{'label':'Download Certificate PDF', \n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.registration.printCert();'},\n 'printcomments':{'label':'Download Comments PDF', \n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.registration.printComments();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.registration.remove();'},\n }},\n };\n this.registration.fieldValue = function(s, i, d) { \n// if( i == 'music_orgfilename' ) {\n// if( this.data[i] == '' ) {\n// return '';\n// } else {\n// return this.data[i] + ' ';\n// }\n// }\n return this.data[i]; \n }\n this.registration.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.registrationHistory', 'args':{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'field':i}};\n }\n this.registration.cellValue = function(s, i, j, d) {\n if( s == 'competitor1_details' || s == 'competitor2_details' || s == 'competitor3_details' || s == 'competitor4_details' ) {\n switch(j) {\n case 0 : return d.label;\n case 1 : \n if( d.label == 'Email' ) {\n return M.linkEmail(d.value);\n } else if( d.label == 'Address' ) {\n return d.value.replace(/\\n/g, '
    ');\n }\n return d.value;\n }\n }\n if( s == 'teacher_details' ) {\n switch(j) {\n case 0: return d.detail.label;\n case 1:\n if( d.detail.label == 'Email' ) {\n return M.linkEmail(d.detail.value);\n } else if( d.detail.label == 'Address' ) {\n return d.detail.value.replace(/\\n/g, '
    ');\n }\n return d.detail.value;\n }\n }\n if( s == 'invoice_details' ) {\n switch(j) {\n case 0: return d.label;\n case 1: return d.value.replace(/\\n/, '
    ');\n }\n }\n }\n this.registration.rowFn = function(s, i, d) {\n if( s == 'invoice_details' && this._source != 'invoice' && this._source != 'pos' ) {\n return 'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_musicfestivals_main.registration.open();\\',\\'mc\\',{\\'invoice_id\\':\\'' + this.data.invoice_id + '\\'});';\n }\n }\n this.registration.switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.refreshSection('_tabs');\n this.showHideSection('_display_name');\n this.showHideSection('competitor2_details');\n this.showHideSection('competitor3_details');\n this.showHideSection('competitor4_details');\n// this.showHideSection('competitor5_details');\n }\n this.registration.updateForm = function(s, i, cf) {\n var festival = this.data.festival;\n var cid = this.formValue('class_id');\n var participation = this.formValue('participation');\n for(var i in this.classes) {\n if( this.classes[i].id == cid ) {\n var c = this.classes[i];\n if( cf == null ) {\n if( (festival.flags&0x10) == 0x10 && participation == 2 && c.earlybird_plus_fee > 0 ) {\n this.setFieldValue('fee', c.earlybird_plus_fee);\n } else if( (festival.flags&0x10) == 0x10 && participation == 2 && c.plus_fee > 0 ) {\n this.setFieldValue('fee', c.plus_fee);\n } else if( (festival.flags&0x04) == 0x04 && participation == 1 ) {\n this.setFieldValue('fee', c.virtual_fee);\n } else if( festival.earlybird == 'yes' && c.earlybird_fee > 0 ) {\n this.setFieldValue('fee', c.earlybird_fee);\n } else {\n this.setFieldValue('fee', c.fee);\n }\n }\n\n this.sections._class.fields.title2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\n this.sections._class.fields.perf_time2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\n this.sections._class.fields.title3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\n this.sections._class.fields.perf_time3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\n this.sections._class.fields.video_url1.visible = (participation == 1 ? 'yes' : 'no');\n this.sections._class.fields.video_url2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\n this.sections._class.fields.video_url3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\n this.sections._class.fields.music_orgfilename1.visible = (participation == 1 ? 'yes' : 'no');\n this.sections._class.fields.music_orgfilename2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\n this.sections._class.fields.music_orgfilename3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\n\n this.sections._display_name.visible = (c.flags&0x70) > 0 ? 'yes' : 'hidden';\n this.sections.competitor2_details.visible = (c.flags&0x10) == 0x10 ? 'yes' : 'hidden';\n this.sections.competitor3_details.visible = (c.flags&0x20) == 0x20 ? 'yes' : 'hidden';\n this.sections.competitor4_details.visible = (c.flags&0x40) == 0x40 ? 'yes' : 'hidden';\n this.showHideSection('competitor2_details');\n this.showHideSection('competitor3_details');\n this.showHideSection('competitor4_details');\n this.showHideSection('_display_name');\n this.showHideFormField('_class', 'title2');\n this.showHideFormField('_class', 'perf_time2');\n this.showHideFormField('_class', 'title3');\n this.showHideFormField('_class', 'perf_time3');\n this.showHideFormField('_class', 'video_url1');\n this.showHideFormField('_class', 'video_url2');\n this.showHideFormField('_class', 'video_url3');\n this.showHideFormField('_class', 'music_orgfilename1');\n this.showHideFormField('_class', 'music_orgfilename2');\n this.showHideFormField('_class', 'music_orgfilename3');\n }\n }\n }\n this.registration.addCompetitor = function(cid,c) {\n this.save(\"M.ciniki_musicfestivals_main.competitor.open('M.ciniki_musicfestivals_main.registration.updateCompetitor(\" + c + \");',\" + cid + \",\" + this.festival_id + \",null,M.ciniki_musicfestivals_main.registration.data.billing_customer_id);\");\n }\n this.registration.updateCompetitor = function(c) {\n var p = M.ciniki_musicfestivals_main.competitor;\n if( this['competitor' + c + '_id'] != p.competitor_id ) {\n this['competitor' + c + '_id'] = p.competitor_id;\n this.save(\"M.ciniki_musicfestivals_main.registration.open();\");\n } else { \n this.open();\n }\n/*\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'competitor_id':this['competitor'+c+'_id']}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data['competitor'+c+'_details'] = rsp.details;\n if( p['competitor' + c + '_id'] == 0 ) {\n p.sections['competitor'+c+'_details'].addTxt = '';\n p.sections['competitor'+c+'_details'].changeTxt = 'Add';\n } else {\n p.sections['competitor'+c+'_details'].addTxt = 'Edit';\n p.sections['competitor'+c+'_details'].changeTxt = 'Change';\n }\n p.refreshSection('competitor'+c+'_details');\n p.show();\n }); */\n }\n this.registration.updateTeacher = function(cid) {\n if( cid != null ) { \n this.teacher_customer_id = cid;\n if( this.teacher_customer_id > 0 ) {\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.teacher_customer_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data.teacher_details = rsp.details;\n if( p.customer_id == 0 ) {\n p.sections.teacher_details.addTxt = '';\n p.sections.teacher_details.changeTxt = 'Add';\n } else {\n p.sections.teacher_details.addTxt = 'Edit';\n p.sections.teacher_details.changeTxt = 'Change';\n }\n p.refreshSection('teacher_details');\n p.show();\n });\n } else {\n this.data.teacher_details = [];\n this.sections.teacher_details.addTxt = '';\n this.sections.teacher_details.changeTxt = 'Add';\n this.refreshSection('teacher_details');\n this.show();\n }\n } else {\n this.show();\n }\n }\n this.registration.printCert = function() {\n M.api.openFile('ciniki.musicfestivals.registrationCertificatesPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\n }\n this.registration.printComments = function() {\n M.api.openFile('ciniki.musicfestivals.registrationCommentsPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\n }\n/* this.registration.uploadPDF = function() {\n if( this.upload == null ) {\n this.upload = M.aE('input', this.panelUID + '_music_orgfilename_upload', 'image_uploader');\n this.upload.setAttribute('name', 'music_orgfilename');\n this.upload.setAttribute('type', 'file');\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\n }\n this.upload.value = '';\n this.upload.click();\n }\n this.registration.uploadFile = function() {\n var f = this.upload;\n M.api.postJSONFile('ciniki.musicfestivals.registrationMusicAdd', \n {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id}, \n f.files[0], \n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data.music_orgfilename = rsp.registration.music_orgfilename;\n// p.refreshSection('music_buttons');\n p.setFieldValue('music_orgfilename', rsp.registration.music_orgfilename);\n });\n } */\n this.registration.downloadMusic = function(i) {\n M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'num':i});\n }\n// this.registration.downloadPDF = function() {\n// M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id});\n// }\n this.registration.open = function(cb, rid, tid, cid, fid, list, source) {\n if( rid != null ) { this.registration_id = rid; }\n if( tid != null ) { this.teacher_customer_id = tid; }\n if( fid != null ) { this.festival_id = fid; }\n if( cid != null ) { this.class_id = cid; }\n if( list != null ) { this.nplist = list; }\n if( source != null ) { this._source = source; }\n M.api.getJSONCb('ciniki.musicfestivals.registrationGet', {'tnid':M.curTenantID, 'registration_id':this.registration_id, \n 'teacher_customer_id':this.teacher_customer_id, 'festival_id':this.festival_id, 'class_id':this.class_id, \n }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data = rsp.registration;\n p.classes = rsp.classes;\n if( p.festival_id == 0 ) {\n p.festival_id = rsp.registration.festival_id;\n }\n// p.sections._tabs.selected = rsp.registration.rtype;\n p.sections._class.fields.class_id.options = rsp.classes;\n p.sections._class.fields.class_id.options.unshift({'id':0, 'name':''});\n p.teacher_customer_id = parseInt(rsp.registration.teacher_customer_id);\n if( p.teacher_customer_id == 0 ) {\n p.sections.teacher_details.addTxt = '';\n p.sections.teacher_details.changeTxt = 'Add';\n } else {\n p.sections.teacher_details.addTxt = 'Edit';\n p.sections.teacher_details.changeTxt = 'Change';\n }\n for(var i = 1; i<= 4; i++) {\n p['competitor' + i + '_id'] = parseInt(rsp.registration['competitor' + i + '_id']);\n if( p['competitor' + i + '_id'] == 0 ) {\n p.sections['competitor' + i + '_details'].addTxt = '';\n p.sections['competitor' + i + '_details'].changeTxt = 'Add';\n } else {\n p.sections['competitor' + i + '_details'].addTxt = 'Edit';\n p.sections['competitor' + i + '_details'].changeTxt = 'Change';\n }\n }\n if( (p.data.festival.flags&0x10) == 0x10 ) {\n p.sections._class.fields.participation.options = {\n '0':'Regular Adjudication',\n '2':'Adjudication Plus',\n };\n }\n else if( (p.data.festival.flags&0x02) == 0x02 ) {\n p.sections._class.fields.participation.options = {\n '0':'in person on a date to be scheduled',\n '1':'virtually and submit a video online',\n };\n if( p.data.festival['inperson-choice-msg'] != null && p.data.festival['inperson-choice-msg'] != '' ) {\n p.sections._class.fields.participation.options[0] = p.data.festival['inperson-choice-msg'];\n }\n if( p.data.festival['virtual-choice-msg'] != null && p.data.festival['virtual-choice-msg'] != '' ) {\n p.sections._class.fields.participation.options[1] = p.data.festival['virtual-choice-msg'];\n }\n }\n if( rsp.tags != null ) {\n p.sections._tags.fields.tags.tags = rsp.tags;\n }\n p.refresh();\n p.show(cb);\n p.updateForm(null,null,'no');\n });\n }\n this.registration.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.registration.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.formValue('class_id') == 0 ) {\n M.alert(\"You must select a class.\");\n return false;\n }\n// if( this.competitor1_id == 0 ) {\n// M.alert(\"You must have a competitor.\");\n// return false;\n// }\n if( this.registration_id > 0 ) {\n var c = this.serializeFormData('no');\n if( this.teacher_customer_id != this.data.teacher_customer_id ) {\n c.append('teacher_customer_id', this.teacher_customer_id);\n }\n if( this.competitor1_id != this.data.competitor1_id ) { c.append('competitor1_id', this.competitor1_id); }\n if( this.competitor2_id != this.data.competitor2_id ) { c.append('competitor2_id', this.competitor2_id); }\n if( this.competitor3_id != this.data.competitor3_id ) { c.append('competitor3_id', this.competitor3_id); }\n if( this.competitor4_id != this.data.competitor4_id ) { c.append('competitor4_id', this.competitor4_id); }\n// if( this.competitor5_id != this.data.competitor5_id ) { c.append('competitor5_id', this.competitor5_id); }\n if( c != '' ) {\n \n M.api.postJSONFormData('ciniki.musicfestivals.registrationUpdate', {'tnid':M.curTenantID, 'registration_id':this.registration_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n c += '&teacher_customer_id=' + this.teacher_customer_id;\n c += '&competitor1_id=' + this.competitor1_id;\n c += '&competitor2_id=' + this.competitor2_id;\n c += '&competitor3_id=' + this.competitor3_id;\n c += '&competitor4_id=' + this.competitor4_id;\n// c += '&competitor5_id=' + this.competitor5_id;\n M.api.postJSONCb('ciniki.musicfestivals.registrationAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.registration.registration_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.registration.remove = function() {\n var msg = 'Are you sure you want to remove this registration?';\n if( this.data.invoice_id > 0 && this.data.invoice_status >= 50 ) {\n msg = '**WARNING** Removing this registration will NOT remove the item from the Invoice. You will need make sure they have received a refund for the registration.';\n }\n M.confirm(msg,null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.registrationDelete', {'tnid':M.curTenantID, 'registration_id':M.ciniki_musicfestivals_main.registration.registration_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.registration.close();\n });\n });\n }\n this.registration.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.registration.save(\\'M.ciniki_musicfestivals_main.registration.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) + 1] + ');\\');';\n }\n return null;\n }\n this.registration.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.registration.save(\\'M.ciniki_musicfestivals_main.registration_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) - 1] + ');\\');';\n }\n return null;\n }\n this.registration.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.registration.save();');\n this.registration.addClose('Cancel');\n this.registration.addButton('next', 'Next');\n this.registration.addLeftButton('prev', 'Prev');\n\n\n //\n // The panel to add/edit a competitor\n //\n this.competitor = new M.panel('Competitor', 'ciniki_musicfestivals_main', 'competitor', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.competitor');\n this.competitor.data = null;\n this.competitor.festival_id = 0;\n this.competitor.competitor_id = 0;\n this.competitor.billing_customer_id = 0;\n this.competitor.nplist = [];\n this.competitor.sections = {\n '_ctype':{'label':'', 'type':'paneltabs', 'selected':10, 'aside':'yes', 'tabs':{\n '10':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\"10\");'},\n '50':{'label':'Group/Ensemble', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\"50\");'},\n }},\n 'general':{'label':'Competitor', 'aside':'yes', 'fields':{\n 'first':{'label':'First Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\n 'last':{'label':'Last Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\n 'name':{'label':'Name', 'required':'yes', 'type':'text', 'livesearch':'yes', 'visible':'hidden'},\n 'public_name':{'label':'Public Name', 'type':'text'},\n 'pronoun':{'label':'Pronoun', 'type':'text'},\n 'conductor':{'label':'Conductor', 'type':'text', 'visible':'no'},\n 'num_people':{'label':'# People', 'type':'number', 'size':'small', 'visible':'no'},\n 'parent':{'label':'Parent', 'type':'text', 'visible':'yes'},\n }},\n '_other':{'label':'', 'aside':'yes', 'fields':{\n 'age':{'label':'Age', 'type':'text'},\n 'study_level':{'label':'Study/Level', 'type':'text'},\n 'instrument':{'label':'Instrument', 'type':'text'},\n 'flags1':{'label':'Waiver', 'type':'flagtoggle', 'bit':0x01, 'field':'flags', 'toggles':{'':'Unsigned', 'signed':'Signed'}},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'contact', 'visible':'yes',\n 'tabs':{\n 'contact':{'label':'Contact Info', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\"contact\");'},\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\"emails\");'},\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\"registrations\");'},\n }},\n '_address':{'label':'Contact Info', \n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\n 'fields':{\n 'address':{'label':'Address', 'type':'text'},\n 'city':{'label':'City', 'type':'text', 'size':'small'},\n 'province':{'label':'Province', 'type':'text', 'size':'small'},\n 'postal':{'label':'Postal Code', 'type':'text', 'size':'small'},\n 'country':{'label':'Country', 'type':'text', 'size':'small'},\n 'phone_home':{'label':'Home Phone', 'type':'text', 'size':'small'},\n 'phone_cell':{'label':'Cell Phone', 'type':'text', 'size':'small'},\n 'email':{'label':'Email', 'type':'text'},\n }},\n '_notes':{'label':'Competitor Notes', 'aside':'no', \n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\n 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n 'messages':{'label':'Draft Emails', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\n 'headerValues':['Status', 'Subject'],\n 'noData':'No drafts or scheduled emails',\n 'addTxt':'Send Email',\n 'addFn':'M.ciniki_musicfestivals_main.competitor.save(\"M.ciniki_musicfestivals_main.competitor.addmessage();\");',\n },\n 'emails':{'label':'Send Emails', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\n 'headerValues':['Date Sent', 'Subject'],\n 'noData':'No emails sent',\n },\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden';},\n 'headerValues':['Category', 'Code', 'Class', 'Status'],\n 'noData':'No registrations',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.competitor.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.competitor.competitor_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.competitor.remove();'},\n }},\n };\n this.competitor.fieldValue = function(s, i, d) { return this.data[i]; }\n this.competitor.switchType = function(t) {\n this.sections._ctype.selected = t;\n if( t == 50 ) {\n this.sections.general.fields.first.visible = 'no';\n this.sections.general.fields.last.visible = 'no';\n this.sections.general.fields.name.visible = 'yes';\n this.sections.general.fields.public_name.visible = 'no';\n this.sections.general.fields.pronoun.visible = 'no';\n this.sections.general.fields.conductor.visible = 'yes';\n this.sections.general.fields.num_people.visible = 'yes';\n this.sections.general.fields.parent.label = 'Contact Person';\n } else {\n this.sections.general.fields.first.visible = 'yes';\n this.sections.general.fields.last.visible = 'yes';\n this.sections.general.fields.name.visible = 'no';\n this.sections.general.fields.public_name.visible = 'yes';\n this.sections.general.fields.pronoun.visible = M.modFlagSet('ciniki.musicfestivals', 0x80);\n this.sections.general.fields.conductor.visible = 'no';\n this.sections.general.fields.num_people.visible = 'no';\n this.sections.general.fields.parent.label = 'Parent';\n }\n this.showHideFormField('general', 'first');\n this.showHideFormField('general', 'last');\n this.showHideFormField('general', 'name');\n this.showHideFormField('general', 'public_name');\n this.showHideFormField('general', 'pronoun');\n this.showHideFormField('general', 'conductor');\n this.showHideFormField('general', 'num_people');\n this.showHideFormField('general', 'parent');\n this.refreshSections(['_ctype']);\n }\n this.competitor.switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.refreshSections(['_tabs', '_address','_notes','messages', 'emails', 'registrations']);\n }\n this.competitor.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.competitorHistory', 'args':{'tnid':M.curTenantID, 'competitor_id':this.competitor_id, 'field':i}};\n }\n this.competitor.liveSearchCb = function(s, i, value) {\n if( i == 'name' || i == 'first' || i == 'last' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.competitorSearch', \n {'tnid':M.curTenantID, 'start_needle':value, 'limit':25}, function(rsp) { \n M.ciniki_musicfestivals_main.competitor.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.competitor.panelUID + '_' + i), rsp.competitors); \n });\n }\n }\n this.competitor.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n this.competitor.liveSearchResultRowFn = function(s, f, i, j, d) { \n return 'M.ciniki_musicfestivals_main.competitor.open(null,\\'' + d.id + '\\');';\n }\n this.competitor.cellValue = function(s, i, j, d) {\n if( s == 'messages' ) {\n switch(j) {\n case 0: return d.status_text;\n case 1: return d.subject;\n }\n }\n if( s == 'emails' ) {\n switch(j) {\n case 0: return (d.status != 30 ? d.status_text : d.date_sent);\n case 1: return d.subject;\n }\n }\n if( s == 'registrations' ) {\n switch(j) {\n case 0: return d.section_name + ' - ' + d.category_name;\n case 1: return d.class_code;\n case 2: return d.class_name;\n case 3: return d.status_text;\n }\n }\n }\n this.competitor.rowFn = function(s, i, d) {\n if( s == 'messages' ) {\n return 'M.ciniki_musicfestivals_main.competitor.save(\"M.ciniki_musicfestivals_main.message.open(\\'M.ciniki_musicfestivals_main.competitor.open();\\',\\'' + d.id + '\\');\");';\n }\n if( s == 'emails' ) {\n return 'M.startApp(\\'ciniki.mail.main\\',null,\\'M.ciniki_musicfestivals_main.competitor.reopen();\\',\\'mc\\',{\\'message_id\\':\\'' + d.id + '\\'});';\n }\n return '';\n }\n this.competitor.addmessage = function() {\n M.ciniki_musicfestivals_main.message.addnew('M.ciniki_musicfestivals_main.competitor.open();',this.festival_id,'ciniki.musicfestivals.competitor',this.competitor_id);\n }\n this.competitor.reopen = function() {\n this.show();\n }\n this.competitor.open = function(cb, cid, fid, list, bci) {\n if( cid != null ) { this.competitor_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n if( bci != null ) { this.billing_customer_id = bci; }\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id, 'emails':'yes', 'registrations':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.competitor;\n p.data = rsp.competitor;\n if( p.competitor_id == 0 ) {\n p.sections._tabs.selected = 'contact';\n p.sections._tabs.visible = 'no';\n } else {\n p.sections._tabs.visible = 'yes';\n }\n p.sections._ctype.selected = rsp.competitor.ctype;\n p.refresh();\n p.show(cb);\n p.switchType(p.sections._ctype.selected);\n });\n }\n this.competitor.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.competitor.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.competitor_id > 0 ) {\n var c = this.serializeForm('no');\n if( this.sections._ctype.selected != this.data.ctype ) {\n c += '&ctype=' + this.sections._ctype.selected;\n }\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.competitorUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n c += '&ctype=' + this.sections._ctype.selected;\n M.api.postJSONCb('ciniki.musicfestivals.competitorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'billing_customer_id':this.billing_customer_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.competitor.competitor_name = rsp.name;\n M.ciniki_musicfestivals_main.competitor.competitor_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.competitor.remove = function() {\n M.confirm('Are you sure you want to remove competitor?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.competitorDelete', {'tnid':M.curTenantID, 'competitor_id':M.ciniki_musicfestivals_main.competitor.competitor_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.competitor.close();\n });\n });\n }\n this.competitor.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.competitor.save(\\'M.ciniki_musicfestivals_main.competitor.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) + 1] + ');\\');';\n }\n return null;\n }\n this.competitor.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.competitor.save(\\'M.ciniki_musicfestivals_main.competitor_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) - 1] + ');\\');';\n }\n return null;\n }\n this.competitor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.competitor.save();');\n this.competitor.addClose('Cancel');\n this.competitor.addButton('next', 'Next');\n this.competitor.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Section\n //\n this.schedulesection = new M.panel('Schedule Section', 'ciniki_musicfestivals_main', 'schedulesection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.schedulesection');\n this.schedulesection.data = null;\n this.schedulesection.festival_id = 0;\n this.schedulesection.schedulesection_id = 0;\n this.schedulesection.nplist = [];\n this.schedulesection.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'flags':{'label':'Options', 'type':'flags', 'flags':{\n '1':{'name':'Release Schedule'},\n '2':{'name':'Release Comments'},\n '3':{'name':'Release Certificates'},\n }},\n }},\n 'adjudicators':{'label':'Adjudicators', 'fields':{\n 'adjudicator1_id':{'label':'First', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\n 'adjudicator2_id':{'label':'Second', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\n 'adjudicator3_id':{'label':'Third', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.schedulesection.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.schedulesection.schedulesection_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.schedulesection.remove();'},\n }},\n };\n this.schedulesection.fieldValue = function(s, i, d) { return this.data[i]; }\n this.schedulesection.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleSectionHistory', 'args':{'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'field':i}};\n }\n this.schedulesection.downloadPDF = function(f,i,n) {\n M.api.openFile('ciniki.musicfestivals.schedulePDF',{'tnid':M.curTenantID, 'festival_id':f, 'schedulesection_id':i, 'names':n});\n }\n this.schedulesection.open = function(cb, sid, fid, list) {\n if( sid != null ) { this.schedulesection_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionGet', \n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.schedulesection;\n p.data = rsp.schedulesection;\n rsp.adjudicators.unshift({'id':'0', 'name':'None'});\n p.sections.adjudicators.fields.adjudicator1_id.options = rsp.adjudicators;\n p.sections.adjudicators.fields.adjudicator2_id.options = rsp.adjudicators;\n p.sections.adjudicators.fields.adjudicator3_id.options = rsp.adjudicators;\n p.refresh();\n p.show(cb);\n });\n }\n this.schedulesection.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.schedulesection.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.schedulesection_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionUpdate', \n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.schedulesection.schedulesection_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.schedulesection.remove = function() {\n M.confirm('Are you sure you want to remove this section?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionDelete', {'tnid':M.curTenantID, 'schedulesection_id':M.ciniki_musicfestivals_main.schedulesection.schedulesection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.schedulesection.close();\n });\n });\n }\n this.schedulesection.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\'M.ciniki_musicfestivals_main.schedulesection.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) + 1] + ');\\');';\n }\n return null;\n }\n this.schedulesection.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\'M.ciniki_musicfestivals_main.schedulesection_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) - 1] + ');\\');';\n }\n return null;\n }\n this.schedulesection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.schedulesection.save();');\n this.schedulesection.addClose('Cancel');\n this.schedulesection.addButton('next', 'Next');\n this.schedulesection.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Division\n //\n this.scheduledivision = new M.panel('Schedule Division', 'ciniki_musicfestivals_main', 'scheduledivision', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.scheduledivision');\n this.scheduledivision.data = null;\n this.scheduledivision.festival_id = 0;\n this.scheduledivision.ssection_id = 0;\n this.scheduledivision.scheduledivision_id = 0;\n this.scheduledivision.nplist = [];\n this.scheduledivision.sections = {\n 'general':{'label':'', 'fields':{\n 'ssection_id':{'label':'Section', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'division_date':{'label':'Date', 'required':'yes', 'type':'date'},\n 'address':{'label':'Address', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduledivision.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.scheduledivision.remove();'},\n }},\n };\n this.scheduledivision.fieldValue = function(s, i, d) { return this.data[i]; }\n this.scheduledivision.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleDivisionHistory', 'args':{'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'field':i}};\n }\n this.scheduledivision.open = function(cb, sid, ssid, fid, list) {\n if( sid != null ) { this.scheduledivision_id = sid; }\n if( ssid != null ) { this.ssection_id = ssid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionGet', \n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id, 'ssection_id':this.ssection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.scheduledivision;\n p.data = rsp.scheduledivision;\n p.sections.general.fields.ssection_id.options = rsp.schedulesections;\n p.refresh();\n p.show(cb);\n });\n }\n this.scheduledivision.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduledivision.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.scheduledivision_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionUpdate', \n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.scheduledivision.remove = function() {\n M.confirm('Are you sure you want to remove this division?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionDelete', {'tnid':M.curTenantID, 'scheduledivision_id':M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduledivision.close();\n });\n });\n }\n this.scheduledivision.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\'M.ciniki_musicfestivals_main.scheduledivision.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) + 1] + ');\\');';\n }\n return null;\n }\n this.scheduledivision.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\'M.ciniki_musicfestivals_main.scheduledivision_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) - 1] + ');\\');';\n }\n return null;\n }\n this.scheduledivision.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduledivision.save();');\n this.scheduledivision.addClose('Cancel');\n this.scheduledivision.addButton('next', 'Next');\n this.scheduledivision.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Time Slot\n //\n this.scheduletimeslot = new M.panel('Schedule Time Slot', 'ciniki_musicfestivals_main', 'scheduletimeslot', 'mc', 'xlarge', 'sectioned', 'ciniki.musicfestivals.main.scheduletimeslot');\n this.scheduletimeslot.data = null;\n this.scheduletimeslot.festival_id = 0;\n this.scheduletimeslot.scheduletimeslot_id = 0;\n this.scheduletimeslot.sdivision_id = 0;\n this.scheduletimeslot.nplist = [];\n this.scheduletimeslot.sections = {\n 'general':{'label':'', 'fields':{\n 'sdivision_id':{'label':'Division', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'slot_time':{'label':'Time', 'required':'yes', 'type':'text', 'size':'small'},\n 'class1_id':{'label':'Class 1', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class2_id':{'label':'Class 2', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class3_id':{'label':'Class 3', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class4_id':{'label':'Class 4', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class5_id':{'label':'Class 5', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'name':{'label':'Name', 'type':'text'},\n }},\n '_options':{'label':'',\n 'visible':function() {\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\n var c1 = p.formValue('class1_id');\n var c2 = p.formValue('class2_id');\n var c3 = p.formValue('class3_id');\n var c4 = p.formValue('class4_id');\n var c5 = p.formValue('class5_id');\n// if( c1 == null && p.data.class1_id > 0 && p.data.class2_id == 0 && p.data.class3_id == 0 && p.data.class4_id == 0 && p.data.class5_id == 0 ) { return 'yes'; }\n if( c1 == null && p.data.class1_id > 0 ) { \n return 'yes'; \n }\n// return (c1 != null && c1 > 0 && (c2 == null || c2 == 0) && (c3 == null || c3 == 0) ? 'yes' : 'hidden');\n return (c1 != null && c1 > 0 ? 'yes' : 'hidden');\n },\n 'fields':{\n 'flags1':{'label':'Split Class', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags', \n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n }},\n '_registrations1':{'label':'Class 1 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations1':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[], \n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations2':{'label':'Class 2 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations2':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations3':{'label':'Class 3 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations3':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations4':{'label':'Class 4 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations4':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations5':{'label':'Class 5 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations5':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_sorting1':{'label':'Class 1 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting2':{'label':'Class 2 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting3':{'label':'Class 3 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting4':{'label':'Class 4 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting5':{'label':'Class 5 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'Description', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.remove();'},\n }},\n };\n this.scheduletimeslot.fieldValue = function(s, i, d) { \n if( i == 'registrations1' || i == 'registrations2' || i == 'registrations3' || i == 'registrations4' || i == 'registrations5' ) {\n return this.data.registrations;\n }\n return this.data[i]; \n }\n this.scheduletimeslot.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'field':i}};\n }\n this.scheduletimeslot.updateRegistrations = function() {\n var c1_id = this.formValue('class1_id');\n var c2_id = this.formValue('class2_id');\n var c3_id = this.formValue('class3_id');\n var c4_id = this.formValue('class4_id');\n var c5_id = this.formValue('class5_id');\n this.sections._registrations1.visible = 'hidden';\n this.sections._registrations2.visible = 'hidden';\n this.sections._registrations3.visible = 'hidden';\n this.sections._registrations4.visible = 'hidden';\n this.sections._registrations5.visible = 'hidden';\n if( this.formValue('flags1') == 'on' && this.formValue('class1_id') > 0 && this.data.classes != null ) {\n for(var i in this.data.classes) {\n if( this.data.classes[i].id == c1_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations1.visible = 'yes';\n this.sections._registrations1.fields.registrations1.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c2_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations2.visible = 'yes';\n this.sections._registrations2.fields.registrations2.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c3_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations3.visible = 'yes';\n this.sections._registrations3.fields.registrations3.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c4_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations4.visible = 'yes';\n this.sections._registrations4.fields.registrations4.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c5_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations5.visible = 'yes';\n this.sections._registrations5.fields.registrations5.list = this.data.classes[i].registrations;\n }\n }\n }\n }\n this.showHideSection('_registrations1');\n this.showHideSection('_registrations2');\n this.showHideSection('_registrations3');\n this.showHideSection('_registrations4');\n this.showHideSection('_registrations5');\n if( this.sections._registrations1.visible == 'yes' ) {\n this.refreshSection('_registrations1');\n }\n if( this.sections._registrations2.visible == 'yes' ) {\n this.refreshSection('_registrations2');\n }\n if( this.sections._registrations3.visible == 'yes' ) {\n this.refreshSection('_registrations3');\n }\n if( this.sections._registrations4.visible == 'yes' ) {\n this.refreshSection('_registrations4');\n }\n if( this.sections._registrations5.visible == 'yes' ) {\n this.refreshSection('_registrations5');\n }\n this.updateSorting();\n }\n this.scheduletimeslot.updateSorting = function() {\n var c1_id = this.formValue('class1_id');\n var c2_id = this.formValue('class2_id');\n var c3_id = this.formValue('class3_id');\n var c4_id = this.formValue('class4_id');\n var c5_id = this.formValue('class5_id');\n // Update the class registrations\n this.sections._sorting1.fields = {};\n this.sections._sorting2.fields = {};\n this.sections._sorting3.fields = {};\n this.sections._sorting4.fields = {};\n this.sections._sorting5.fields = {};\n this.sections._sorting1.visible = 'hidden';\n this.sections._sorting2.visible = 'hidden';\n this.sections._sorting3.visible = 'hidden';\n this.sections._sorting4.visible = 'hidden';\n this.sections._sorting5.visible = 'hidden';\n for(var i in this.data.classes) {\n if( c1_id > 0 && this.data.classes[i].id == c1_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations1');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting1.visible = 'yes';\n this.sections._sorting1.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c2_id > 0 && this.data.classes[i].id == c2_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations2');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting2.visible = 'yes';\n this.sections._sorting2.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c3_id > 0 && this.data.classes[i].id == c3_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations3');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting3.visible = 'yes';\n this.sections._sorting3.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c4_id > 0 && this.data.classes[i].id == c4_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations4');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting4.visible = 'yes';\n this.sections._sorting4.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c5_id > 0 && this.data.classes[i].id == c5_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations5');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting5.visible = 'yes';\n this.sections._sorting5.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n }\n this.showHideSection('_options');\n this.refreshSection('_sorting1');\n this.refreshSection('_sorting2');\n this.refreshSection('_sorting3');\n this.refreshSection('_sorting4');\n this.refreshSection('_sorting5');\n this.showHideSection('_sorting1');\n this.showHideSection('_sorting2');\n this.showHideSection('_sorting3');\n this.showHideSection('_sorting4');\n this.showHideSection('_sorting5'); \n return true;\n }\n this.scheduletimeslot.open = function(cb, sid, did, fid, list) {\n if( sid != null ) { this.scheduletimeslot_id = sid; }\n if( did != null ) { this.sdivision_id = did; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotGet', \n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id, 'sdivision_id':this.sdivision_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\n p.data = rsp.scheduletimeslot;\n p.data.classes = rsp.classes;\n p.sections.general.fields.sdivision_id.options = rsp.scheduledivisions;\n rsp.classes.unshift({'id':0, 'name':'No Class'});\n p.sections.general.fields.class1_id.options = rsp.classes;\n p.sections.general.fields.class2_id.options = rsp.classes;\n p.sections.general.fields.class3_id.options = rsp.classes;\n p.sections.general.fields.class4_id.options = rsp.classes;\n p.sections.general.fields.class5_id.options = rsp.classes;\n/* p.sections._registrations1.visible = 'hidden';\n if( rsp.scheduletimeslot.class1_id > 0 && rsp.classes != null ) {\n for(var i in rsp.classes) {\n if( rsp.classes[i].id == rsp.scheduletimeslot.class1_id ) {\n if( rsp.classes[i].registrations != null ) {\n if( (rsp.scheduletimeslot.flags&0x01) > 0 ) {\n p.sections._registrations1.visible = 'yes';\n }\n p.sections._registrations1.fields.registrations1.list = rsp.classes[i].registrations;\n }\n }\n }\n } */\n p.refresh();\n p.show(cb);\n p.updateRegistrations();\n });\n }\n this.scheduletimeslot.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduletimeslot.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.scheduletimeslot_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotUpdate', \n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.scheduletimeslot.remove = function() {\n M.confirm('Are you sure you want to remove timeslot?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotDelete', {'tnid':M.curTenantID, 'scheduletimeslot_id':M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduletimeslot.close();\n });\n });\n }\n this.scheduletimeslot.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\'M.ciniki_musicfestivals_main.scheduletimeslot.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) + 1] + ');\\');';\n }\n return null;\n }\n this.scheduletimeslot.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\'M.ciniki_musicfestivals_main.scheduletimeslot_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) - 1] + ');\\');';\n }\n return null;\n }\n this.scheduletimeslot.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduletimeslot.save();');\n this.scheduletimeslot.addClose('Cancel');\n this.scheduletimeslot.addButton('next', 'Next');\n this.scheduletimeslot.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Time Slot Comments\n //\n this.timeslotcomments = new M.panel('Comments', 'ciniki_musicfestivals_main', 'timeslotcomments', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotcomments');\n this.timeslotcomments.data = null;\n this.timeslotcomments.festival_id = 0;\n this.timeslotcomments.timeslot_id = 0;\n this.timeslotcomments.nplist = [];\n this.timeslotcomments.sections = {};\n this.timeslotcomments.fieldValue = function(s, i, d) { return this.data[i]; }\n this.timeslotcomments.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.timeslot_id, 'field':i}};\n }\n this.timeslotcomments.cellValue = function(s, i, j, d) {\n switch(j) {\n case 0 : return d.label;\n case 1 : return d.value;\n }\n }\n this.timeslotcomments.open = function(cb, tid, fid, list) {\n if( tid != null ) { this.timeslot_id = tid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsGet', \n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.timeslotcomments;\n p.data = rsp.timeslot;\n p.sections = {};\n for(var i in rsp.timeslot.registrations) {\n var registration = rsp.timeslot.registrations[i];\n p.sections['details_' + i] = {'label':'Registration', 'type':'simplegrid', 'num_cols':2, 'aside':'yes'};\n p.data['details_' + i] = [\n {'label':'Class', 'value':registration.reg_class_name},\n {'label':'Participant', 'value':registration.name},\n {'label':'Title', 'value':registration.title1},\n {'label':'Video', 'value':M.hyperlink(registration.video_url1)},\n {'label':'Music', 'value':registration.music_orgfilename1},\n ];\n if( (registration.reg_flags&0x1000) == 0x1000 ) {\n p.data['details_' + i].push({'label':'2nd Title', 'value':registration.title2});\n p.data['details_' + i].push({'label':'2nd Video', 'value':M.hyperlink(registration.video_url2)});\n p.data['details_' + i].push({'label':'2nd Music', 'value':registration.music_orgfilename2});\n }\n if( (registration.reg_flags&0x4000) == 0x4000 ) {\n p.data['details_' + i].push({'label':'3rd Title', 'value':registration.title3});\n p.data['details_' + i].push({'label':'3rd Video', 'value':M.hyperlink(registration.video_url3)});\n p.data['details_' + i].push({'label':'3rd Music', 'value':registration.music_orgfilename3});\n }\n // \n // Setup the comment, grade & score fields, could be for multiple adjudicators\n //\n for(var j in rsp.adjudicators) {\n p.sections['comments_' + i] = {'label':rsp.adjudicators[j].display_name, 'fields':{}};\n p.sections['comments_' + i].fields['comments_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n 'label':'Comments', \n 'type':'textarea', \n 'size':'large',\n };\n// p.sections['comments_' + i].fields['grade_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n// 'label':'Grade', \n// 'type':'text', \n// 'size':'small',\n// };\n p.sections['comments_' + i].fields['score_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n 'label':'Mark', \n 'type':'text', \n 'size':'small',\n };\n/* if( M.modFlagOn('ciniki.musicfestivals', 0x08) ) {\n p.sections['comments_' + i].fields['placement_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n 'label':'Placement', \n 'type':'text', \n 'size':'large',\n };\n }*/\n }\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.timeslotcomments.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotcomments.close();'; }\n if( !this.checkForm() ) { return false; }\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsUpdate', \n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n }\n this.timeslotcomments.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotcomments.save();');\n this.timeslotcomments.addClose('Cancel');\n\n\n //\n // Adjudicators\n //\n this.adjudicator = new M.panel('Adjudicator', 'ciniki_musicfestivals_main', 'adjudicator', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.adjudicator');\n this.adjudicator.data = null;\n this.adjudicator.festival_id = 0;\n this.adjudicator.adjudicator_id = 0;\n this.adjudicator.customer_id = 0;\n this.adjudicator.nplist = [];\n this.adjudicator.sections = {\n '_image_id':{'label':'Adjudicator Photo', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue(fid,0);\n return true;\n },\n },\n }}, \n 'customer_details':{'label':'Adjudicator', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\',\\'customer_id\\':M.ciniki_musicfestivals_main.adjudicator.data.customer_id});',\n 'changeTxt':'Change customer',\n 'changeFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\',\\'customer_id\\':0});',\n },\n '_discipline':{'label':'Discipline', 'fields':{\n 'discipline':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n '_description':{'label':'Full Bio', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'xlarge'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.adjudicator.save();'},\n 'delete':{'label':'Remove Adjudicator', \n 'visible':function() {return M.ciniki_musicfestivals_main.adjudicator.adjudicator_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.adjudicator.remove();'},\n }},\n };\n this.adjudicator.fieldValue = function(s, i, d) { return this.data[i]; }\n this.adjudicator.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.adjudicatorHistory', 'args':{'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id, 'field':i}};\n }\n this.adjudicator.cellValue = function(s, i, j, d) {\n if( s == 'customer_details' && j == 0 ) { return d.detail.label; }\n if( s == 'customer_details' && j == 1 ) {\n if( d.detail.label == 'Email' ) {\n return M.linkEmail(d.detail.value);\n } else if( d.detail.label == 'Address' ) {\n return d.detail.value.replace(/\\n/g, '
    ');\n }\n return d.detail.value;\n }\n };\n this.adjudicator.open = function(cb, aid, cid, fid, list) {\n if( cb != null ) { this.cb = cb; }\n if( aid != null ) { this.adjudicator_id = aid; }\n if( cid != null ) { this.customer_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n if( aid != null && aid == 0 && cid != null && cid == 0 ) {\n M.startApp('ciniki.customers.edit',null,this.cb,'mc',{'next':'M.ciniki_musicfestivals_main.adjudicator.openCustomer', 'customer_id':0});\n return true;\n }\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorGet', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'adjudicator_id':this.adjudicator_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.adjudicator;\n p.data = rsp.adjudicator;\n if( rsp.adjudicator.id > 0 ) {\n p.festival_id = rsp.adjudicator.festival_id;\n }\n p.customer_id = rsp.adjudicator.customer_id;\n if( p.customer_id == 0 ) {\n p.sections.customer_details.addTxt = '';\n p.sections.customer_details.changeTxt = 'Add';\n } else {\n p.sections.customer_details.addTxt = 'Edit';\n p.sections.customer_details.changeTxt = 'Change';\n }\n p.refresh();\n p.show();\n });\n }\n this.adjudicator.openCustomer = function(cid) {\n this.open(null,null,cid);\n }\n this.adjudicator.updateCustomer = function(cid) {\n if( cid != null ) { this.customer_id = cid; }\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.customer_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.adjudicator;\n p.data.customer_details = rsp.details;\n if( p.customer_id == 0 ) {\n p.sections.customer_details.addTxt = '';\n p.sections.customer_details.changeTxt = 'Add';\n } else {\n p.sections.customer_details.addTxt = 'Edit';\n p.sections.customer_details.changeTxt = 'Change';\n }\n p.refreshSection('customer_details');\n p.show();\n });\n }\n this.adjudicator.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.adjudicator.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.adjudicator_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorUpdate', {'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorAdd', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.adjudicator.adjudicator_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.adjudicator.remove = function() {\n M.confirm('Are you sure you want to remove adjudicator?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorDelete', {'tnid':M.curTenantID, 'adjudicator_id':M.ciniki_musicfestivals_main.adjudicator.adjudicator_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.adjudicator.close();\n });\n });\n }\n this.adjudicator.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\'M.ciniki_musicfestivals_main.adjudicator.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) + 1] + ');\\');';\n }\n return null;\n }\n this.adjudicator.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\'M.ciniki_musicfestivals_main.adjudicator_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) - 1] + ');\\');';\n }\n return null;\n }\n this.adjudicator.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.adjudicator.save();');\n this.adjudicator.addClose('Cancel');\n this.adjudicator.addButton('next', 'Next');\n this.adjudicator.addLeftButton('prev', 'Prev');\n\n //\n // The panel to display the add form\n //\n this.addfile = new M.panel('Add File', 'ciniki_musicfestivals_main', 'addfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.addfile');\n this.addfile.default_data = {'type':'20'};\n this.addfile.festival_id = 0;\n this.addfile.data = {}; \n this.addfile.sections = {\n '_file':{'label':'File', 'fields':{\n 'uploadfile':{'label':'', 'type':'file', 'hidelabel':'yes'},\n }},\n 'info':{'label':'Information', 'type':'simpleform', 'fields':{\n 'name':{'label':'Title', 'type':'text'},\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\n }},\n '_save':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.addfile.save();'},\n }},\n };\n this.addfile.fieldValue = function(s, i, d) { \n if( this.data[i] != null ) { return this.data[i]; } \n return ''; \n };\n this.addfile.open = function(cb, eid) {\n this.reset();\n this.data = {'name':''};\n this.file_id = 0;\n this.festival_id = eid;\n this.refresh();\n this.show(cb);\n };\n this.addfile.save = function() {\n var c = this.serializeFormData('yes');\n if( c != '' ) {\n M.api.postJSONFormData('ciniki.musicfestivals.fileAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.addfile.file_id = rsp.id;\n M.ciniki_musicfestivals_main.addfile.close();\n });\n } else {\n this.close();\n }\n };\n this.addfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.addfile.save();');\n this.addfile.addClose('Cancel');\n\n //\n // The panel to display the edit form\n //\n this.editfile = new M.panel('File', 'ciniki_musicfestivals_main', 'editfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.info.editfile');\n this.editfile.file_id = 0;\n this.editfile.data = null;\n this.editfile.sections = {\n 'info':{'label':'Details', 'type':'simpleform', 'fields':{\n 'name':{'label':'Title', 'type':'text'},\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\n }},\n '_save':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editfile.save();'},\n 'download':{'label':'Download', 'fn':'M.ciniki_musicfestivals_main.editfile.download(M.ciniki_musicfestivals_main.editfile.file_id);'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_musicfestivals_main.editfile.remove();'},\n }},\n };\n this.editfile.fieldValue = function(s, i, d) { \n return this.data[i]; \n }\n this.editfile.sectionData = function(s) {\n return this.data[s];\n };\n this.editfile.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.fileHistory', 'args':{'tnid':M.curTenantID, 'file_id':this.file_id, 'field':i}};\n };\n this.editfile.open = function(cb, fid) {\n if( fid != null ) { this.file_id = fid; }\n M.api.getJSONCb('ciniki.musicfestivals.fileGet', {'tnid':M.curTenantID, 'file_id':this.file_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.editfile;\n p.data = rsp.file;\n p.refresh();\n p.show(cb);\n });\n };\n this.editfile.save = function() {\n var c = this.serializeFormData('no');\n if( c != '' ) {\n M.api.postJSONFormData('ciniki.musicfestivals.fileUpdate', {'tnid':M.curTenantID, 'file_id':this.file_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.editfile.close();\n });\n }\n };\n this.editfile.remove = function() {\n M.confirm('Are you sure you want to delete \\'' + this.data.name + '\\'? All information about it will be removed and unrecoverable.',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.fileDelete', {'tnid':M.curTenantID, 'file_id':M.ciniki_musicfestivals_main.editfile.file_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.editfile.close();\n });\n });\n };\n this.editfile.download = function(fid) {\n M.api.openFile('ciniki.musicfestivals.fileDownload', {'tnid':M.curTenantID, 'file_id':fid});\n };\n this.editfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editfile.save();');\n this.editfile.addClose('Cancel');\n\n //\n // The panel to email a teacher their list of registrations\n //\n this.emailregistrations = new M.panel('Email Registrations', 'ciniki_musicfestivals_main', 'emailregistrations', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.emailregistrations');\n this.emailregistrations.data = {};\n this.emailregistrations.sections = {\n '_subject':{'label':'', 'type':'simpleform', 'aside':'yes', 'fields':{\n 'subject':{'label':'Subject', 'type':'text'},\n }},\n '_message':{'label':'Message', 'type':'simpleform', 'aside':'yes', 'fields':{\n 'message':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n '_save':{'label':'', 'aside':'yes', 'buttons':{\n 'send':{'label':'Send', 'fn':'M.ciniki_musicfestivals_main.emailregistrations.send();'},\n }},\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\n 'headerValues':['Class', 'Registrant', 'Title', 'Time', 'Virtual'],\n 'cellClasses':['', '', '', '', ''],\n },\n };\n this.emailregistrations.fieldValue = function(s, i, d) { return ''; }\n this.emailregistrations.cellValue = function(s, i, j, d) {\n if( s == 'registrations' ) {\n switch (j) {\n case 0: return d.class_code;\n case 1: return d.display_name;\n case 2: return d.title1;\n case 3: return d.perf_time1;\n case 4: return (d.participation == 1 ? 'Virtual' : 'In Person');\n }\n }\n }\n this.emailregistrations.open = function(cb, reg) {\n this.sections.registrations.label = M.ciniki_musicfestivals_main.festival.sections.registrations.label;\n this.data.registrations = M.ciniki_musicfestivals_main.festival.data.registrations;\n this.refresh();\n this.show(cb);\n };\n this.emailregistrations.send = function() {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.registrationsEmailSend', \n {'tnid':M.curTenantID, 'teacher_id':M.ciniki_musicfestivals_main.festival.teacher_customer_id, 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id}, c, \n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.emailregistrations.close();\n });\n }\n this.emailregistrations.addButton('send', 'Send', 'M.ciniki_musicfestivals_main.emailregistrations.send();');\n this.emailregistrations.addClose('Cancel');\n\n //\n // The panel to edit Sponsor\n //\n this.sponsor = new M.panel('Sponsor', 'ciniki_musicfestivals_main', 'sponsor', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.sponsor');\n this.sponsor.data = null;\n this.sponsor.festival_id = 0;\n this.sponsor.sponsor_id = 0;\n this.sponsor.nplist = [];\n this.sponsor.sections = {\n '_image_id':{'label':'Logo', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.sponsor.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.sponsor.setFieldValue(fid, 0);\n return true;\n },\n },\n }},\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'url':{'label':'Website', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text', 'size':'small'},\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Level 1'}, '2':{'name':'Level 2'}}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.sponsor.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.sponsor.sponsor_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.sponsor.remove();'},\n }},\n };\n this.sponsor.fieldValue = function(s, i, d) { return this.data[i]; }\n this.sponsor.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.sponsorHistory', 'args':{'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'field':i}};\n }\n this.sponsor.open = function(cb, sid, fid) {\n if( sid != null ) { this.sponsor_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n M.api.getJSONCb('ciniki.musicfestivals.sponsorGet', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.sponsor;\n p.data = rsp.sponsor;\n p.refresh();\n p.show(cb);\n });\n }\n this.sponsor.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.sponsor.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.sponsor_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.sponsorUpdate', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.sponsorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.sponsor.sponsor_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.sponsor.remove = function() {\n M.confirm('Are you sure you want to remove sponsor?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.sponsorDelete', {'tnid':M.curTenantID, 'sponsor_id':M.ciniki_musisfestivals_main.sponsor.sponsor_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.sponsor.close();\n });\n });\n }\n this.sponsor.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) + 1] + ');\\');';\n }\n return null;\n }\n this.sponsor.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) - 1] + ');\\');';\n }\n return null;\n }\n this.sponsor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.sponsor.save();');\n this.sponsor.addClose('Cancel');\n this.sponsor.addButton('next', 'Next');\n this.sponsor.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Time Slot Image\n //\n this.timeslotimage = new M.panel('Schedule Time Slot Image', 'ciniki_musicfestivals_main', 'timeslotimage', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotimage');\n this.timeslotimage.data = null;\n this.timeslotimage.timeslot_image_id = 0;\n this.timeslotimage.nplist = [];\n this.timeslotimage.sections = {\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.timeslotimage.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n },\n }},\n 'general':{'label':'', 'fields':{\n 'title':{'label':'Title', 'type':'text'},\n 'flags':{'label':'Options', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text'},\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.timeslotimage.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.timeslotimage.remove();'},\n }},\n };\n this.timeslotimage.fieldValue = function(s, i, d) { return this.data[i]; }\n this.timeslotimage.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.timeslotImageHistory', 'args':{'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id, 'field':i}};\n }\n this.timeslotimage.open = function(cb, tid, list) {\n if( tid != null ) { this.timeslot_image_id = tid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageGet', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.timeslotimage;\n p.data = rsp.image;\n p.refresh();\n p.show(cb);\n });\n }\n this.timeslotimage.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotimage.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.timeslot_image_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageUpdate', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.timeslotimage.remove = function() {\n M.confirm('Are you sure you want to remove timeslotimage?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageDelete', {'tnid':M.curTenantID, 'timeslot_image_id':M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.timeslotimage.close();\n });\n });\n }\n this.timeslotimage.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) + 1] + ');\\');';\n }\n return null;\n }\n this.timeslotimage.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) - 1] + ');\\');';\n }\n return null;\n }\n this.timeslotimage.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotimage.save();');\n this.timeslotimage.addClose('Cancel');\n this.timeslotimage.addButton('next', 'Next');\n this.timeslotimage.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit a List\n //\n this.list = new M.panel('List', 'ciniki_musicfestivals_main', 'list', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.list');\n this.list.data = null;\n this.list.list_id = 0;\n this.list.festival_id = 0;\n this.list.nplist = [];\n this.list.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'category':{'label':'Category', 'required':'yes', 'type':'text'},\n }},\n '_intro':{'label':'Introduction', 'fields':{\n 'intro':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.list.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.list.list_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.list.remove();'},\n }},\n };\n this.list.fieldValue = function(s, i, d) { return this.data[i]; }\n this.list.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.listHistory', 'args':{'tnid':M.curTenantID, 'list_id':this.list_id, 'field':i}};\n }\n this.list.open = function(cb, lid, fid, list) {\n if( lid != null ) { this.list_id = lid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.listGet', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.list;\n p.data = rsp.list;\n p.refresh();\n p.show(cb);\n });\n }\n this.list.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.list.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.list_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.listUpdate', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.listAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.list.list_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.list.remove = function() {\n M.confirm('Are you sure you want to remove list?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.listDelete', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.list.close();\n });\n });\n }\n this.list.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.list.save(\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) + 1] + ');\\');';\n }\n return null;\n }\n this.list.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.list.save(\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) - 1] + ');\\');';\n }\n return null;\n }\n this.list.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.list.save();');\n this.list.addClose('Cancel');\n this.list.addButton('next', 'Next');\n this.list.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit List Section\n //\n this.listsection = new M.panel('List Section', 'ciniki_musicfestivals_main', 'listsection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listsection');\n this.listsection.data = null;\n this.listsection.list_id = 0;\n this.listsection.listsection_id = 0;\n this.listsection.nplist = [];\n this.listsection.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listsection.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.listsection.listsection_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.listsection.remove();'},\n }},\n };\n this.listsection.fieldValue = function(s, i, d) { return this.data[i]; }\n this.listsection.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.listSectionHistory', 'args':{'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'field':i}};\n }\n this.listsection.open = function(cb, lid, list_id, list) {\n if( lid != null ) { this.listsection_id = lid; }\n if( list_id != null ) { this.list_id = list_id; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.listSectionGet', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'list_id':this.list_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.listsection;\n p.data = rsp.listsection;\n p.refresh();\n p.show(cb);\n });\n }\n this.listsection.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listsection.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.listsection_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.listSectionUpdate', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.listSectionAdd', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listsection.listsection_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.listsection.remove = function() {\n M.confirm('Are you sure you want to remove listsection?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.listSectionDelete', {'tnid':M.curTenantID, 'listsection_id':M.ciniki_musicfestivals_main.listsection.listsection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listsection.close();\n });\n });\n }\n this.listsection.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.listsection.save(\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) + 1] + ');\\');';\n }\n return null;\n }\n this.listsection.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.listsection.save(\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) - 1] + ');\\');';\n }\n return null;\n }\n this.listsection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listsection.save();');\n this.listsection.addClose('Cancel');\n this.listsection.addButton('next', 'Next');\n this.listsection.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit List Entry\n //\n this.listentry = new M.panel('List Entry', 'ciniki_musicfestivals_main', 'listentry', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listentry');\n this.listentry.data = null;\n this.listentry.listsection_id = 0;\n this.listentry.listentry_id = 0;\n this.listentry.nplist = [];\n this.listentry.sections = {\n 'general':{'label':'List Entry', 'fields':{\n 'sequence':{'label':'Number', 'type':'text'},\n 'award':{'label':'Award', 'type':'text'},\n 'amount':{'label':'Amount', 'type':'text'},\n 'donor':{'label':'Donor', 'type':'text'},\n 'winner':{'label':'Winner', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listentry.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.listentry.listentry_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.listentry.remove();'},\n }},\n };\n this.listentry.fieldValue = function(s, i, d) { return this.data[i]; }\n this.listentry.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.listEntryHistory', 'args':{'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'field':i}};\n }\n this.listentry.open = function(cb, lid, sid, list) {\n if( lid != null ) { this.listentry_id = lid; }\n if( sid != null ) { this.listsection_id = sid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.listEntryGet', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'section_id':this.listsection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.listentry;\n p.data = rsp.listentry;\n p.refresh();\n p.show(cb);\n });\n }\n this.listentry.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listentry.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.listentry_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.listEntryUpdate', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.listEntryAdd', {'tnid':M.curTenantID, 'section_id':this.listsection_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listentry.listentry_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.listentry.remove = function() {\n M.confirm('Are you sure you want to remove listentry?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.listEntryDelete', {'tnid':M.curTenantID, 'listentry_id':M.ciniki_musicfestivals_main.listentry.listentry_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listentry.close();\n });\n });\n }\n this.listentry.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.listentry.save(\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) + 1] + ');\\');';\n }\n return null;\n }\n this.listentry.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.listentry.save(\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) - 1] + ');\\');';\n }\n return null;\n }\n this.listentry.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listentry.save();');\n this.listentry.addClose('Cancel');\n this.listentry.addButton('next', 'Next');\n this.listentry.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Certificate\n //\n this.certificate = new M.panel('Certificate', 'ciniki_musicfestivals_main', 'certificate', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.certificate');\n this.certificate.data = null;\n this.certificate.festival_id = 0;\n this.certificate.certificate_id = 0;\n this.certificate.nplist = [];\n this.certificate.sections = {\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.certificate.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n },\n }},\n 'general':{'label':'Certificate', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'orientation':{'label':'Orientation', 'type':'toggle', 'toggles':{'L':'Landscape', 'P':'Portrait'}},\n// FIXME: Add section support and min score support\n// 'section_id':{'label':'Section', 'type':'select', 'options':{}, 'complex_options':{'name':'name', 'value':'id'}},\n// 'min_score':{'label':'Minimum Score', 'type':'text', 'size':'small'},\n }},\n 'fields':{'label':'Auto Filled Fields', 'type':'simplegrid', 'num_cols':1,\n 'addTxt':'Add Field',\n 'addFn':'M.ciniki_musicfestivals_main.certificate.save(\"M.ciniki_musicfestivals_main.certfield.open(\\'M.ciniki_musicfestivals_main.certificate.open();\\',0,M.ciniki_musicfestivals_main.certificate.certificate_id);\");',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certificate.save();'},\n 'download':{'label':'Generate Test', \n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTestOutlines();',\n },\n 'download2':{'label':'Generate Test No Outlines', \n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTest();',\n },\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certificate.remove();',\n },\n }},\n };\n this.certificate.fieldValue = function(s, i, d) { return this.data[i]; }\n this.certificate.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.certificateHistory', 'args':{'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'field':i}};\n }\n this.certificate.cellValue = function(s, i, j, d) {\n if( s == 'fields' ) {\n switch(j) {\n case 0: return d.name;\n }\n }\n }\n this.certificate.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.certificate.save(\"M.ciniki_musicfestivals_main.certfield.open(\\'M.ciniki_musicfestivals_main.certificate.open();\\',' + d.id + ',M.ciniki_musicfestivals_main.certificate.certificate_id);\");';\n }\n this.certificate.open = function(cb, cid, fid, list) {\n if( cid != null ) { this.certificate_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.certificate;\n p.data = rsp.certificate;\n// p.sections.general.fields.section_id.options = rsp.sections;\n p.refresh();\n p.show(cb);\n });\n }\n this.certificate.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certificate.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.certificate_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.certificateUpdate', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.certificateAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certificate.certificate_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.certificate.generateTestOutlines = function() {\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf', 'outlines':'yes'});\n }\n this.certificate.generateTest = function() {\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf'});\n }\n this.certificate.remove = function() {\n M.confirm('Are you sure you want to remove certificate?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.certificateDelete', {'tnid':M.curTenantID, 'certificate_id':M.ciniki_musicfestivals_main.certificate.certificate_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certificate.close();\n });\n });\n }\n this.certificate.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.certificate.save(\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) + 1] + ');\\');';\n }\n return null;\n }\n this.certificate.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.certificate.save(\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) - 1] + ');\\');';\n }\n return null;\n }\n this.certificate.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certificate.save();');\n this.certificate.addClose('Cancel');\n this.certificate.addButton('next', 'Next');\n this.certificate.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Certificate Field\n //\n this.certfield = new M.panel('Certificate Field', 'ciniki_musicfestivals_main', 'certfield', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.certfield');\n this.certfield.data = null;\n this.certfield.field_id = 0;\n this.certfield.certificate_id = 0;\n this.certfield.nplist = [];\n this.certfield.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'field':{'label':'Field', 'type':'select', 'options':{\n 'class':'Class',\n 'timeslotdate':'Timeslot Date',\n 'participant':'Participant',\n 'title':'Title',\n 'adjudicator':'Adjudicator',\n 'placement':'Placement',\n 'text':'Text',\n }},\n 'xpos':{'label':'X Position', 'required':'yes', 'type':'text'},\n 'ypos':{'label':'Y Position', 'required':'yes', 'type':'text'},\n 'width':{'label':'Width', 'required':'yes', 'type':'text'},\n 'height':{'label':'Height', 'required':'yes', 'type':'text'},\n 'font':{'label':'Font', 'type':'select', 'options':{\n 'times':'Times',\n 'helvetica':'Helvetica',\n 'vidaloka':'Vidaloka',\n 'scriptina':'Scriptina',\n 'allison':'Allison',\n 'greatvibes':'Great Vibes',\n }},\n 'size':{'label':'Size', 'type':'text'},\n 'style':{'label':'Style', 'type':'select', 'options':{\n '':'Normal',\n 'B':'Bold',\n 'I':'Italic',\n 'BI':'Bold Italic',\n }},\n 'align':{'label':'Align', 'type':'select', 'options':{\n 'L':'Left',\n 'C':'Center',\n 'R':'Right',\n }},\n 'valign':{'label':'Vertial', 'type':'select', 'options':{\n 'T':'Top',\n 'M':'Middle',\n 'B':'Bottom',\n }},\n// 'color':{'label':'Color', 'type':'text'},\n// 'bgcolor':{'label':'Background Color', 'type':'text'},\n 'text':{'label':'Text', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certfield.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.certfield.field_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certfield.remove();'},\n }},\n };\n this.certfield.fieldValue = function(s, i, d) { return this.data[i]; }\n this.certfield.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.certfieldHistory', 'args':{'tnid':M.curTenantID, 'field_id':this.field_id, 'field':i}};\n }\n this.certfield.open = function(cb, fid, cid, list) {\n if( fid != null ) { this.field_id = fid; }\n if( cid != null ) { this.certificate_id = cid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.certfieldGet', {'tnid':M.curTenantID, 'field_id':this.field_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.certfield;\n p.data = rsp.field;\n p.refresh();\n p.show(cb);\n });\n }\n this.certfield.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certfield.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.field_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.certfieldUpdate', {'tnid':M.curTenantID, 'field_id':this.field_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.certfieldAdd', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certfield.field_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.certfield.remove = function() {\n M.confirm('Are you sure you want to remove certfield?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.certfieldDelete', {'tnid':M.curTenantID, 'field_id':M.ciniki_musicfestivals_main.certfield.field_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certfield.close();\n });\n });\n }\n this.certfield.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.certfield.save(\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) + 1] + ');\\');';\n }\n return null;\n }\n this.certfield.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.certfield.save(\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) - 1] + ');\\');';\n }\n return null;\n }\n this.certfield.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certfield.save();');\n this.certfield.addClose('Cancel');\n this.certfield.addButton('next', 'Next');\n this.certfield.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Trophy\n //\n this.trophy = new M.panel('Trophy', 'ciniki_musicfestivals_main', 'trophy', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.trophy');\n this.trophy.data = null;\n this.trophy.trophy_id = 0;\n this.trophy.nplist = [];\n this.trophy.sections = {\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.trophy.setFieldValue('primary_image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n },\n }},\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'category':{'label':'Category', 'type':'text'},\n 'donated_by':{'label':'Donated By', 'type':'text'},\n 'first_presented':{'label':'First Presented', 'type':'text'},\n 'criteria':{'label':'Criteria', 'type':'text'},\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n 'winners':{'label':'Winners', 'type':'simplegrid', 'num_cols':2, \n 'addTxt':'Add Winner',\n 'addFn':'M.ciniki_musicfestivals_main.trophy.save(\"M.ciniki_musicfestivals_main.trophywinner.open(\\'M.ciniki_musicfestivals_main.trophy.open();\\',0,M.ciniki_musicfestivals_main.trophy.trophy_id);\");',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophy.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.trophy.trophy_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.trophy.remove();'},\n }},\n };\n this.trophy.fieldValue = function(s, i, d) { return this.data[i]; }\n this.trophy.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.trophyHistory', 'args':{'tnid':M.curTenantID, 'trophy_id':this.trophy_id, 'field':i}};\n }\n this.trophy.cellValue = function(s, i, j, d) {\n if( s == 'winners' ) {\n switch(j) {\n case 0: return d.year;\n case 1: return d.name;\n }\n }\n }\n this.trophy.rowFn = function(s, i, d) {\n if( s == 'winners' ) {\n return 'M.ciniki_musicfestivals_main.trophy.save(\"M.ciniki_musicfestivals_main.trophywinner.open(\\'M.ciniki_musicfestivals_main.trophy.open();\\',' + d.id + ',M.ciniki_musicfestivals_main.trophy.trophy_id);\");';\n }\n }\n this.trophy.open = function(cb, tid, list) {\n if( tid != null ) { this.trophy_id = tid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.trophyGet', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.trophy;\n p.data = rsp.trophy;\n p.refresh();\n p.show(cb);\n });\n }\n this.trophy.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophy.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.trophy_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.trophyUpdate', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.trophyAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophy.trophy_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.trophy.remove = function() {\n M.confirm('Are you sure you want to remove trophy?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyDelete', {'tnid':M.curTenantID, 'trophy_id':M.ciniki_musicfestivals_main.trophy.trophy_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophy.close();\n });\n });\n }\n this.trophy.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.trophy.save(\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) + 1] + ');\\');';\n }\n return null;\n }\n this.trophy.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.trophy.save(\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) - 1] + ');\\');';\n }\n return null;\n }\n this.trophy.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophy.save();');\n this.trophy.addClose('Cancel');\n this.trophy.addButton('next', 'Next');\n this.trophy.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Trophy Winner\n //\n this.trophywinner = new M.panel('Trophy Winner', 'ciniki_musicfestivals_main', 'trophywinner', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophywinner');\n this.trophywinner.data = null;\n this.trophywinner.trophy_id = 0;\n this.trophywinner.winner_id = 0;\n this.trophywinner.nplist = [];\n this.trophywinner.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'year':{'label':'Year', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophywinner.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.trophywinner.winner_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.trophywinner.remove();'},\n }},\n };\n this.trophywinner.fieldValue = function(s, i, d) { return this.data[i]; }\n this.trophywinner.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.trophyWinnerHistory', 'args':{'tnid':M.curTenantID, 'winner_id':this.winner_id, 'field':i}};\n }\n this.trophywinner.open = function(cb, wid, tid, list) {\n if( wid != null ) { this.winner_id = wid; }\n if( tid != null ) { this.trophy_id = tid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerGet', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.trophywinner;\n p.data = rsp.winner;\n p.refresh();\n p.show(cb);\n });\n }\n this.trophywinner.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophywinner.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.winner_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerUpdate', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerAdd', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophywinner.winner_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.trophywinner.remove = function() {\n M.confirm('Are you sure you want to remove trophywinner?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerDelete', {'tnid':M.curTenantID, 'winner_id':M.ciniki_musicfestivals_main.trophywinner.winner_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophywinner.close();\n });\n });\n }\n this.trophywinner.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) + 1] + ');\\');';\n }\n return null;\n }\n this.trophywinner.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) - 1] + ');\\');';\n }\n return null;\n }\n this.trophywinner.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophywinner.save();');\n this.trophywinner.addClose('Cancel');\n this.trophywinner.addButton('next', 'Next');\n this.trophywinner.addLeftButton('prev', 'Prev');\n\n \n //\n // This panel will allow mass updates to City and Province\n //\n this.editcityprov = new M.panel('Update', 'ciniki_musicfestivals_main', 'editcityprov', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.editcityprov');\n this.editcityprov.data = null;\n this.editcityprov.city = '';\n this.editcityprov.province = '';\n this.editcityprov.sections = {\n 'general':{'label':'', 'fields':{\n 'city':{'label':'City', 'type':'text', 'visible':'yes'},\n 'province':{'label':'Province', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editcityprov.save();'},\n }},\n };\n this.editcityprov.open = function(cb, c, p) {\n if( c != null ) {\n this.city = unescape(c);\n this.sections.general.fields.city.visible = 'yes';\n } else {\n this.sections.general.fields.city.visible = 'no';\n }\n this.province = unescape(p);\n this.data = {\n 'city':unescape(c),\n 'province':unescape(p),\n };\n this.refresh();\n this.show(cb);\n }\n this.editcityprov.save = function() {\n var args = {\n 'tnid':M.curTenantID, \n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\n };\n if( this.sections.general.fields.city.visible == 'yes' ) {\n args['old_city'] = M.eU(this.city);\n args['new_city'] = M.eU(this.formValue('city'));\n }\n args['old_province'] = M.eU(this.province);\n args['new_province'] = M.eU(this.formValue('province'));\n M.api.getJSONCb('ciniki.musicfestivals.competitorCityProvUpdate', args, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.editcityprov.close();\n });\n }\n this.editcityprov.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editcityprov.save();');\n this.editcityprov.addClose('Cancel');\n\n //\n // Create and send a email message to a selection of competitors/teachers with\n // filtering for section, timeslot sections, etc\n //\n this.message = new M.panel('Message',\n 'ciniki_musicfestivals_main', 'message',\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.message');\n this.message.data = {};\n this.message.festival_id = 0;\n this.message.message_id = 0;\n this.message.upload = null;\n this.message.nplist = [];\n this.message.sections = {\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label mediumlabel', ''],\n // Status\n // # competitors\n // # teachers\n // 'dt_sent':{'label':'Year', 'type':'text'},\n },\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label', ''],\n 'addTxt':'Add/Remove Recipient(s)',\n //'addFn':'M.ciniki_musicfestivals_main.messagerefs.open(\\'M.ciniki_musicfestivals_main.message.open();\\',M.ciniki_musicfestivals_main.message.message_id);',\n 'addFn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.openrefs();\");',\n },\n '_subject':{'label':'Subject', 'fields':{\n 'subject':{'label':'Subject', 'hidelabel':'yes', 'type':'text'},\n }},\n '_content':{'label':'Message', 'fields':{\n 'content':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n/* '_file':{'label':'Attach Files', \n 'fields':{\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\n }}, */\n 'files':{'label':'Attachments', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['', 'alignright fabuttons'],\n 'noData':'No attachments',\n 'addTxt':'Attach File',\n 'addTopFn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.fileAdd();\");',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.save();',\n },\n 'back':{'label':'Back', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status > 10 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.close();',\n },\n 'sendtest':{'label':'Send Test Message', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.sendTest();\");',\n },\n 'schedule':{'label':'Schedule', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.schedule();',\n },\n 'unschedule':{'label':'Unschedule', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 30 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.unschedule();',\n },\n 'sendnow':{'label':'Send Now', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.sendNow();\");'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.message_id > 0 && M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.remove();',\n },\n }},\n };\n// this.message.fieldValue = function(s, i, d) {\n// return this.data[i];\n// }\n this.message.cellValue = function(s, i, j, d) {\n if( s == 'details' ) {\n switch(j) {\n case 0: return d.label;\n case 1: return d.value;\n }\n }\n if( s == 'objects' ) {\n switch(j) {\n case 0: return d.type;\n case 1: return d.label;\n }\n }\n if( s == 'files' ) {\n switch(j) {\n case 0: return d.filename;\n }\n if( this.data.status == 10 && j == 1 ) {\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\'' + escape(d.filename) + '\\');')\n + M.faBtn('&#xf014;', 'Delete', 'M.ciniki_musicfestivals_main.message.fileDelete(\\'' + escape(d.filename) + '\\');');\n }\n if( this.data.status > 10 && j == 1 ) {\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\'' + escape(d.filename) + '\\');');\n }\n return '';\n }\n }\n// this.message.cellFn = function(s, i, j, d) {\n// if( s == 'objects' ) {\n// }\n// return '';\n// }\n // Add a new message with object and object_id\n this.message.addnew = function(cb, fid, o, oid) {\n var args = {'tnid':M.curTenantID, 'festival_id':fid};\n args['subject'] = '';\n args['object'] = o;\n args['object_id'] = oid;\n M.api.getJSONCb('ciniki.musicfestivals.messageAdd', args, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.open(cb, rsp.id);\n });\n }\n this.message.openrefs = function() {\n M.ciniki_musicfestivals_main.messagerefs.open('M.ciniki_musicfestivals_main.message.open();', M.ciniki_musicfestivals_main.message.message_id);\n }\n this.message.fileAdd = function() {\n if( this.upload == null ) {\n this.upload = M.aE('input', this.panelUID + '_file_upload', 'image_uploader');\n this.upload.setAttribute('name', 'filename');\n this.upload.setAttribute('type', 'file');\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\n }\n this.upload.value = '';\n this.upload.click();\n }\n this.message.uploadFile = function() {\n var f = this.upload;\n M.api.postJSONFile('ciniki.musicfestivals.messageFileAdd', {'tnid':M.curTenantID, 'message_id':this.message_id}, f.files[0],\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.message;\n p.data.files = rsp.files;\n p.refreshSection('files');\n });\n }\n this.message.fileDelete = function(f) {\n M.api.getJSONCb('ciniki.musicfestivals.messageFileDelete', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.message;\n p.data.files = rsp.files;\n p.refreshSection('files');\n });\n }\n this.message.fileDownload = function(f) {\n M.api.openFile('ciniki.musicfestivals.messageFileDownload', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f});\n }\n this.message.open = function(cb, mid, fid, list) {\n if( mid != null ) { this.message_id = mid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, 'message_id':this.message_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.message;\n p.data = rsp.message;\n if( rsp.message.status == 10 ) {\n p.sections.objects.addTxt = \"Add/Remove Recipients\";\n } else {\n p.sections.objects.addTxt = \"View Recipients\";\n }\n if( rsp.message.status == 10 ) {\n p.addClose('Cancel');\n p.sections._subject.fields.subject.editable = 'yes';\n p.sections._content.fields.content.editable = 'yes';\n } else {\n p.addClose('Back');\n p.sections._subject.fields.subject.editable = 'no';\n p.sections._content.fields.content.editable = 'no';\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.message.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.message.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.message_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.messageAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'status':10}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.message_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.message.sendTest = function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':this.message_id, 'send':'test'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.alert(rsp.msg);\n M.ciniki_musicfestivals_main.message.open();\n });\n }\n this.message.sendNow = function() {\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \n + ' will receive this email.

    ';\n M.confirm(msg + ' Is this email correct and ready to send?', null, function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id, 'send':'all'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.alert(rsp.msg);\n M.ciniki_musicfestivals_main.message.open();\n });\n });\n }\n this.message.schedule = function() {\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \n + ' will receive this email.

    ';\n M.confirm(msg + 'Are you sure the email is correct and ready to be sent?', null, function() {\n M.ciniki_musicfestivals_main.messageschedule.open();\n });\n }\n this.message.schedulenow = function() {\n var sd = M.ciniki_musicfestivals_main.messageschedule.formValue('dt_scheduled');\n if( sd != this.data.dt_scheduled ) {\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'dt_scheduled':sd, 'status':30}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.close();\n });\n } else {\n this.close();\n }\n }\n this.message.unschedule = function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'status':10}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.open();\n });\n }\n this.message.remove = function() {\n M.confirm('Are you sure you want to remove message?', null, function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageDelete', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.close();\n });\n });\n }\n this.message.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.message.save(\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) + 1] + ');\\');';\n }\n return null;\n }\n this.message.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.message.save(\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) - 1] + ');\\');';\n }\n return null;\n }\n this.message.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.message.save();');\n this.message.addButton('next', 'Next');\n this.message.addLeftButton('prev', 'Prev');\n this.message.helpSections = function() {\n return {\n 'help':{'label':'Substitutions', 'type':'htmlcontent',\n 'html':'The following substitutions are available in the Message:

    '\n + '{_first_} = Teacher/Individual first name, Group/Ensemble full name
    '\n + '{_name_} = Teacher/Individual/Group full name
    '\n },\n };\n }\n\n //\n // This panel will let the user select a date and time to send the scheduled message\n //\n this.messageschedule = new M.panel('Schedule Message',\n 'ciniki_musicfestivals_main', 'messageschedule',\n 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.messageschedule');\n this.messageschedule.data = {};\n this.messageschedule.sections = {\n 'general':{'label':'Schedule Date and Time', 'fields':{\n 'dt_scheduled':{'label':'', 'hidelabel':'yes', 'type':'datetime'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'send':{'label':'Schedule', \n 'fn':'M.ciniki_musicfestivals_main.message.schedulenow();',\n },\n 'delete':{'label':'Cancel',\n 'fn':'M.ciniki_musicfestivals_main.message.open();',\n },\n }},\n };\n this.messageschedule.open = function() {\n if( M.ciniki_musicfestivals_main.message.data.dt_scheduled != '0000-00-00 00:00:00' ) {\n this.data = {\n 'dt_scheduled':M.ciniki_musicfestivals_main.message.data.dt_scheduled_text,\n };\n } else {\n this.data.dt_scheduled = '';\n }\n this.refresh();\n this.show();\n }\n\n\n //\n // This panel shows the available objects that can be used to send a message to.\n //\n this.messagerefs = new M.panel('Message Recipients',\n 'ciniki_musicfestivals_main', 'messagerefs',\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.messagerefs');\n this.messagerefs.data = {};\n this.messagerefs.festival_id = 0;\n this.messagerefs.message_id = 0;\n this.messagerefs.section_id = 0;\n this.messagerefs.category_id = 0;\n this.messagerefs.schedule_id = 0;\n this.messagerefs.division_id = 0;\n this.messagerefs.nplist = [];\n this.messagerefs.sections = {\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label mediumlabel', ''],\n // Status\n // # competitors\n // # teachers\n // 'dt_sent':{'label':'Year', 'type':'text'},\n },\n 'excluded':{'label':'', 'aside':'yes', 'fields':{\n 'flags1':{'label':'Include', 'type':'flagspiece', 'default':'off', 'mask':0x03,\n 'field':'flags', 'toggle':'yes', 'join':'yes',\n\n 'flags':{'0':{'name':'Everybody'},'2':{'name':'Only Competitors'}, '1':{'name':'Only Teachers'}},\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\n },\n }},\n/* '_excluded':{'label':'', 'aside':'yes', 'fields':{\n 'flags1':{'label':'Exclude Competitors', 'type':'flagtoggle', 'default':'off', 'bit':0x01,\n 'field':'flags',\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\n },\n 'flags2':{'label':'Exclude Teachers', 'type':'flagtoggle', 'default':'off', 'bit':0x02,\n 'field':'flags',\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\n },\n }}, */\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':3, 'aside':'yes',\n 'cellClasses':['label mediumlabel', '', 'alignright'],\n 'noData':'No Recipients',\n// 'addTxt':'Add Recipient(s)',\n// 'addFn':'M.ciniki_musicfestivals_main.message.addobjects();',\n },\n '_extract':{'label':'', 'aside':'yes', 'buttons':{\n 'extract':{'label':'Extract Recipients', 'fn':'M.ciniki_musicfestivals_main.messagerefs.extractRecipients();'},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'sections', 'tabs':{\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"sections\");'},\n 'categories':{'label':'Categories', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.section_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"categories\");',\n },\n 'classes':{'label':'Classes', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.category_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"classes\");',\n },\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"schedule\");'},\n 'divisions':{'label':'Divisions', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.schedule_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"divisions\");',\n },\n 'timeslots':{'label':'Timeslots', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.division_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"timeslots\");',\n },\n 'tags':{'label':'Registration Tags', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"tags\");',\n },\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"teachers\");'},\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"competitors\");'},\n }},\n/* '_file':{'label':'Attach Files', \n 'fields':{\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\n }}, */\n 'sections':{'label':'Syllabus', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'categories' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'classes' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'schedule':{'label':'Schedule', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'schedule' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'divisions' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'timeslots':{'label':'Timeslots', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'timeslots' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'tags':{'label':'Registration Tags', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'tags' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n// 'competitor_search':{'label':'Search Competitors', 'type':'simplegrid', 'num_cols':2,\n// 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\n// 'cellClasses':['', 'alignright fabuttons'],\n// },\n 'competitors':{'label':'Competitors', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\n 'headerValues':['Name', 'Status'],\n 'headerClasses':['', 'alignright'],\n 'cellClasses':['', 'alignright fabuttons'],\n 'sortable':'yes',\n 'sortTypes':['text', 'alttext'],\n },\n 'teachers':{'label':'Teachers', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'teachers' ? 'yes' : 'no';},\n 'headerValues':['Name', 'Status'],\n 'headerClasses':['', 'alignright'],\n 'cellClasses':['', 'alignright fabuttons'],\n 'sortable':'yes',\n 'sortTypes':['text', 'alttext'],\n },\n '_buttons':{'label':'', 'buttons':{\n 'done':{'label':'Done', 'fn':'M.ciniki_musicfestivals_main.messagerefs.close();'},\n }},\n };\n this.messagerefs.cellSortValue = function(s, i, j, d) {\n if( d.added != null && d.added == 'yes' ) {\n return 1;\n } else if( d.included != null && d.included == 'yes' ) {\n return 2;\n } else {\n return 3;\n }\n }\n this.messagerefs.cellValue = function(s, i, j, d) {\n if( s == 'details' ) {\n switch(j) {\n case 0: return d.label;\n case 1: return d.value;\n }\n }\n if( s == 'objects' ) {\n switch(j) {\n case 0: return d.type;\n case 1: return d.label;\n case 2: return '&#xf014;&nbsp;';\n }\n }\n if( s == 'sections' || s == 'categories' || s == 'classes' || s == 'schedule' || s == 'divisions' || s == 'timeslots' || s == 'tags' || s == 'competitors' ) {\n if( j == 0 ) {\n return d.name;\n }\n if( j == 1 ) {\n if( d.added != null && d.added == 'yes' ) {\n if( this.data.message.status == 10 ) {\n return '';\n } else {\n return 'Added';\n }\n } else if( d.included != null && d.included == 'yes' ) {\n return 'Included';\n } else if( d.object != null && d.partial == null ) {\n if( this.data.message.status == 10 ) {\n return '';\n } else {\n return '';\n }\n } else if( d.object != null && d.partial == null ) {\n return '';\n }\n }\n }\n if( s == 'teachers' ) {\n if( j == 0 ) {\n return d.name;\n }\n if( j == 1 ) {\n var html = '';\n if( d.included != null ) {\n return 'Included';\n }\n else if( d.students != null ) {\n return '';\n }\n else if( d.added != null ) {\n return '';\n }\n else { \n return ''\n + ' ';\n }\n }\n \n }\n }\n this.messagerefs.cellFn = function(s, i, j, d) {\n if( s == 'objects' && j == 2 ) { \n return 'M.ciniki_musicfestivals_main.messagerefs.removeObject(\\'' + d.object + '\\',\\'' + d.object_id + '\\');';\n }\n }\n this.messagerefs.rowClass = function(s, i, d) {\n if( (d.partial != null && d.partial == 'yes') ) {\n return 'statusorange';\n }\n else if( (d.added != null && d.added == 'yes')\n || (d.included != null && d.included == 'yes') \n || (d.students != null && d.students == 'yes') \n ) {\n return 'statusgreen';\n }\n }\n this.messagerefs.rowFn = function(s, i, d) {\n if( s == 'sections' || s == 'categories' || s == 'schedule' || s == 'divisions' ) {\n if( d.added == null && d.included == null ) {\n return 'M.ciniki_musicfestivals_main.messagerefs.switchSubTab(\\'' + s + '\\',' + d.id + ');';\n }\n }\n return '';\n }\n this.messagerefs.extractRecipients = function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'extractrecipients',\n }, this.openFinish);\n }\n this.messagerefs.switchTab = function(t) {\n this.sections._tabs.selected = t;\n if( t == 'sections' || t == 'schedule' || t == 'teachers' || t == 'competitors' || t == 'tags' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n this.registration_tag = '';\n }\n else if( t == 'categories' ) {\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n this.registration_tag = '';\n }\n else if( t == 'divisions' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.division_id = 0;\n this.registration_tag = '';\n }\n this.open();\n }\n this.messagerefs.switchSubTab = function(s, id) {\n/* if( s == 'sections' || s == 'schedule' || s == 'teachers' || s == 'competitors' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n }\n else if( s == 'categories' ) {\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n }\n else if( s == 'divisions' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.division_id = 0;\n } */\n if( s == 'sections' ) {\n this.section_id = id;\n this.switchTab('categories');\n }\n if( s == 'categories' ) {\n this.category_id = id;\n this.switchTab('classes');\n }\n if( s == 'schedule' ) {\n this.schedule_id = id;\n this.switchTab('divisions');\n }\n if( s == 'divisions' ) {\n this.division_id = id;\n this.switchTab('timeslots');\n }\n }\n this.messagerefs.updateFlags = function() {\n var f = this.data.message.flags;\n if( (this.formValue('flags1')&0x01) == 0x01 ) {\n f |= 0x01;\n } else {\n f &= 0xFFFE;\n }\n if( (this.formValue('flags1')&0x02) == 0x02 ) {\n f |= 0x02;\n } else {\n f &= 0xFFFD;\n }\n if( f != this.data.message.flags ) {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'updateflags',\n 'flags':f,\n }, this.openFinish);\n } \n }\n this.messagerefs.addObject = function(o, oid) {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'addref',\n 'object':o,\n 'object_id':oid,\n }, this.openFinish);\n }\n this.messagerefs.removeObject = function(o, oid) {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'removeref',\n 'object':o,\n 'object_id':oid,\n }, this.openFinish);\n }\n this.messagerefs.open = function(cb, mid) {\n if( cb != null ) { this.cb = cb; }\n if( mid != null ) { this.message_id = mid; }\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n }, this.openFinish);\n }\n this.messagerefs.openFinish = function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.messagerefs;\n p.data = rsp;\n p.data.flags = rsp.message.flags;\n p.data.details = rsp.message.details;\n p.data.objects = rsp.message.objects;\n p.refresh();\n p.show();\n }\n this.messagerefs.goback = function() {\n if( this.sections._tabs.selected == 'categories' ) {\n this.switchTab(\"sections\");\n } else if( this.sections._tabs.selected == 'classes' ) {\n this.switchTab(\"categories\");\n } else if( this.sections._tabs.selected == 'divisions' ) {\n this.switchTab(\"schedule\");\n } else if( this.sections._tabs.selected == 'timeslots' ) {\n this.switchTab(\"divisions\");\n } else {\n this.close();\n }\n }\n this.messagerefs.addLeftButton('back', 'Back', 'M.ciniki_musicfestivals_main.messagerefs.goback();');\n\n //\n // Start the app\n // cb - The callback to run when the user leaves the main panel in the app.\n // ap - The application prefix.\n // ag - The app arguments.\n //\n this.start = function(cb, ap, ag) {\n args = {};\n if( ag != null ) {\n args = eval(ag);\n }\n \n //\n // Create the app container\n //\n var ac = M.createContainer(ap, 'ciniki_musicfestivals_main', 'yes');\n if( ac == null ) {\n M.alert('App Error');\n return false;\n }\n\n //\n // Initialize for tenant\n //\n if( this.curTenantID == null || this.curTenantID != M.curTenantID ) {\n this.tenantInit();\n this.curTenantID = M.curTenantID;\n }\n\n if( args.item_object != null && args.item_object == 'ciniki.musicfestivals.registration' && args.item_object_id != null ) {\n this.registration.open(cb, args.item_object_id, 0, 0, 0, null, args.source);\n } else if( args.registration_id != null && args.registration_id != '' ) {\n this.registration.open(cb, args.registration_id, 0, 0, 0, null, '');\n } else if( args.festival_id != null && args.festival_id != '' ) {\n this.festival.list_id = 0;\n this.festival.open(cb, args.festival_id, null);\n } else {\n this.festival.list_id = 0;\n this.menu.sections._tabs.selected = 'festivals';\n this.menu.open(cb);\n }\n }\n\n this.tenantInit = function() {\n this.festival.typestatus = '';\n this.festival.sections.ipv_tabs.selected = 'all';\n this.classes.sections._tabs.selected = 'fees';\n this.festival.section_id = 0;\n this.festival.schedulesection_id = 0;\n this.festival.scheduledivision_id = 0;\n this.festival.list_id = 0;\n this.festival.listsection_id = 0;\n this.festival.nplists = {};\n this.festival.nplist = [];\n this.festival.messages_status = 10;\n this.festival.city_prov = 'All';\n this.festival.province = 'All';\n this.festival.registration_tag = '';\n }\n}","function toMenu()\n {\n /**\n * Opens a fan of a desk in the pause menu\n */\n function openFan()\n {\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\n desk.toggleFan(4, 35, 10, true);\n for (var counter = 0; counter < desk.cards.length; counter++)\n {\n if (state.isWin)\n {\n desk.cards[counter].turn(true);\n desk.cards[counter].dataset.turned = true;\n }\n else if (desk.cards[counter].dataset.turned == true)\n {\n desk.cards[counter].turn(true);\n }\n }\n state.isWin = false;\n }\n\n /**\n * Shows menu elements\n */\n function showMenu()\n {\n if (state.screen == \"GAME\")\n {\n cards[0].removeEventListener(\"move\", showMenuId);\n DOM.pause.deskContainer.style.opacity = 1;\n DOM.cardsContainer.classList.add(CSS.hidden);\n }\n\n if (state.isWin)\n {\n DOM.pause.deskContainer.style.opacity = 0;\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \"Победа со счётом: \" : \"Потрачено: \") + state.score;\n DOM.pause.options.continue.disabled = true;\n state.score = 0;\n }\n else\n {\n DOM.pause.headline.innerHTML = \"MEMORY GAME\";\n }\n\n DOM.container.classList.remove(CSS.container.game);\n DOM.container.classList.add(CSS.container.pause);\n state.screen = \"MENU\";\n\n toggleHideElements(\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\n animation.duration.hide,\n false,\n openFan.bind(this)\n );\n }\n\n /**\n * Hides a game field\n */\n function hideGameField(follower)\n {\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\n }\n\n /**\n * Moves cards from the field to the desk\n */\n function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }\n\n state.cardsTurnable = false;\n if (state.screen == \"GAME\")\n {\n var showMenuId;\n hideGameField();\n takeCards();\n }\n else\n {\n hideGameField(showMenu.bind(this));\n }\n }","function HappyMealMenu() {\n \n const dispatch = useDispatch();\n const menu = useSelector(state => state.happyMeal.menu, shallowEqual);\n \n // use 'react-redux' to load in happy meals from backend. \n useEffect(() => {\n dispatch(fetchMenuFromAPI('LOAD_HAPPY_MEAL_MENU', 'happy-meal'));\n }, [dispatch]);\n \n return (\n // render happy meal items as a list of buttons. \n
    \n {menu && menu.map(food => \n )\n }\n
    \n )\n}","function spellsMenu() {\n $scope.menuTitle = createText(\"Spells\", [20, 10]);\n createText(\"Not yet implemented\", [50, 80], {});\n }","function showMenu() {\n rectMode(CENTER);\n fill(colorList[2]);\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[5]);\n text(\"How to Play\", buttonX, buttonY);\n\n fill(colorList[3]);\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[4]);\n text(\"Dancing Block\", buttonX, secondButtonYpos);\n \n}","function simulat_menu_infos() {\n display_menu_infos();\n}","createMenus (){\n \n $.each(MenuData.menus, ( menuName, menuItems )=>{\n \n $('#gameNav-'+menuName+'Panel > .menu-links').html('');\n \n $.each(menuItems,( index, item )=>{\n \n var realRoute,itemLink,action,routeId;\n \n if(item.hideIfNotAuthenticated && !this.get('session.isAuthenticated')){\n return true;\n }\n \n if(item.label){\n // Translate item label\n let key = \"menu.\"+Ember.String.dasherize(menuName)+\".\"+Ember.String.dasherize(item.label);\n item.tLabel = this.get('i18n').t(key);\n }\n \n // Serialize route name for use as CSS id name\n item.cssRoute = item.route.replace(/\\./g,'_');\n \n // Track actionable link\n let addEvent = true;\n \n if(item.menuRoute){\n \n // For routes which don't appear in the menu but will cause a different menu link to highlight\n itemLink = $('');\n addEvent = false;\n \n } else if(item.tempRoute){\n itemLink = $(''+item.tLabel+'');\n action = 'transitionAction';\n realRoute = item.tempRoute;\n \n } else if(item.route){\n itemLink = $(''+item.tLabel+'');\n action = 'transitionAction';\n realRoute = item.route;\n \n if(item.params && item.params.id){\n routeId = item.params.id;\n }\n \n } else if(item.action) {\n itemLink = $(''+item.tLabel+'');\n let actionName = 'menuAction'+item.label.alphaNumeric();\n action = actionName;\n this.set(actionName,item.action);\n }\n \n if(itemLink){\n \n if(addEvent){\n itemLink.on('click',(e)=>{\n e.preventDefault();\n this.sendAction(action,realRoute,routeId);\n \n if(routeId){\n Ember.Blackout.transitionTo(realRoute,routeId);\n } else {\n Ember.Blackout.transitionTo(realRoute);\n }\n \n this.selectMenuLink(item.route);\n return false;\n });\n }\n \n $('#gameNav-'+menuName+'Panel > .menu-links').append(itemLink);\n }\n \n });\n });\n\n // Manually update hover watchers\n Ember.Blackout.refreshHoverWatchers();\n \n }","function showMenu(type) {\n switch (type) {\n case 'beer':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesOfType(\"Öl\"));\n break;\n case 'wine':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesOfType(\"vin\"));\n break;\n case 'spirits':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesWithStrength(\"above\", 20));\n break;\n case 'alcoAbove':\n lastMenu = type;\n if (document.getElementById(\"alco_percent\") != null) {\n alcoPercent = document.getElementById(\"alco_percent\").value;\n }\n addBasicMenu();\n showParticularMenu(allBeveragesWithStrength(\"above\", alcoPercent));\n break;\n case 'alcoBelow':\n lastMenu = type;\n if (document.getElementById(\"alco_percent\") != null) {\n alcoPercent = document.getElementById(\"alco_percent\").value;\n }\n addBasicMenu();\n showParticularMenu(allBeveragesWithStrength(\"below\", alcoPercent));\n break;\n case 'tannin':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu([]);\n break;\n case 'gluten':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu([]);\n break;\n case 'rest':\n currentFiltering = \"rest\";\n showMenu(lastMenu);\n break;\n case 'cat':\n currentFiltering = \"cat\";\n showMenu(lastMenu);\n break;\n case 'back':\n currentFiltering = \"none\";\n showMenu(allMenuBeverages());\n break;\n default:\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allMenuBeverages());\n }\n}","function showmenu(ev, category, deleted = false) {\n //stop the real right click menu\n ev.preventDefault();\n var mouseX;\n let element = \"\";\n if (ev.pageX <= 200) {\n mouseX = ev.pageX + 10;\n } else {\n let active_class = $(\"#sidebarCollapse\").attr(\"class\");\n if (active_class.search(\"active\") == -1) {\n mouseX = ev.pageX - 210;\n } else {\n mouseX = ev.pageX - 50;\n }\n }\n\n var mouseY = ev.pageY - 10;\n\n if (category === \"folder\") {\n if (deleted) {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(\" Restore\");\n $(menuFolder).children(\"#reg-folder-rename\").hide();\n $(menuFolder).children(\"#folder-move\").hide();\n $(menuFolder).children(\"#folder-description\").hide();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(' Delete All');\n $(menuFolder)\n .children(\"#folder-move\")\n .html(' Move All');\n $(menuFolder).children(\"#reg-folder-rename\").hide();\n $(menuFolder).children(\"#folder-description\").hide();\n } else {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(\"Delete\");\n $(menuFolder)\n .children(\"#folder-move\")\n .html(' Move');\n $(menuFolder).children(\"#folder-move\").show();\n $(menuFolder).children(\"#reg-folder-rename\").show();\n $(menuFolder).children(\"#folder-description\").show();\n }\n }\n menuFolder.style.display = \"block\";\n $(\".menu.reg-folder\").css({ top: mouseY, left: mouseX }).fadeIn(\"slow\");\n } else if (category === \"high-level-folder\") {\n if (deleted) {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(\" Restore\");\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(' Delete All');\n $(menuHighLevelFolders).children(\"#high-folder-delete\").show();\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n } else {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(\"Delete\");\n $(menuHighLevelFolders).children(\"#high-folder-delete\").show();\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n }\n }\n menuHighLevelFolders.style.display = \"block\";\n $(\".menu.high-level-folder\")\n .css({ top: mouseY, left: mouseX })\n .fadeIn(\"slow\");\n } else {\n if (deleted) {\n $(menuFile)\n .children(\"#file-delete\")\n .html(\" Restore\");\n $(menuFile).children(\"#file-rename\").hide();\n $(menuFile).children(\"#file-move\").hide();\n $(menuFile).children(\"#file-description\").hide();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuFile)\n .children(\"#file-delete\")\n .html(' Delete All');\n $(menuFile)\n .children(\"#file-move\")\n .html(' Move All');\n $(menuFile).children(\"#file-rename\").hide();\n $(menuFile).children(\"#file-description\").hide();\n } else {\n $(menuFile)\n .children(\"#file-delete\")\n .html(\"Delete\");\n $(menuFile)\n .children(\"#file-move\")\n .html(' Move');\n $(menuFile).children(\"#file-rename\").show();\n $(menuFile).children(\"#file-move\").show();\n $(menuFile).children(\"#file-description\").show();\n }\n }\n menuFile.style.display = \"block\";\n $(\".menu.file\").css({ top: mouseY, left: mouseX }).fadeIn(\"slow\");\n }\n}","function menu(menuArray)\n{\n if(skip === true) {\n skip = false;\n }\n novel.ignoreClicks = true;\n novel.dialog.innerHTML =\n menuArray[0].replace(/{{(.*?)}}/g, novel_interpolator);\n novel.dialog.style.textAlign=\"center\";\n for (var i = 1; i < menuArray.length; i += 2)\n {\n var mItem = new MenuItem((i-1) / 2, menuArray[i], menuArray[i+1]); \n var el = mItem.domRef;\n novel_addOnClick(el, menuArray[i+1]);\n el.innerHTML = menuArray[i].replace(/{{(.*?)}}/g, novel_interpolator);\n novel.tableau.appendChild(el);\n novel.actors.push(mItem);\n }\n novel.paused = true;\n}","openMenu(scene, index = 0) {\n this.index = index;\n this.parentIndex = undefined;\n\n //A few initial variables\n const gameWidth = scene.sys.game.config.width;\n const gameHeight = scene.sys.game.config.height;\n const cellWidth = 500;\n const cellHeight = 48;\n const length = this.categoriesGroup.getLength();\n\n //Remove old listeners & reset\n this.closeMenus(scene);\n\n //Change alpha of selected menu\n this.categoriesGroup.children.entries[index].setAlpha(1);\n // this.categoriesGroup.children.entries[index].setBackgroundColor('#000000');\n\n //Vertical Line\n const graphics = scene.add.graphics();\n graphics.lineStyle(1, 0xffffff);\n graphics.lineBetween(gameWidth - cellWidth, gameHeight * 2 / 3, gameWidth - cellWidth, gameHeight);\n\n const actions = this.categoriesGroup.children.entries[index].children;\n this.actionsGroup = scene.add.group();\n let nOfOptions = actions.length;\n\n for (let i = 0; i < nOfOptions; i++) {\n let itemsLeft = \"\";\n if (actions[i].supply > 0 && actions[i]) {\n itemsLeft = ` (${ actions[i].supply })`;\n }\n else if (actions[i].supply <= 0) {\n actions.pop(actions[i--]);\n nOfOptions--;\n continue;\n }\n\n const y = gameHeight * 2 / 3 + cellHeight * i;\n const x = 10 + gameWidth - cellWidth;\n\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', `${ actions[i].name + itemsLeft }`, 32);\n addedText.setAlpha(0.5);\n this.actionsGroup.add(addedText);\n }\n\n //If there are no options in a particular menu, display an error\n if (this.actionsGroup.children.size === 0) {\n const y = gameHeight * 2 / 3;\n const x = 10 + gameWidth - cellWidth;\n\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', 'Nothing to see here!', 32);\n this.actionsGroup.add(addedText);\n }\n }","function ocultarMenu(){\n\t\t$(\"#js-menu-recipe\").hide();\n}","function addPlantMenu(menu) {\n \n //call a function to create UL with plants at the position of a click\n const dropDownMenu = getUL(menu);\n \n //assign an onclick response that adds a plant(s)\n dropDownMenu.addEventListener(\"click\", function(evt) {\n \n //make sure the click is on a custom choice (inside a menu)\n if (!evt.target.classList.contains(\"customChoice\")) {\n return;\n }\n \n //capture plant li elements from the menu into an array so that their properties can be accessed\n const ar = Array.from(evt.target.parentElement.getElementsByTagName(\"li\"));\n \n //when adding plants to a garden, x-offset is calculated for each height group; the following determines how many plants fall into each height group, then the width is divided by the number of plants to calculate the available horizontal space between plants\n const xSp1 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\"data-avgh\"),0,24)).length);\n const xSp2 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\"data-avgh\"),24,48)).length);\n const xSp3 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\"data-avgh\"),48,72)).length);\n const xSp4 = menu.gW / (ar.filter(x => Number(x.getAttribute(\"data-avgh\")) >= 72).length);\n\n //when adding plants to a garden, x-offset variable is calculated for each height group and 1x..4 is for current plant's offset\n let x1 = x2 = x3 = x4 = 0;\n //for vertical offset, the yOffset is for each plant height group then the y1..4 is the small offset for each plant, so that they're not clustered together\n let y1 = y2 = y3 = y4 = 0;\n \n //loop through filtered plants and add them; when adding to a garden, the plant is centered within the garden; otherwise, it's placed to the left of menu; \n //if the menu was brought up too close to the left edge of the screen, the plant is placed to the right; vertically, the plant is at the position of its listing in the menu\n //unless 'Add All Plants' option is clicked, add 1 plant (because liCnt includes the 'Add All Plants' option, the itiration starts at 1, thus set liCnt to 2 for a sinlge addition)\n for (let i = 1, liCnt = evt.target.innerText === \"Add All Plants\"? ar.length : 2; i < liCnt; i++) {\n \n //the x and y offsets for plants added to a garden or freestanding\n let xOffset = yOffset = 0;\n\n //for plants added to a garden\n if (menu.gId) {\n //if adding all plants to a garden, space them at the intervals calculated below\n if (evt.target.innerText === \"Add All Plants\") {\n\n //using garden height, gH, calculate the desired vertical spacing of plant groups; horizontally, plants are placed at xOffset intervals\n yOffset = menu.gH / 3; //3 spaces between 4 groups\n if (Number(evt.target.parentElement.children[i].getAttribute(\"data-avgh\")) < 24) {\n //the shortest plants go to the front (bottom), thus the biggest offset\n yOffset *= 2; \n xOffset = menu.gX + x1 * xSp1;\n x1++;\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\"data-avgh\")) < 48) {\n yOffset *= 1.5;\n xOffset = menu.gX + x2 * xSp2;\n x2++;\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\"data-avgh\")) < 72) {\n xOffset = menu.gX + x3 * xSp3;\n x3++;\n } else {\n yOffset *= 0.5;\n xOffset = menu.gX + x4 * xSp4;\n x4++;\n }\n \n yOffset = menu.gY + yOffset;\n \n //alternate vertical position slightly\n if (i%2) yOffset += munit*2;\n\n }\n else {\n xOffset = menu.gX + menu.gW/2;\n yOffset = menu.gY + menu.gH/2;\n }\n }\n \n //for freestanding plants\n else {\n //Y-OFFSET: when adding all plants, space them vertically 16px apart; otherwise, the vertical placing is at the location of the name in the list; \n yOffset = evt.target.innerText === \"Add All Plants\" ? \n parseInt(window.getComputedStyle(evt.target.parentElement).top) + 16 * i : \n event.pageY;\n //X-OFFSET: if the menu is too close (within 150px) to the left edge of the screen, add the plant on the right, otherwise - left\n// todo: check if the x-calculation creates a result that's too long\n if (parseInt(evt.target.parentElement.style.left) < 150) {\n //xOffset needs to include the alphabet shortcuts that all plants have on the sides\n xOffset = menu.type === \"all\" ? \n parseInt(evt.target.parentElement.nextSibling.nextSibling.style.left) + munit * 5 : \n parseInt(evt.target.parentElement.style.left) + parseInt(window.getComputedStyle(evt.target.parentElement).width) + munit * 3;\n } else {\n xOffset = menu.type === \"all\" ? \n parseInt(evt.target.parentElement.nextSibling.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7 : \n parseInt(evt.target.parentElement.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7;\n }\n }\n \n const plantLi = evt.target.innerText != \"Add All Plants\" ? evt.target : evt.target.parentElement.children[i];\n\n addPlant({\n pId:null, //plant id is set to null, when creating a new plant\n x: parseFloat(xOffset),\n y: parseFloat(yOffset),\n w:Number(plantLi.getAttribute(\"data-avgw\")),\n h:Number(plantLi.getAttribute(\"data-avgh\")),\n nm:plantLi.innerText, //plant's common name\n gId:menu.gId?menu.gId:0, //a garden id, where the new plant is planted, 0 at first\n lnm:plantLi.getAttribute(\"data-lnm\"), //plant's latin name\n shp:plantLi.getAttribute(\"data-shp\"),\n clr:plantLi.getAttribute(\"data-bloomC\"),\n blm:plantLi.getAttribute(\"data-bloomM\")\n });\n }\n });\n \n //the menu with event listeners have been created, now the menu is added to the document's body, not svg\n document.body.appendChild(dropDownMenu);\n}","function startMenu() {\n createManager();\n}","function menu(){\n background(img,0);\n //retangulo para selecionar a tela\n fill(255, 204, 0)\n rect(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n image(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n fill(233,495,67);\n textSize(26);\n text('JOGAR ', 250, 100)\n //detalhes do texto abaixo\n fill(233,495,67);\n textSize(26);\n text('INSTRUÇÕES', 230, 200);\n text('CREDITOS', 230, 300);\n }","function RenderDish({selectedDish}){\n //check for null dish\n if(selectedDish!=null){\n return(\n \n \n \n {selectedDish.name}\n {selectedDish.description}\n \n \n );\n }else{\n return(\n
    \n );\n }\n \n }","function menuItems() {\n const farmMenu = document.createElement('div');\n farmMenu.classList.add('menu');\n \n farmMenu.appendChild(createItem(\n 'beef tartare', \n '$14',\n 'egestas pretium aenean pharetra magna ac placerat vestibulum'));\n farmMenu.appendChild(createItem(\n 'mussels provencale',\n '$20',\n 'sed adipiscing diam donec adipiscing tristique risus nec'));\n farmMenu.appendChild(createItem(\n 'scallops', \n '$18',\n 'vitae congue mauris rhoncus aenean vel elit scelerisque'));\n farmMenu.appendChild(createItem(\n 'flemish onion soup', \n '$10',\n 'elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus'));\n farmMenu.appendChild(createItem(\n 'braised short ribs', \n '$22',\n 'sagittis purus sit amet volutpat consequat mauris nunc'));\n farmMenu.appendChild(createItem(\n 'wedge salad', \n '$10',\n 'nibh sed pulvinar proin gravida hendrerit lectus a'));\n farmMenu.appendChild(createItem(\n 'charcuterie', \n '$16',\n 'non blandit massa enim nec dui nunc mattis'));\n\n return farmMenu;\n }","function showShop() {\n\tmenuHideAll();\n\t$('#shop').show();\n\tmenuResetColors();\n\tmenuSetColor('shopBox');\n}","function showMenu( el, type ) {\n\tvar list;\n\tvar type;\n\tvar target;\n\n\tlist = el.childNodes;\n\n\tif( type == null ) {\n\t\ttype = 'TABLE';\n\t}\n\n\tif ( el.className == \"menutitle\" ) {\n\t\t// el.style.color = \"#4c6490\";\n\t\tel.style.color = \"#eeeeff\";\n\t\tel.style.backgroundColor = 'white';\n\t\tel.style.borderStyle = 'solid';\n\t\tel.style.borderWidth = '1px';\n\t\tel.style.borderColor = '#4c6490';\n\t\tel.style.margin = '1px';\n\t}\n\n\tfor ( i=0; i < list.length; i++ ) {\n\t\tif(( list[i].nodeName == 'DIV' ) &&\n\t\t\t( list[i].className == \"submenuitem\" ) ) {\n\t\t\tlist[i].style.borderStyle = 'solid';\n\t\t\tlist[i].style.borderColor = '#ccc';\n\t\t\tlist[i].style.borderWidth = '1px';\n\t\t\tlist[i].style.backgroundColor = '#fefeff';\n\t\t}\n\n\t\tif( list[i].nodeName != type ) {\n\t\t\tcontinue;\n\t\t};\n\n\t\tfadeInit ( list[i], 'in' );\n\t}\n}","function display_start_menu() {\n\tstart_layer.show();\n\tstart_layer.moveToTop();\n\t\n\tdisplay_menu(\"start_layer\");\n\tcharacter_layer.moveToTop();\n\tcharacter_layer.show();\n\tinventory_bar_layer.show();\n\t\n\tstage.draw();\n\t\n\tplay_music('start_layer');\n}","function getMenu(str) {\n \n\tmanageDOM.clearContent(\"content\");\n \n\t// query mongoDB for cached menu\n\tlet day = str === \"today\" ? \"Today\" : \"Tomorrow\";\n\tlet menuDay = Menu.findOne( {\"day\": day});\n \n\t// Builds html elements for either today's or tomorrow's menu\n\tmenuDay.exec( (err, data) => {\n\t\tif (err) throw (err);\n\t\telse if (data != null) {\n\t\t\tlet arr = [];\n\t\t\tlet i = 1;\n\n\t\t\tif (data.meal_0 != null) { arr.push(JSON.parse(data.meal_0)); }\n\t\t\tif (data.meal_1 != null) { arr.push(JSON.parse(data.meal_1)); }\n\t\t\tif (data.meal_2 != null) { arr.push(JSON.parse(data.meal_2)); }\n \n\t\t\t// create an array of elements to build the DOM\n\t\t\tlet meal_list = [\"cantina-wrapper center-div\", \"cantina-greet\"];\n\t\t\tfor (let j = 0; j < arr.length; j++) {\n\t\t\t\tmeal_list.push(\"spacer\" + i);\n\t\t\t\tmeal_list.push(\"time\" + i);\n\t\t\t\tmeal_list.push(\"meal\" + i);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (data.cafe42 != null) {\n\t\t\t\tmeal_list.push(\"spacer\" + i);\n\t\t\t\tmeal_list.push(\"cafe\");\n\t\t\t}\n\n\t\t\tmanageDOM.array2Div(meal_list);\n \n\t\t\tdocument.getElementById(\"cantina-greet\").innerHTML = \"the 42 cantina menu for \" + str + \" is\";\n \n\t\t\t// for each div, give it a class and add appropriate content whether it is time or meal descroption\n\t\t\tfor (i = 2; i < meal_list.length; i++) {\n\t\t\t\tif (meal_list[i][0] === \"t\") {\n\t\t\t\t\tlet date = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].begin_at));\n\t\t\t\t\tlet date_end = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].end_at));\n\t\t\t\t\tlet t = document.getElementById(meal_list[i]);\n\t\t\t\t\tlet item = arr[Math.floor((i - 1) / 3)];\n\t\t\t\t\tt.setAttribute(\"class\", \"cantina-hours\");\n\t\t\t\t\tt.innerHTML = \"\\\n $\" + item.price + \" -- \\\n Served from \" + date.format(\"HH:mm\") + \" until \" + date_end.format(\"HH:mm\") + \":\"; \n\t\t\t\t}\n\t\t\t\telse if (meal_list[i][0] === \"m\") {\n\t\t\t\t\tlet m = document.getElementById(meal_list[i]);\n\t\t\t\t\tm.setAttribute(\"class\", \"meal\");\n\t\t\t\t\tlet item = arr[Math.floor((i - 2) / 3)];\n\t\t\t\t\tlet br = item.menu;\n\n\t\t\t\t\t// Replaces 'line feed' and 'carriage return' with and HTML break\n\t\t\t\t\tbr = br.replace(/\\r\\n/g, \"
    \");\n\t\t\t\t\tm.innerHTML = br; \n\t\t\t\t}\n\t\t\t\telse if (meal_list[i][0] === \"c\") {\n\t\t\t\t\tlet c = document.getElementById(\"cafe\");\n\t\t\t\t\tc.setAttribute(\"class\", \"meal\");\n\t\t\t\t\tlet cafe42 = JSON.parse(data.cafe42);\n\t\t\t\t\tlet cafe42Menu = cafe42.menu;\n\t\t\t\t\tcafe42Menu = cafe42Menu.replace(/\\r\\n/g, \"
    \").replace(\"cafe 42\",\n\t\t\t\t\t\t\"Cafe 42: ~ \\\n \\\n $\" + cafe42.price + \"\");\n\t\t\t\t\tc.innerHTML = cafe42Menu;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet s = document.getElementById(meal_list[i]);\n\t\t\t\t\ts.setAttribute(\"class\", \"spacing\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Error retrieving Cantina menu from Mongo DB\");\n\t\t}\n\t});\n}","function dashSubMenu(){\n\t\t\tif(wid <= 600){\n\t\t\t\tmenuHS();\t\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#dashInSubMenuId\").css(\"background-color\", \"#0E0E0E\");\n\t\t\t$(\"#costInSubMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\t$(\"#sellInSubMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\t$(\"#stockMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\t$(\"#settingInSubMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\twindow.location.assign(\"index.php\");\n}","function openNewGameMenu () {\n document.getElementById('menu-background').style.display = 'block';\n document.getElementById('menu-content').style.display = 'block';\n}","function AddCustomMenuItems(menu) {\n menu.AddItem(strMenuItemLoop, \n (doLoop == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\n menu.AddItem(strMenuItemShuffle, \n (doShuffle == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function init_dash() {\n dropDown();\n}","setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }","function displayMenu() {\n inquirer.prompt(menuChoices).then((response) => {\n switch (response.selection) {\n case \"View Departments\":\n //call function that shows all departments\n viewDepartments();\n break;\n\n case \"Add Department\":\n //call function that adds a department\n addDepartment();\n break;\n\n case \"View Roles\":\n getRole();\n break;\n\n case \"Add Role\":\n addRole();\n break;\n\n case \"View Employees\":\n viewEmployee();\n break;\n\n case \"Add Employee\":\n addEmployee();\n break;\n\n case \"Update Employee\":\n break;\n\n default:\n connection.end();\n process.exit();\n // quit the app\n }\n });\n}","function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\n}","function menu() {\n\t\n // Title of Game\n title = new createjs.Text(\"Poker Room\", \"50px Bembo\", \"#FF0000\");\n title.x = width/3.1;\n title.y = height/4;\n\n // Subtitle of Game\n subtitle = new createjs.Text(\"Let's Play Poker\", \"30px Bembo\", \"#FF0000\");\n subtitle.x = width/2.8;\n subtitle.y = height/2.8;\n\n // Creating Buttons for Game\n addToMenu(title);\n addToMenu(subtitle);\n startButton();\n howToPlayButton();\n\n // update to show title and subtitle\n stage.update();\n}","function Restaurant(name, menu){\n this.name = name;\n this.menu = menu;\n}","function menuzordActive () {\n if ($(\"#menuzord\").length) {\n $(\"#menuzord\").menuzord({\n indicatorFirstLevel: ''\n });\n };\n}","function C999_Common_Achievements_MainMenu() {\n C999_Common_Achievements_ResetImage();\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}","function getMenus(restaurant) {\n restaurantId = restaurant || \"\";\n if (restaurantId) {\n restaurantId = \"/?restaurant_id=\" + restaurantId;\n }\n $.get(\"/api/menus\" + restaurantId, function (data) {\n console.log(\"Menus\", data);\n menus = data;\n if (!menus || !menus.length) {\n displayEmpty(restaurant);\n }\n else {\n initializeRows();\n }\n });\n }","showMenu() {\n this._game = null;\n this.stopRefresh();\n this._view.renderMenu();\n this._view.bindStartGame(this.startGame.bind(this));\n this._view.bindShowScores(this.showScores.bind(this));\n }","function mainMenu() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"Add Departments\",\n \"Add Roles\",\n \"Add Employees\",\n \"View Departments\",\n \"View Roles\",\n \"View Employees\",\n \"Update Role\",\n \"Update Manager\"\n // \"View Employees by Manager\"\n ]\n })\n // Case statement for selection of menu item\n .then(function(answer) {\n switch (answer.action) {\n case \"Add Departments\":\n addDepartments();\n break;\n case \"Add Roles\":\n addRoles();\n break;\n case \"Add Employees\":\n addEmployees();\n break;\n case \"View Departments\":\n viewDepartments();\n break;\n\n case \"View Roles\":\n viewRoles();\n break;\n case \"View Employees\":\n viewEmployees();\n break;\n case \"Update Role\":\n updateRole();\n break;\n case \"Update Manager\":\n updateManager();\n break;\n // case \"View Employees by Manager\":\n // viewEmployeesByManager();\n // break;\n }\n });\n}","renderMenu(data) {\n // check if there is 1 valid category\n if (data.size < 1) {\n selectors.$content.append(`

    Infelizmente, nenhuma notícia foi encontrada!

    `)\n console.log(\"nenhuma categoria encontrada\");\n return;\n }\n\n data.forEach(el => {\n selectors.$menu.append(`
  • ${el.nome}

  • `)\n })\n\n\n selectors.$menu.find(\"li\").filter(\".item\").on('click', (e) => {\n this._initShowNews(e.currentTarget.id)\n })\n }","function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}","function menu() {\n inquirer\n .prompt({\n name: \"menuOptions\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add Inventory\", \"Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer, run appropriate function\n if (answer.menuOptions === \"View Products\") {\n viewProducts();\n }\n else if (answer.menuOptions === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (answer.menuOptions === \"Add Inventory\") {\n addInventory();\n }\n else if (answer.menuOptions === \"Add New Product\") {\n addNewProduct();\n }\n else {\n connection.end();\n }\n });\n}","function testMenuPostion( menu ){\n \n }","showQuickMenu() { $(`#${this.quickMenuId}`).show(); }","function menu(){\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"exit\"\n ]\n }).then(function(answer){\n switch(answer.action){\n case \"View Products for Sale\":\n products();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}","function itemMenu(e) {\n\te.preventDefault();\n\tItemSelection = e.target;\n\tconst[idx, isSource] = findNode(ItemSelection);\n\tconst elemName = (isSource) ? \"sourceDropdown\" : \"deviceDropdown\";\n\tconst menu = document.getElementById(elemName);\n\tmenu.style.top = `${e.pageY}px`;\n\tmenu.style.left = `2rem`;\n\tmenu.classList.toggle(\"show\");\n}","function showHoodies()\n{\n\t//show all items with theid 'hoodies'\n\tdocument.getElementById('hoodies').style.display = \"block\";\n\t//hide all other items\n\tdocument.getElementById('hats').style.display = \"none\";\n\tdocument.getElementById('accessories').style.display = \"none\";\n\tdocument.getElementById('skate').style.display = \"none\";\n\tdocument.getElementById('show').style.display = \"block\";\n}","constructor(){\n super();\n this.menu = [\n {\n path: '/',\n title: 'Home'\n },\n {\n path: '/npc',\n title: 'Npc\\'s'\n },\n {\n path: '/enemies',\n title: 'Enemies'\n },\n {\n path: '/bosses',\n title: 'Bosses'\n },\n {\n path: '/places',\n title: 'Places'\n },\n {\n path: '/about',\n title: 'About'\n },\n ];\n }","function showMenu() {\n if(newGame) {\n $('#main').show();\n }\n else {\n $('#end').show();\n }\n}","function superfishSetup() {\n\t\t$('#navigation').find('.menu').superfish({\n\t\t\tdelay: 200,\n\t\t\tanimation: {opacity:'show', height:'show'},\n\t\t\tspeed: 'fast',\n\t\t\tcssArrows: true,\n\t\t\tautoArrows: true,\n\t\t\tdropShadows: false\n\t\t});\n\t}","function renderDish(dish) {\n //setting up column and cards to add to the row\n let column = $(\"
    \");\n //Create dish card\n let card = $(\"
    \");\n card.addClass(\"card z-depth-4\");\n card.attr(\"data-number\", dish.dishNumber);\n\n //set up image with title and button---------\n let cardImg = $(\"
    \");\n cardImg.addClass(\"card-image\");\n let img = $(\"\");\n img.attr(\"src\", dish.foodImg);\n //setting up title\n let titleSpan = $(\"\");\n titleSpan.addClass(\"card-title\");\n let title = $(\"

    \");\n titleSpan.append(title);\n cardImg.append(img);\n cardImg.append(titleSpan);\n\n let recipe = $(\"

    \");\n //If no ingredients, dish is part of a choice\n if (!dish.ingredients) {\n //Choices is 3x2 at l\n column.addClass(\"col s12 m6 l4\");\n // Add choice class to attach to an event listener\n card.addClass(\"hoverable choices\");\n // Add button\n let aTag = $(\"\");\n aTag.addClass(\"btn-floating btn-large btn waves-effect waves-red halfway-fab cyan pulse\");\n let iTag = $(\"\");\n iTag.addClass(\"material-icons\");\n iTag.text(\"add\");\n aTag.append(iTag);\n cardImg.append(aTag);\n // Title goes in content \n recipe.text(dish.foodName);\n } else {\n // If dish is not a choice is final result title goes in header and ingredients go in content\n column.addClass(\"col s12 m6 l6\");\n title.text(dish.foodName);\n let header = $(\"

    \").text(\"Ingredients:\");\n recipe.append(header);\n for (let i = 0; i < dish.ingredients.length; i++){\n let ingredient = $(\"

    \");\n ingredient.text(`${i + 1}. ${dish.ingredients[i]}`)\n recipe.append(ingredient);\n }\n }\n\n //setting up content-----------------------\n let content = $(\"

    \");\n content.addClass(\"card-content\");\n content.append(recipe);\n\n //done setting up content / Append everythin to row\n card.append(cardImg);\n card.append(content);\n column.append(card);\n $(\"#choices\").append(column);\n}","function openMenu() {\n g_IsMenuOpen = true;\n}","function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function getSubChapterMenu(){\n\t\n}","function createMenu() {\n zeroStarArrays();\n num_stars_input = createInput('');\n num_stars_input.position(20, 50);\n submit_num = createButton('# Stars');\n submit_num.position(20 + num_stars_input.width, 50);\n submit_num.mousePressed(setNumStars);\n num_planets_input = createInput('');\n num_planets_input.position(20 + num_stars_input.width + 70, 50);\n submit_num_planets = createButton('# Planets');\n submit_num_planets.position(20 + num_planets_input.width + num_stars_input.width + 70, 50);\n submit_num_planets.mousePressed(setNumPlanets);\n}","function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }","function setMenu(menu){ \n switch(menu){\n case 'food-input-icon':\n loadFoodMenu();\n break; \n \n case 'stats-icon':\n loadStatsMenu(); \n break; \n \n case 'settings-icon':\n loadSettingsMenu(); \n break;\n \n case 'share-icon':\n loadShareMenu(); \n break;\n \n case 'sign-out-icon':\n signOut(); \n break;\n case 'nav-icon':\n loadNavMenu(); \n \n }\n}","function handleMenu(){\n\t$(\"#examples-menu\").mouseover(function(){\n\t\tvar position = $(\"#examples-menu\").offset();\n\t\tvar top = $(\"#examples-menu\").outerHeight();\n\t\t$(\"ul.examples\").offset({left:position.left, top:top+position.top});\n\t\t$(\"ul.examples\").show();\n\t})\n\t$(\"h1,table,img,form\").mouseover(function(){\n\t\t$(\"ul.examples\").offset({left:0, top:0});\n\t\t$(\"ul.examples\").hide();\n\t})\t\n}","function mainMenu() {\n inquirer.prompt({\n type: \"list\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: [\n { name: \"Add something\", value: createMenu },\n { name: \"View something\", value: readMenu },\n { name: \"Change something\", value: updateMenu },\n { name: \"Remove something\", value: deleteMenu },\n { name: \"Quit\", value: quit }\n ]\n }).then(({ action }) => action());\n}","function menu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Supervisor's Menu Options:\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"Exit\"]\n }\n ]).then(function (answers) {\n if (answers.choice === \"View Product Sales By Department\") {\n displaySales();\n }\n else if (answers.choice === \"Create New Department\") {\n createDepartment();\n }\n else {\n connection.end();\n }\n });\n}","showQuickMenu() { $(`.${this.quickMenu}`).show(); }","function actionOnClick () {\r\n game.state.start(\"nameSelectionMenu\");\r\n}","function mainMenuShow () {\n $ (\"#menuButton\").removeAttr (\"title-1\");\n $ (\"#menuButton\").attr (\"title\", htmlSafe (\"Stäng menyn\")); // i18n\n $ (\"#menuButton\").html (\"×\");\n $ (\".mainMenu\").show ();\n}","function burstMenu(title,color,selected) {\t\njQuery('.menu-item-'+title).mouseover(function () {\n \n jQuery('.show-item-'+title).css({\n visibility: 'visible',\n\t\t'z-index': '2'\n });\n\t\n\t\n jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n\n jQuery('.show-item-'+title).mouseover(function () {\n jQuery('.show-item-'+title).css({\n visibility: 'visible',\n\t\t\t'z-index': '2'\n });\n jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n });\n\n jQuery('.show-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css({\n visibility: 'hidden'\n });\n jQuery('.menu-item-'+title+' > a').css({\n background: 'inherit'\n })\n });\n\n});\n\njQuery('.menu-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css({\n visibility: 'hidden'\n });\n jQuery('.menu-item-'+title+' > a').css({\n background: 'inherit'\n })\n});\n\nif (selected == true) {\n \njQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\n\n\t jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n\t\t\t\n\tjQuery('.menu-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\n jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n\t\n\t jQuery('.show-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\n\t jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n });\n\t\n});\n\t\t\n}\n\t\n}","function qll_module_erepmenu()\r\n{\r\n\tvar menu= new Array();\r\n\tvar ul = new Array();\r\n\r\n\tmenu[0]=document.getElementById('menu');\r\n\tfor(i=1;i<=6;i++)\r\n\t\tmenu[i]=document.getElementById('menu'+i);\r\n\t\r\n//\tmenu[1].innerHTML=menu[1].innerHTML + '
      ';\r\n\tmenu[2].innerHTML=menu[2].innerHTML + '
        ';\r\n\tmenu[3].innerHTML=menu[3].innerHTML + '
          ';\r\n\tmenu[6].innerHTML=menu[6].innerHTML + '
            ';\r\n\t\r\n\tfor(i=1;i<=6;i++)\r\n\t\tul[i]=menu[i].getElementsByTagName(\"ul\")[0];\r\n\t\r\n\tif(qll_opt['module:erepmenu:design'])\r\n\t{\r\n\t\r\n\t\t//object.setAttribute('class','new_feature_small');\r\n\t\t\t\r\n\t//\tmenu[2].getElementsByTagName(\"a\")[0].href = \"http://economy.erepublik.com/en/time-management\";\r\n\t\t\r\n\t\t/*aux = ul[2].removeChild(ul[2].getElementsByTagName(\"li\")[6]);\t// adverts\r\n\t\tul[6].appendChild(aux);\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='
            ' + \"Work\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Training grounds\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Newspaper\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Inventory\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Organizations\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + qll_lang[97] + '';\r\n\t\tul[2].appendChild(object);\r\n\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + qll_lang[69] + '';\r\n\t\tul[3].appendChild(object);\r\n\t\t//ul[4].insertBefore(object,ul[4].getElementsByTagName(\"li\")[3])\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Loyalty program\" + '';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Gold bonus\" + '';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t}\r\n}","function goToMenu() {\n stopTTS();\n cStatus = undefined;\n cStatus = new CurrentStatus();\n $('#quiz').hide('slow');\n $('#game').hide('slow');\n $('#menu').show('slow');\n}","removeDishFromMenu(id) {\n this.menu = this.menu.filter(dish => dish.id !== id)\n }","function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","function dropMenu() {\r\n // the menu content\r\n document.getElementById(\"menu1\").innerHTML = \"Guess Table\";\r\n\r\n}","function menu() {\n if (currentPlayerPokemon.fainted == true) {\n return;\n }\n rollText(\"battle_text\", `What will ${currentPlayerPokemon.name} do?`, 25);\n document.getElementById('buttonsBattle').style['display'] = 'block';\n button1.className = `buttons`;\n button2.className = `buttons`;\n button3.className = `buttons`;\n button4.className = `buttons`;\n button1.innerHTML = `FIGHT`;\n button2.innerHTML = `ITEM`;\n button3.innerHTML = `POKEMON`;\n button4.innerHTML = `RUN`;\n\n button1.onclick = () => fight(currentPlayerPokemon);\n button2.onclick = () => item();\n button3.onclick = () => pokemon(playerParty);\n button4.onclick = () => run();\n}","function mainMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"introAction\",\n\t\tmessage: \"Welcome, pick an action: \",\n\t\tchoices: [\"Create a Basic Card\", \"Create a Cloze Card\", \"Review Existing Cards\"]\n\t}]).then(function(answers){\n\t\tswitch (answers.introAction) {\n\t\t\tcase \"Create a Basic Card\":\n\t\t\t\tcreateBasicCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Create a Cloze Card\":\n\t\t\t\tcreateClozeCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Review Existing Cards\":\n\t\t\t\treviewCards();\n\t\t\t\tbreak;\n\t\t}\n\t});\n}"],"string":"[\n \"function displayMenu() {\\n const menu = document.querySelector(\\\"#menu\\\");\\n let dishes = hard_coded_dishes;\\n\\n dishes.forEach(dish => {\\n // generate template for main ingredient and the name of the dish\\n const main = displayDish(\\n dish.course,\\n dish.name,\\n dish.price,\\n dish.ingredient\\n );\\n\\n // generate options for each dish\\n const options = [];\\n\\n if (dish.options) {\\n dish.options.forEach(option => {\\n options.push(displayOption(option.option, option.price));\\n });\\n }\\n\\n // add this to the DOM\\n menu.insertAdjacentHTML(\\\"beforeend\\\", main + options.join(\\\"\\\"));\\n });\\n}\",\n \"addDishToMenu(dish) {\\n if(this.menu.includes(dish))\\n {\\n this.removeDishFromMenu(dish.id);\\n }\\n this.menu.push(dish);\\n }\",\n \"function showMenu(arg)\\r\\n\\t{\\r\\n\\t\\tswitch(arg)\\r\\n\\t\\t{\\r\\n\\t\\t\\tcase 0:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"\\\");\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t\\tcase 1:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"

            Sheep's Snake

            Press A to play!

            Press B for some help !

            \\\");\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function foodMenuItems() {\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\\r\\n\\t\\t\\t\\t\\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tvar $that = $(this),\\r\\n\\t\\t\\t\\t\\t\\twaypoint = new Waypoint({\\r\\n\\t\\t\\t\\t\\t\\t\\telement: $that,\\r\\n\\t\\t\\t\\t\\t\\t\\thandler: function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\treturn;\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$that.find('.nectar_food_menu_item').each(function (i) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tvar $that = $(this);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tsetTimeout(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$that.addClass('animated-in');\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}, i * 150);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t},\\r\\n\\t\\t\\t\\t\\t\\t\\toffset: $foodItemOffsetPos\\r\\n\\t\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t}\",\n \"getMenu() {alert(\\\"entering grocery.js getMenu()\\\")\\n\\t\\t// Assemble the menu list (meal nodes)\\n\\t\\tthis.menuCloset.destructBoxes()\\n\\t\\tlet mealNodes = graph.getNodesByID_partial(\\\"meal\\\", \\\"\\\")\\n\\t\\tfor (let meal of mealNodes) {\\n\\t\\t\\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\\n\\t\\t\\t\\tthis.menuCloset.add(meal)\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tthis.updateGroceryList()\\n\\t}\",\n \"function thememascot_menuzord() {\\n $(\\\"#menuzord\\\").menuzord({\\n align: \\\"left\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n $(\\\"#menuzord-right\\\").menuzord({\\n align: \\\"right\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n }\",\n \"constructor(props) {\\n super(props);\\n\\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\\n this.state = {\\n selectedDish: null\\n }\\n console.log('menu constructor is invoke')\\n \\n }\",\n \"function onOpen() {\\n createMenu();\\n}\",\n \"function loadMenu(){\\n\\t\\tpgame.state.start('menu');\\n\\t}\",\n \"function menu() {\\n this.meal1 = \\\"Ham and Cheese Sandwich\\\",\\n this.meal2 = \\\"Roastbeef Sandwich\\\"\\n }\",\n \"function menuHandler() {\\n console.log('menuHandler');\\n\\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\\n agent.add(new Suggestion(`Esplorazione delle categorie`));\\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\\n agent.add(new Suggestion(`Suggerimento prodotto`));\\n}\",\n \"function lijstSubMenuItem() {\\n\\n if ($mLess.text() == \\\"meer\\\") {\\n $mLess.text(\\\"minder\\\")\\n } else {\\n $mLess.text(\\\"meer\\\");\\n\\n }\\n $list.toggleClass('hidden')\\n $resum.get(0).scrollIntoView('slow');\\n event.preventDefault()\\n }\",\n \"function DfoMenu(/**string*/ menu)\\r\\n{\\r\\n\\tSeS(\\\"G_Menu\\\").DoMenu(menu);\\r\\n\\tDfoWait();\\r\\n}\",\n \"function showMenu() {\\n // clear the console\\n console.log('\\\\033c');\\n // menu selection\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n choices: [\\\"View Product Sales by Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"],\\n message: '\\\\nWhat would you like to do? '\\n }\\n ]).then( answer => {\\n switch (answer.wish){\\n case \\\"View Product Sales by Department\\\":\\n showSale();\\n break;\\n case \\\"Create New Department\\\":\\n createDept();\\n break;\\n case \\\"Exit\\\":\\n connection.end();\\n break;\\n default:\\n console.log( `\\\\x1b[1m \\\\x1b[31m\\\\nERROR! Invalid Selection\\\\x1b[0m`);\\n }\\n })\\n}\",\n \"function createMenu() {\\n const menu = document.createElement(\\\"div\\\");\\n for (let section in Menu) {\\n menu.appendChild(createDishSection(Menu[section].name));\\n menu.appendChild(createDishList(Menu[section].dishes));\\n }\\n return menu;\\n}\",\n \"function menuhrres() {\\r\\n\\r\\n}\",\n \"function menuOptions() {}\",\n \"function showMainMenu(){\\n addTemplate(\\\"menuTemplate\\\");\\n showMenu();\\n}\",\n \"function onOpen() { CUSTOM_MENU.add(); }\",\n \"function clickAddnewMenu(){\\n\\t\\t\\n\\t\\t$(\\\"#menuAddNew\\\").show();\\n\\t\\t//$(\\\".categorydropList\\\").load(jssitebaseUrl+\\\"/ajaxActionRestaurant.php?action=categoryDropList\\\");\\n\\t\\t$(\\\"#menuEdit\\\").hide();\\n\\t\\t//$(\\\"#addnew_buttun\\\").hide();\\n\\t\\t$(\\\".restaurantMenuContent\\\").hide();\\n\\t}\",\n \"function menuShow() {\\n ui.appbarElement.addClass('open');\\n ui.mainMenuContainer.addClass('open');\\n ui.darkbgElement.addClass('open');\\n}\",\n \"function onOpen() {\\n SpreadsheetApp.getUi()\\n .createMenu('Great Explorations')\\n .addItem('Match Girls to Workshops', 'matchGirls')\\n .addToUi();\\n}\",\n \"function showMenu(){\\n // shows panel for piano\\n rectMode(CENTER);\\n fill(0, 100, 255);\\n rect(width/2, height/2 - 100, 400, 150);\\n textAlign(CENTER, CENTER), textSize(75);\\n fill(0);\\n text('Piano', width/2, height/2 - 100);\\n \\n // shows panel for guitar\\n rectMode(CENTER);\\n fill(0, 240 , 250);\\n rect(width/2, height/2 + 100, 400, 150);\\n textAlign(CENTER, CENTER), textSize(75);\\n fill(0);\\n text('Guitar', width/2, height/2 + 100);\\n}\",\n \"function fancyRestauratMenu() {\\n subTitle.innerText = fancyRestaurantWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fancyDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFancyRestaurantChoice();\\n}\",\n \"expandMenu() {\\r\\n\\t}\",\n \"function fastFoodRestaurantScene() {\\n subTitle.innerText = fastfoodWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fastDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFastRestaurantChoice();\\n}\",\n \"function setMenu() {\\n var menu = gId('menu');\\n var menu_elements = menu.children;\\n for (var i = 0; i < menu_elements.length; i++) {\\n if (menu_elements[i].textContent != \\\"my stories\\\") {\\n menu_elements[i].style.display = 'none';\\n }\\n }\\n}\",\n \"function _createFoodMenu( data ) {\\n var html = '', note = data.notification ? \\n '
            '+data.notification+'
            ' : '';\\n \\n if ( data.headline ) {\\n var id = getAutoId(); \\n html = '

            '+data.headline+'

            '+note;\\n } else if ( data.subline ) {\\n html = '

            '+data.subline+'

            '+note;\\n } else if ( data.type === 'setmenu-price' ) {\\n html = '
            '+data.price+'
            '+note;\\n } else {\\n var name = data.name ? '
            '+data.name+'
            ' : '';\\n var number = data.number ? '
            '+data.number+'
            ' : '';\\n var price = data.price ? '
            '+data.price+'
            ' : '';\\n\\n var description = data.description ? \\n '
            '+data.description+'
            ' : '';\\n var sashimi = data.sashimi ? \\n '
            '+data.sashimi+'
            ' : '';\\n var type = 'food' + (data.type ? (' -'+data.type) : '') +\\n (sashimi ? ' -has-sashimi' : '') + (number ? '' : ' -no-number');\\n\\n html = '
            ' +\\n number + name + price + sashimi + description + note +\\n '
            '; \\n }\\n return html;\\n}\",\n \"function renderMenu() {\\n\\tvar menu = com.dawgpizza.menu;\\n\\t// grab templates for duplication\\n\\tvar pizzaTemplate = $('.pizza-template');\\n\\tvar drinkDessertTemplate = $('.drink-dessert-template');\\n\\t$.each(com.dawgpizza.menu.pizzas, function() {\\n\\t\\tvar pizzaTemplateClone = pizzaTemplate.clone();\\n\\t\\t// populate the clone's fields\\n \\tpizzaTemplateClone.find('.name').html(this.name);\\n \\tpizzaTemplateClone.find('.description').html(this.description + \\\" \\\" \\n \\t\\t+ this.prices[0]+\\\"/\\\"+this.prices[1]+\\\"/\\\"+this.prices[2]);\\n\\n \\t// data-type=\\\"\\\" data-name=\\\"\\\" data-qty=\\\"\\\" data-price=\\\"\\\"\\n \\tpizzaTemplateClone.find('button.form-control').attr({\\n \\t\\t\\\"data-type\\\": this.type,\\n \\t\\t\\\"data-name\\\": this.name\\n \\t});\\n \\t// add prices to select options\\n \\tvar pizza = this;\\n\\t $.each(pizzaTemplateClone.find('select').children(), function(idx) {\\n\\t \\t$(this).val(pizza.prices[idx]);\\n\\t });\\n\\t if(this.vegetarian) { // put in the vegetarian menu.\\n\\t \\t$('#veggie-spot').append(pizzaTemplateClone);\\n\\t } else { // put in the carnivore menu.\\n\\t \\t$('#meat-spot').append(pizzaTemplateClone);\\n\\t }\\n\\t});\\n\\n\\t$.each(com.dawgpizza.menu.drinks, function() {\\n\\t\\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\\n\\t\\t// populate the clone's fields\\n\\t\\tdrinkDessertTemplateClone.find('.name').html(this.name);\\n\\n\\t\\t// data-type=\\\"\\\" data-name=\\\"\\\" data-qty=\\\"\\\" data-price=\\\"\\\"\\n \\tdrinkDessertTemplateClone.find('button.form-control').attr({\\n \\t\\t\\\"data-type\\\": this.type,\\n \\t\\t\\\"data-name\\\": this.name,\\n \\t\\t\\\"data-price\\\": this.price\\n \\t});\\n\\n\\t\\t$('#drinks').append(drinkDessertTemplateClone);\\n\\t});\\n\\n\\t$.each(com.dawgpizza.menu.desserts, function() {\\n\\t\\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\\n\\t\\t// populate the clone's fields\\n\\t\\tdrinkDessertTemplateClone.find('.name').html(this.name);\\n\\t\\t// data-type=\\\"\\\" data-name=\\\"\\\" data-qty=\\\"\\\" data-price=\\\"\\\"\\n \\tdrinkDessertTemplateClone.find('button.form-control').attr({\\n \\t\\t\\\"data-type\\\": this.type,\\n \\t\\t\\\"data-name\\\": this.name,\\n \\t\\t\\\"data-price\\\": this.price\\n \\t});\\n\\n\\t\\t$('#desserts').append(drinkDessertTemplateClone);\\n\\t});\\n}\",\n \"function initMenu(){\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"clear\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"properties\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"help\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"rename\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"expand\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"fold\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"---\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"duplicate\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"delete\\\");\\n\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 0, myNodeEnableProperties);\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 1, myNodeEnableHelp);\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 3, myNodeEnableBody);\\t\\t\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 4, myNodeEnableBody);\\t\\t\\n}\",\n \"function Estiliza_menu_itens()\\n{\\n //PARA CADA ITEM DO MENU, BASTA CHAMAR A FUNÇÃO ABAIXO, ESPECIFICANDO\\n //SEU INDICE(NUMERO), SUA COR(STRING), SEU CONTEUDO(STRING), SEU LABEL(STRING)\\n //Estiliza_item(Indice, Cor, Conteudo, Texto Lateral);\\n Estiliza_item(0,\\\"blue\\\",\\\"+\\\",\\\"Adicionar\\\");\\n Estiliza_item(1,\\\"red\\\",\\\"Botão\\\");\\n}\",\n \"function gameMenuStartableDrawer() {\\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\\n }\\n }\",\n \"function ciniki_musicfestivals_main() {\\n //\\n // The panel to list the festival\\n //\\n this.menu = new M.panel('Music Festivals', 'ciniki_musicfestivals_main', 'menu', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.menu');\\n this.menu.data = {};\\n this.menu.nplist = [];\\n this.menu.sections = {\\n// 'search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':1,\\n// 'cellClasses':[''],\\n// 'hint':'Search festival',\\n// 'noData':'No festival found',\\n// },\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'festivals',\\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x40); },\\n 'tabs':{\\n 'festivals':{'label':'Festivals', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\\\"festivals\\\");'},\\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\\\"trophies\\\");'},\\n }},\\n 'festivals':{'label':'Festival', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'festivals' ? 'yes' : 'no';},\\n 'noData':'No Festivals',\\n 'addTxt':'Add Festival',\\n 'addFn':'M.ciniki_musicfestivals_main.edit.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',0,null);'\\n },\\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'trophies' ? 'yes' : 'no';},\\n 'noData':'No Trophies',\\n// 'headerValues':['Category', 'Name'],\\n 'addTxt':'Add Trophy',\\n 'addFn':'M.ciniki_musicfestivals_main.trophy.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',0,null);'\\n },\\n }\\n this.menu.liveSearchCb = function(s, i, v) {\\n if( s == 'search' && v != '' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.festivalSearch', {'tnid':M.curTenantID, 'start_needle':v, 'limit':'25'}, function(rsp) {\\n M.ciniki_musicfestivals_main.menu.liveSearchShow('search',null,M.gE(M.ciniki_musicfestivals_main.menu.panelUID + '_' + s), rsp.festivals);\\n });\\n }\\n }\\n this.menu.liveSearchResultValue = function(s, f, i, j, d) {\\n return d.name;\\n }\\n this.menu.liveSearchResultRowFn = function(s, f, i, j, d) {\\n return 'M.ciniki_musicfestivals_main.festival.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',\\\\'' + d.id + '\\\\');';\\n }\\n this.menu.switchTab = function(tab) {\\n if( tab != null ) { this.sections._tabs.selected = tab; }\\n this.open();\\n }\\n this.menu.cellValue = function(s, i, j, d) {\\n if( s == 'festivals' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return d.status_text;\\n }\\n }\\n if( s == 'trophies' ) {\\n switch(j) {\\n case 0: return d.category;\\n case 1: return d.name;\\n }\\n }\\n }\\n this.menu.rowFn = function(s, i, d) {\\n if( s == 'festivals' ) {\\n return 'M.ciniki_musicfestivals_main.festival.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.nplist);';\\n }\\n if( s == 'trophies' ) {\\n return 'M.ciniki_musicfestivals_main.trophy.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.menu.nplist);';\\n }\\n }\\n this.menu.open = function(cb) {\\n if( this.sections._tabs.selected == 'trophies' ) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.menu;\\n p.data = rsp;\\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\\n p.refresh();\\n p.show(cb);\\n });\\n } else {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalList', {'tnid':M.curTenantID}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.menu;\\n p.data = rsp;\\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n }\\n this.menu.addClose('Back');\\n\\n //\\n // The panel to display Festival\\n //\\n this.festival = new M.panel('Festival', 'ciniki_musicfestivals_main', 'festival', 'mc', 'large narrowaside', 'sectioned', 'ciniki.musicfestivals.main.festival');\\n this.festival.data = null;\\n this.festival.festival_id = 0;\\n this.festival.section_id = 0;\\n this.festival.schedulesection_id = 0;\\n this.festival.scheduledivision_id = 0;\\n this.festival.invoice_typestatus = '';\\n this.festival.list_id = 0;\\n this.festival.listsection_id = 0;\\n this.festival.nplists = {};\\n this.festival.nplist = [];\\n this.festival.messages_status = 10;\\n this.festival.city_prov = 'All';\\n this.festival.province = 'All';\\n this.festival.registration_tag = '';\\n this.festival.sections = {\\n '_tabs':{'label':'', 'type':'menutabs', 'selected':'sections', 'tabs':{\\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'sections\\\\');'},\\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'registrations\\\\');'},\\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'schedule\\\\');'},\\n 'videos':{'label':'Videos', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'videos\\\\');',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\\n },\\n 'comments':{'label':'Comments', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'comments\\\\');',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\\n },\\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'competitors\\\\');'},\\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'adjudicators\\\\');'},\\n// 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'files\\\\');'},\\n 'photos':{'label':'Photos', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x04); },\\n 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'photos\\\\');',\\n },\\n// 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'sponsors\\\\');',\\n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\\n// },\\n 'messages':{'label':'Messages', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'messages\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0400); },\\n },\\n// 'sponsors-old':{'label':'Sponsors', \\n// 'visible':function() { \\n// return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \\n// },\\n// 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'sponsors-old\\\\');',\\n// },\\n 'more':{'label':'More...', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'more\\\\');'},\\n }},\\n '_moretabs':{'label':'', 'type':'menutabs', 'selected':'adjudicators', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'more' ? 'yes' : 'no'; },\\n 'tabs':{\\n 'invoices':{'label':'Invoices', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'invoices\\\\');'},\\n 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'adjudicators\\\\');'},\\n 'certificates':{'label':'Certificates', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'certificates\\\\');'},\\n 'lists':{'label':'Lists', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'lists\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x20); },\\n },\\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'emails\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0200); },\\n },\\n 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'files\\\\');'},\\n 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'sponsors\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\\n },\\n/* 'sponsors-old':{'label':'Sponsors', \\n 'visible':function() { \\n return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \\n },\\n 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'sponsors-old\\\\');',\\n }, */\\n }},\\n 'details':{'label':'Details', 'aside':'yes', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\\n 'list':{\\n 'name':{'label':'Name'},\\n 'start_date':{'label':'Start'},\\n 'end_date':{'label':'End'},\\n 'num_registrations':{'label':'# Reg'},\\n }},\\n// '_more':{'label':'', 'aside':'yes', \\n// 'list':{\\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'adjudicators\\\\');'},\\n// }},\\n 'download_buttons':{'label':'', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'buttons':{\\n 'download':{'label':'Download Syllabus (PDF)', \\n 'fn':'M.ciniki_musicfestivals_main.festival.syllabusDownload();',\\n },\\n }},\\n 'syllabus_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'hint':'Search class names',\\n 'noData':'No classes found',\\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\\n },\\n '_stabs':{'label':'', 'type':'paneltabs', 'selected':'sections', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'tabs':{\\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\\\'sections\\\\');'},\\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\\\'categories\\\\');'},\\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\\\'classes\\\\');'},\\n }},\\n 'sections':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'sortable':'yes',\\n 'sortTypes':['text', 'number'],\\n 'headerValues':['Section', 'Registrations'],\\n 'addTxt':'Add Section',\\n 'addFn':'M.ciniki_musicfestivals_main.section.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.section\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n 'editFn':function(s,i,d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.section.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\\n }\\n return '';\\n },\\n },\\n 'si_buttons':{'label':'', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.data.sections.length == 0 ? 'yes' : 'no'; },\\n 'buttons':{\\n 'copy':{'label':'Copy Previous Syllabus, Lists & Settings', \\n 'fn':'M.ciniki_musicfestivals_main.festival.festivalCopy(\\\"previous\\\");',\\n },\\n }},\\n 'categories':{'label':'', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'categories' ? 'yes' : 'no'; },\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'number'],\\n 'headerValues':['Section', 'Category', 'Registrations'],\\n 'addTxt':'Add Category',\\n 'addFn':'M.ciniki_musicfestivals_main.category.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.category\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'classes':{'label':'', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'classes' ? 'yes' : 'no'; },\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'number', 'number'],\\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\\n 'addTxt':'Add Class',\\n 'addFn':'M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.class\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'sections',\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\\n 'tabs':{\\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\\\"sections\\\");'},\\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\\\"teachers\\\");'},\\n 'tags':{'label':'Tags', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\\\"tags\\\");',\\n },\\n }}, \\n 'ipv_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\\n 'visible':function() { return (['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\\n 'tabs':{\\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\\\"all\\\");'},\\n 'inperson':{'label':'Live', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\\\"inperson\\\");'},\\n 'virtual':{'label':'Virtual', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\\\"virtual\\\");'},\\n }}, \\n 'registration_sections':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.section\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_teachers':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'teachers' ? 'yes' : 'no'; },\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.students\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_tags':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'tags' ? 'yes' : 'no'; },\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.registrationtag\\\\',\\\\'' + d.name + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_buttons':{'label':'', 'aside':'yes', \\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\\n 'buttons':{\\n 'excel':{'label':'Export to Excel', \\n 'fn':'M.ciniki_musicfestivals_main.festival.downloadExcel(M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'pdf':{'label':'Registrations PDF ', \\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected=='sections'?'yes':'no';},\\n 'fn':'M.ciniki_musicfestivals_main.festival.downloadPDF(M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n }},\\n 'registration_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\\n 'hint':'Search',\\n 'noData':'No registrations found',\\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\\n },\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':6,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'registrations' ? 'yes' : 'no'; },\\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'altnumber', 'altnumber', 'text'],\\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\\n },\\n 'registrations_emailbutton':{'label':'', \\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations' && M.ciniki_musicfestivals_main.festival.teacher_customer_id > 0 ?'yes':'no';},\\n 'buttons':{\\n 'email':{'label':'Email List to Teacher', 'fn':'M.ciniki_musicfestivals_main.festival.emailTeacherRegistrations();'},\\n 'comments':{'label':'Download Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherComments();'},\\n 'registrations':{'label':'Download Registrations PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherRegistrations();'},\\n }},\\n 'schedule_sections':{'label':'Schedules', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\\n 'cellClasses':['', 'multiline alignright'],\\n 'addTxt':'Unscheduled',\\n 'addFn':'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\\\'unscheduled\\\\',\\\"Unscheduled\\\");',\\n 'changeTxt':'Add Schedule',\\n 'changeFn':'M.ciniki_musicfestivals_main.schedulesection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return null;\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return null;\\n }\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.schedulesection\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n 'editFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return '';\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return '';\\n }\\n return 'M.ciniki_musicfestivals_main.schedulesection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'schedule_divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\\n 'cellClasses':['multiline', 'multiline alignright'],\\n 'addTxt':'Add Division',\\n 'addFn':'M.ciniki_musicfestivals_main.scheduledivision.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return null;\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return null;\\n }\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.scheduledivision\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n 'editFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return '';\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return '';\\n }\\n return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'program_options':{'label':'Download Program', 'aside':'yes',\\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\\n 'fields':{\\n 'ipv':{'label':'Type', 'type':'toggle', 'default':'all', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\\n },\\n }},\\n 'program_buttons':{'label':'', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\\n 'buttons':{\\n 'pdf':{'label':'Download Program PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadProgramPDF();'},\\n }},\\n 'schedule_download':{'label':'Schedule PDF', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\\n 'fields':{\\n 'names':{'label':'Full Names', 'type':'toggle', 'default':'public', 'toggles':{'public':'No', 'private':'Yes'}},\\n 's_titles':{'label':'Titles', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\\n 's_ipv':{'label':'Type', 'type':'toggle', 'default':'all', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\\n },\\n 'footerdate':{'label':'Footer Date', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\\n }},\\n 'schedule_buttons':{'label':'', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\\n 'buttons':{\\n 'pdf':{'label':'Download Schedule PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadSchedulePDF();'},\\n 'certs':{'label':'Certificates PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCertificatesPDF();'},\\n 'comments':{'label':'Adjudicators Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCommentsPDF();'},\\n }},\\n 'schedule_timeslots':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':2, \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\\n 'cellClasses':['label multiline', 'multiline', 'fabuttons'],\\n 'addTxt':'Add Time Slot',\\n 'addFn':'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n },\\n 'timeslot_photos':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\\n 'cellClasses':['multiline', 'thumbnails', 'alignright fabuttons'],\\n },\\n 'timeslot_comments':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':5, \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\\n 'headerValues':['Time', 'Name', '', '', ''],\\n 'headerClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\\n 'cellClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\\n },\\n 'unscheduled_registrations':{'label':'Unscheduled', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id == 'unscheduled' ? 'yes' : 'no'; },\\n 'headerValues':['Class', 'Registrant', 'Status'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text'],\\n 'cellClasses':['', 'multiline', ''],\\n },\\n 'video_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='videos'?'yes':'no';},\\n 'hint':'Search',\\n 'noData':'No registrations found',\\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status'],\\n 'cellClasses':['', '', '', '', ''],\\n },\\n 'videos':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'videos' ? 'yes' : 'no'; },\\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status', ''],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'text', 'altnumber', ''],\\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\\n// 'addTxt':'Add Registration',\\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n },\\n 'competitor_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'cities',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\\n 'tabs':{\\n 'cities':{'label':'Cities', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\\\"cities\\\");'},\\n 'provinces':{'label':'Provinces', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\\\"provinces\\\");'},\\n }}, \\n 'competitor_cities':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'cities' ? 'yes' : 'no'; },\\n 'editFn':function(s, i, d) {\\n if( d.city != null && d.province != null ) {\\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + escape(d.city) + '\\\\',\\\\'' + escape(d.province) + '\\\\');';\\n }\\n return '';\\n },\\n },\\n 'competitor_provinces':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'provinces' ? 'yes' : 'no'; },\\n 'editFn':function(s, i, d) {\\n if( d.province != null ) {\\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',null,\\\\'' + escape(d.province) + '\\\\');';\\n }\\n return '';\\n },\\n },\\n 'competitors':{'label':'', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\\n 'headerValues':['Name', 'Classes', 'Waiver'],\\n },\\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\\n 'addTxt':'Add List',\\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'editFn':function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'listsections':{'label':'Sections', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.list_id > 0) ? 'yes' : 'no'; },\\n 'addTxt':'Add Section',\\n 'addFn':'M.ciniki_musicfestivals_main.listsection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.list_id,null);',\\n 'editFn':function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.listsection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.list_id,null);';\\n },\\n },\\n 'listentries':{'label':'Sections', 'type':'simplegrid', 'num_cols':4, \\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.listsection_id > 0) ? 'yes' : 'no'; },\\n 'headerValues':['Award', 'Amount', 'Donor', 'Winner'],\\n 'addTxt':'Add Entry',\\n 'addFn':'M.ciniki_musicfestivals_main.listentry.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.listsection_id,null);',\\n 'seqDrop':function(e,from,to) {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, \\n 'action':'listentrysequenceupdate',\\n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\\n 'lists':'yes',\\n 'list_id':M.ciniki_musicfestivals_main.festival.list_id,\\n 'listsection_id':M.ciniki_musicfestivals_main.festival.listsection_id,\\n 'entry_id':M.ciniki_musicfestivals_main.festival.data.listentries[from].id, \\n 'sequence':M.ciniki_musicfestivals_main.festival.data.listentries[to].sequence, \\n }, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.festival;\\n p.data.listentries = rsp.festival.listentries;\\n p.refreshSection(\\\"listentries\\\");\\n });\\n },\\n },\\n 'invoice_statuses':{'label':'Status', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\\n },\\n 'invoices':{'label':'Invoices', 'type':'simplegrid', 'num_cols':6,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\\n 'headerValues':['#', 'Customer', 'Students', 'Total', 'Status'],\\n 'noData':'No invoices',\\n 'sortable':'yes',\\n 'sortTypes':['number', 'text', 'text', 'number', 'text', ''],\\n },\\n 'adjudicators':{'label':'', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'adjudicators'); },\\n 'addTxt':'Add Adjudicator',\\n 'addFn':'M.ciniki_musicfestivals_main.adjudicator.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n },\\n 'files':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'files'); },\\n 'addTxt':'Add File',\\n 'addFn':'M.ciniki_musicfestivals_main.addfile.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'certificates':{'label':'', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'certificates'); },\\n 'headerValues':['Name', 'Section', 'Min Score'],\\n 'addTxt':'Add Certificate',\\n 'addFn':'M.ciniki_musicfestivals_main.certificate.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\\n 'addTxt':'Add List',\\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'editFn':function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'message_statuses':{'label':'', 'type':'simplegrid', 'aside':'yes', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\\n },\\n 'message_buttons':{'label':'', 'aside':'yes', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\\n 'buttons':{\\n 'add':{'label':'Add Message', 'fn':'M.ciniki_musicfestivals_main.message.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id);'},\\n }},\\n 'messages':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\\n 'headerValues':['Subject', 'Date'],\\n 'noData':'No Messages',\\n },\\n 'emails_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\\n 'tabs':{\\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\\\"all\\\");'},\\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\\\"teachers\\\");'},\\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\\\"competitors\\\");'},\\n }}, \\n 'emails_sections':{'label':'Sections', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\\n },\\n 'emails_html':{'label':'Emails', 'type':'html', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\\n },\\n 'sponsors':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors'); },\\n 'headerValues':['Name', 'Level'],\\n 'addTxt':'Add Sponsor',\\n 'addFn':'M.ciniki_musicfestivals_main.sponsor.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'sponsors-old':{'label':'', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors-old'); },\\n 'addTxt':'Manage Sponsors',\\n 'addFn':'M.startApp(\\\\'ciniki.sponsors.ref\\\\',null,\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'mc\\\\',{\\\\'object\\\\':\\\\'ciniki.musicfestivals.festival\\\\',\\\\'object_id\\\\':M.ciniki_musicfestivals_main.festival.festival_id});',\\n },\\n }\\n this.festival.isSelected = function(t, m) {\\n if( this.sections._tabs.selected == t ) {\\n if( t == 'more' ) {\\n return this.sections._moretabs.selected == m ? 'yes' : 'no';\\n }\\n return 'yes';\\n }\\n return 'no';\\n }\\n this.festival.sectionData = function(s) {\\n if( s == 'videos' ) {\\n return this.data.registrations;\\n }\\n return M.panel.prototype.sectionData.call(this, s);\\n }\\n this.festival.downloadProgramPDF = function() {\\n var args = {\\n 'tnid':M.curTenantID, \\n 'festival_id':this.festival_id, \\n 'ipv':this.formValue('ipv'),\\n };\\n M.api.openPDF('ciniki.musicfestivals.programPDF',args);\\n }\\n this.festival.downloadSchedulePDF = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'schedulesection_id':this.schedulesection_id,\\n 'names':this.formValue('names'),\\n 'ipv':this.formValue('s_ipv'),\\n 'titles':this.formValue('s_titles'),\\n 'footerdate':this.formValue('footerdate'),\\n };\\n M.api.openPDF('ciniki.musicfestivals.schedulePDF',args);\\n }\\n this.festival.downloadCertificatesPDF = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'schedulesection_id':this.schedulesection_id,\\n 'ipv':this.formValue('s_ipv'),\\n };\\n M.api.openFile('ciniki.musicfestivals.certificatesPDF',args);\\n }\\n this.festival.downloadCommentsPDF = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'schedulesection_id':this.schedulesection_id,\\n 'ipv':this.formValue('s_ipv'),\\n };\\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\\n }\\n this.festival.downloadTeacherComments = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'teacher_customer_id':this.teacher_customer_id,\\n };\\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\\n }\\n this.festival.downloadTeacherRegistrations = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'teacher_customer_id':this.teacher_customer_id,\\n };\\n M.api.openPDF('ciniki.musicfestivals.teacherRegistrationsPDF',args);\\n }\\n this.festival.listLabel = function(s, i, d) { \\n if( s == 'details' ) {\\n return d.label; \\n }\\n return '';\\n }\\n this.festival.listValue = function(s, i, d) { \\n if( s == 'details' ) {\\n return this.data[i]; \\n }\\n if( s == '_more' ) {\\n return d.label;\\n }\\n }\\n this.festival.fieldValue = function(s, i, d) { \\n if( this.data[i] == null ) { return ''; }\\n return this.data[i]; \\n }\\n this.festival.liveSearchCb = function(s, i, v) {\\n if( s == 'syllabus_search' && v != '' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.syllabusSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.classes);\\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\\n }\\n });\\n }\\n if( (s == 'registration_search' || s == 'video_search') && v != '' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.registrationSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.registrations);\\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\\n }\\n });\\n }\\n }\\n this.festival.liveSearchResultValue = function(s, f, i, j, d) {\\n if( s == 'syllabus_search' ) { \\n return this.cellValue(s, i, j, d);\\n }\\n if( s == 'registration_search' ) { \\n return this.cellValue(s, i, j, d);\\n/* switch(j) {\\n case 0: return d.class_code;\\n case 1: return d.display_name;\\n case 2: return d.teacher_name;\\n case 3: return '$' + d.fee;\\n case 4: return d.status_text;\\n } */\\n }\\n if( s == 'video_search' ) { \\n switch(j) {\\n case 0: return d.class_code;\\n case 1: return d.display_name;\\n case 2: return M.hyperlink(d.video_url1);\\n case 3: return d.music_orgfilename;\\n case 4: return d.status_text;\\n }\\n }\\n }\\n this.festival.liveSearchResultRowFn = function(s, f, i, j, d) {\\n if( s == 'syllabus_search' ) { \\n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.festival.reopen();\\\\',\\\\'' + d.id + '\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\\n }\\n if( s == 'registration_search' || s == 'video_search' ) { \\n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.reopen();\\\\',\\\\'' + d.id + '\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\\\'festival\\\\');';\\n }\\n }\\n this.festival.cellValue = function(s, i, j, d) {\\n if( s == 'sections' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return (d.num_registrations!=0 ? d.num_registrations : '');\\n }\\n }\\n if( s == 'categories' ) {\\n switch(j) {\\n case 0: return d.section_name;\\n case 1: return d.name;\\n case 2: return (d.num_registrations!=0 ? d.num_registrations : '');\\n }\\n }\\n if( s == 'classes' || s == 'syllabus_search' ) {\\n switch(j) {\\n case 0: return d.section_name;\\n case 1: return d.category_name;\\n case 2: return d.code + ' - ' + d.name;\\n case 3: return d.earlybird_fee + '/' + d.fee;\\n case 4: return (d.num_registrations!=0 ? d.num_registrations : '');\\n }\\n }\\n if( s == 'unscheduled_registrations' ) {\\n switch (j) {\\n case 0: return d.class_code;\\n case 1: return '' + d.display_name + '' + d.title1 + '';\\n case 2: return d.status_text;\\n }\\n }\\n if( s == 'registrations' || s == 'registration_search' ) {\\n switch (j) {\\n case 0: return d.class_code;\\n case 1: return '' + d.display_name + '' + d.title1 + '';\\n case 2: return d.teacher_name;\\n case 3: return '$' + d.fee;\\n case 4: return d.status_text;\\n }\\n if( j == 5 && (this.data.flags&0x10) == 0x10 ) {\\n return (d.participation == 2 ? 'Plus' : '');\\n } else if( j == 5 && (this.data.flags&0x02) == 0x02 ) {\\n return (d.participation == 2 ? 'Virtual' : 'In Person');\\n }\\n }\\n if( s == 'registration_sections' || s == 'emails_sections' ) {\\n return M.textCount(d.name, d.num_registrations);\\n }\\n if( s == 'registration_teachers' ) {\\n return M.textCount(d.display_name, d.num_registrations);\\n }\\n if( s == 'registration_tags' ) {\\n return M.textCount(d.name, d.num_registrations);\\n }\\n if( s == 'schedule_sections' ) {\\n switch(j) {\\n case 0: return d.name;\\n// case 1: return '';\\n }\\n }\\n if( s == 'adjudicators' ) {\\n return d.name;\\n }\\n if( s == 'certificates' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return d.section_name;\\n case 2: return d.min_score;\\n }\\n }\\n if( s == 'files' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return (d.webflags&0x01) == 0x01 ? 'Visible' : 'Hidden';\\n }\\n }\\n if( s == 'message_statuses' ) {\\n return M.textCount(d.label, d.num_messages);\\n }\\n if( s == 'messages' ) {\\n switch(j) {\\n case 0: return d.subject;\\n case 1: return d.date_text;\\n }\\n }\\n if( s == 'lists' ) {\\n switch(j) { \\n case 0: return d.name;\\n }\\n }\\n if( s == 'listsections' ) {\\n switch(j) { \\n case 0: return d.name;\\n }\\n }\\n if( s == 'listentries' ) {\\n switch(j) { \\n case 0: return d.award;\\n case 1: return d.amount;\\n case 2: return d.donor;\\n case 3: return d.winner;\\n }\\n }\\n if( s == 'sponsors' ) {\\n switch(j) { \\n case 0: return d.name;\\n case 1: return d.level;\\n }\\n }\\n if( s == 'sponsors-old' && j == 0 ) {\\n return '' + d.sponsor.title + '';\\n }\\n }\\n this.festival.cellSortValue = function(s, i , j, d) {\\n if( s == 'registrations' ) {\\n switch(j) {\\n case 3: return d.fee;\\n case 4: return d.status;\\n }\\n }\\n if( s == 'videos' ) {\\n switch(j) {\\n case 4: return d.status;\\n }\\n }\\n return '';\\n }\\n this.festival.rowFn = function(s, i, d) {\\n switch(s) {\\n// case 'sections': return 'M.ciniki_musicfestivals_main.section.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\\n case 'sections': return 'M.ciniki_musicfestivals_main.classes.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\\n case 'categories': return 'M.ciniki_musicfestivals_main.category.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',\\\\'' + d.section_id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.categories);';\\n case 'classes': return 'M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\\n case 'unscheduled_registrations': \\n case 'registrations': \\n case 'videos':\\n return 'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\\\'festival\\\\');';\\n case 'registration_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'emails_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'registration_teachers': return 'M.ciniki_musicfestivals_main.festival.openTeacher(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.display_name) + '\\\");';\\n case 'registration_tags': return 'M.ciniki_musicfestivals_main.festival.openTag(\\\\'' + M.eU(d.name) + '\\\\',\\\"' + M.eU(d.display_name) + '\\\");';\\n case 'schedule_sections': return 'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.festival.openScheduleDivision(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n// case 'schedule_sections': return 'M.ciniki_musicfestivals_main.schedulesection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n// case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n case 'schedule_timeslots': return 'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n case 'timeslot_comments': return 'M.ciniki_musicfestivals_main.timeslotcomments.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n case 'timeslot_photos': return null;\\n case 'competitor_cities': return 'M.ciniki_musicfestivals_main.festival.openCompetitorCity(\\\\'' + escape(d.name) + '\\\\');';\\n case 'competitor_provinces': return 'M.ciniki_musicfestivals_main.festival.openCompetitorProv(\\\\'' + escape(d.name) + '\\\\');';\\n case 'competitors': return 'M.ciniki_musicfestivals_main.competitor.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id);';\\n case 'invoice_statuses': return 'M.ciniki_musicfestivals_main.festival.openInvoiceStatus(\\\\'' + d.typestatus + '\\\\');';\\n case 'invoices': return 'M.startApp(\\\\'ciniki.sapos.invoice\\\\',null,\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'mc\\\\',{\\\\'invoice_id\\\\':\\\\'' + d.id + '\\\\'});';\\n case 'adjudicators': return 'M.ciniki_musicfestivals_main.adjudicator.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.adjudicators);';\\n case 'certificates': return 'M.ciniki_musicfestivals_main.certificate.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'files': return 'M.ciniki_musicfestivals_main.editfile.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'message_statuses': return 'M.ciniki_musicfestivals_main.festival.openMessageStatus(' + d.status + ');';\\n case 'messages': return 'M.ciniki_musicfestivals_main.message.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'lists': return 'M.ciniki_musicfestivals_main.festival.openList(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'listsections': return 'M.ciniki_musicfestivals_main.festival.openListSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'listentries': return 'M.ciniki_musicfestivals_main.listentry.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'sponsors': return 'M.ciniki_musicfestivals_main.sponsor.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'sponsors-old': return 'M.startApp(\\\\'ciniki.sponsors.ref\\\\',null,\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'mc\\\\',{\\\\'ref_id\\\\':\\\\'' + d.sponsor.ref_id + '\\\\'});';\\n }\\n return '';\\n }\\n this.festival.rowClass = function(s, i, d) {\\n if( s == 'competitor_cities' && this.city_prov == d.name ) {\\n return 'highlight';\\n }\\n if( s == 'competitor_provinces' && this.province == d.name ) {\\n return 'highlight';\\n }\\n if( s == 'schedule_sections' && this.schedulesection_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'schedule_divisions' && this.scheduledivision_id == d.id ) {\\n return 'highlight';\\n }\\n if( (s == 'registration_sections' || s == 'emails_sections') && this.section_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'registration_teachers' && this.teacher_customer_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'registration_tags' && this.registration_tag == d.name ) {\\n return 'highlight';\\n }\\n if( s == 'lists' && this.list_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'listsections' && this.listsection_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'message_statuses' && this.messages_status == d.status ) {\\n return 'highlight';\\n }\\n if( s == 'invoice_statuses' && this.invoice_typestatus == d.typestatus ) {\\n return 'highlight';\\n }\\n if( s == 'invoices' && this.invoice_typestatus == '' && s == 'invoices' ) {\\n switch(d.status) { \\n case '10': return 'statusorange';\\n case '15': return 'statusorange';\\n case '40': return 'statusorange';\\n case '42': return 'statusred';\\n case '50': return 'statusgreen';\\n case '55': return 'statusorange';\\n case '60': return 'statusgrey';\\n case '65': return 'statusgrey';\\n }\\n }\\n }\\n this.festival.switchTab = function(tab, stab) {\\n if( tab != null ) { this.sections._tabs.selected = tab; }\\n if( stab != null ) { this.sections._stabs.selected = stab; }\\n this.open();\\n }\\n this.festival.switchMTab = function(t) {\\n this.sections._moretabs.selected = t;\\n this.open();\\n }\\n this.festival.switchRegTab = function(t) {\\n this.sections.registration_tabs.selected = t;\\n this.open();\\n }\\n this.festival.switchCompTab = function(t) {\\n this.sections.competitor_tabs.selected = t;\\n this.open();\\n }\\n this.festival.switchLVTab = function(t) {\\n this.sections.ipv_tabs.selected = t;\\n this.open();\\n }\\n this.festival.switchEmailsTab = function(t) {\\n this.sections.emails_tabs.selected = t;\\n this.open();\\n }\\n this.festival.emailTeacherRegistrations = function() {\\n M.ciniki_musicfestivals_main.emailregistrations.open('M.ciniki_musicfestivals_main.festival.show();');\\n }\\n this.festival.openSection = function(id,n) {\\n this.lastY = 0;\\n this.section_id = id;\\n this.teacher_customer_id = 0;\\n this.registration_tag = '';\\n if( id > 0 ) {\\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\\n// this.sections.emails_list.label = 'Emails - ' + M.dU(n);\\n this.sections.emails_html.label = 'Emails - ' + M.dU(n);\\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\\n } else {\\n this.sections.registrations.label = 'Registrations';\\n// this.sections.emails_list.label = 'Emails';\\n this.sections.emails_html.label = 'Emails';\\n this.sections.videos.label = 'Registrations';\\n }\\n this.open();\\n }\\n this.festival.openTeacher = function(id,n) {\\n this.lastY = 0;\\n this.teacher_customer_id = id;\\n this.section_id = 0;\\n this.registration_tag = '';\\n if( id > 0 ) {\\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\\n } else {\\n this.sections.registrations.label = 'Registrations';\\n this.sections.videos.label = 'Registrations';\\n }\\n this.open();\\n }\\n this.festival.openTag = function(name, n) {\\n this.lastY = 0;\\n this.section_id = 0;\\n this.teacher_customer_id = 0;\\n this.registration_tag = unescape(name);\\n if( name != '' ) {\\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\\n } else {\\n this.sections.registrations.label = 'Registrations';\\n this.sections.videos.label = 'Registrations';\\n }\\n this.open();\\n \\n }\\n this.festival.openScheduleSection = function(i, n) {\\n this.schedulesection_id = i;\\n this.sections.schedule_divisions.label = M.dU(n);\\n this.scheduledivision_id = 0;\\n this.open();\\n }\\n this.festival.openScheduleDivision = function(i, n) {\\n this.lastY = 0;\\n this.scheduledivision_id = i;\\n this.sections.schedule_timeslots.label = M.dU(n);\\n this.open();\\n }\\n this.festival.openList = function(i, n) {\\n this.list_id = i;\\n this.sections.listsections.label = M.dU(n);\\n this.scheduledivision_id = 0;\\n this.open();\\n }\\n this.festival.openListSection = function(i, n) {\\n this.lastY = 0;\\n this.listsection_id = i;\\n this.sections.listentries.label = M.dU(n);\\n this.open();\\n }\\n this.festival.downloadExcel = function(fid) {\\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\\n } else if( this.sections.registration_tabs.selected == 'teachers' && this.teacher_customer_id > 0 ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'teacher_customer_id':this.teacher_customer_id});\\n } else if( this.sections.registration_tabs.selected == 'tags' && this.registration_tag != '' ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'registration_tag':this.registration_tag});\\n } else {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid});\\n }\\n }\\n this.festival.downloadPDF = function(fid) {\\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\\n } else {\\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid});\\n }\\n }\\n this.festival.openInvoiceStatus = function(s) {\\n this.lastY = 0;\\n this.invoice_typestatus = s;\\n this.open();\\n }\\n this.festival.invoiceTransaction = function(i, t) {\\n M.startApp('ciniki.sapos.invoice', null, 'M.ciniki_musicfestivals_main.festival.open();', 'mc', {'invoice_id':i, 'transaction_amount':t});\\n }\\n this.festival.openCompetitorCity = function(c) {\\n this.lastY = 0;\\n this.city_prov = unescape(c);\\n this.open();\\n }\\n this.festival.openCompetitorProv = function(c) {\\n this.lastY = 0;\\n this.province = unescape(c);\\n this.open();\\n }\\n this.festival.openMessageStatus = function(s) {\\n this.messages_status = s;\\n this.open();\\n }\\n this.festival.reopen = function(cb,fid,list) {\\n if( this.sections._tabs.selected == 'sections' ) {\\n if( M.gE(this.panelUID + '_syllabus_search').value != '' ) {\\n this.sections.syllabus_search.lastsearch = M.gE(this.panelUID + '_syllabus_search').value;\\n }\\n }\\n if( this.sections._tabs.selected == 'registrations' ) {\\n if( M.gE(this.panelUID + '_registration_search').value != '' ) {\\n this.sections.registration_search.lastsearch = M.gE(this.panelUID + '_registration_search').value;\\n }\\n }\\n this.open(cb,fid,list);\\n }\\n this.festival.open = function(cb, fid, list) {\\n if( fid != null ) { this.festival_id = fid; }\\n var args = {'tnid':M.curTenantID, 'festival_id':this.festival_id};\\n this.size = 'xlarge narrowaside';\\n if( this.sections._tabs.selected == 'sections' ) {\\n if( this.sections._stabs.selected == 'sections' ) {\\n args['sections'] = 'yes';\\n } else if( this.sections._stabs.selected == 'categories' ) {\\n args['categories'] = 'yes';\\n } else if( this.sections._stabs.selected == 'classes' ) {\\n args['classes'] = 'yes';\\n }\\n } else if( this.sections._tabs.selected == 'registrations' || this.sections._tabs.selected == 'videos' ) {\\n this.size = 'xlarge narrowaside';\\n args['sections'] = 'yes';\\n args['registrations'] = 'yes';\\n args['ipv'] = this.sections.ipv_tabs.selected;\\n\\n } else if( this.sections._tabs.selected == 'schedule' ) {\\n this.size = 'medium mediumaside';\\n args['schedule'] = 'yes';\\n args['ssection_id'] = this.schedulesection_id;\\n args['sdivision_id'] = this.scheduledivision_id;\\n this.sections.schedule_sections.changeTxt = 'Add Schedule';\\n this.sections.schedule_sections.addTxt = 'Unscheduled';\\n this.sections.schedule_divisions.addTxt = 'Add Division';\\n } else if( this.sections._tabs.selected == 'comments' ) {\\n this.size = 'xlarge narrowaside';\\n args['schedule'] = 'yes';\\n args['comments'] = 'yes';\\n args['ssection_id'] = this.schedulesection_id;\\n args['sdivision_id'] = this.scheduledivision_id;\\n args['adjudicators'] = 'yes';\\n this.sections.schedule_sections.addTxt = '';\\n this.sections.schedule_sections.changeTxt = '';\\n this.sections.schedule_divisions.addTxt = '';\\n } else if( this.sections._tabs.selected == 'competitors' ) {\\n this.size = 'xlarge narrowaside';\\n args['competitors'] = 'yes';\\n if( this.sections.competitor_tabs.selected == 'cities' ) {\\n args['city_prov'] = M.eU(this.city_prov);\\n } else if( this.sections.competitor_tabs.selected == 'provinces' ) {\\n args['province'] = M.eU(this.province);\\n } \\n } else if( this.sections._tabs.selected == 'photos' ) {\\n this.size = 'xlarge narrowaside';\\n args['schedule'] = 'yes';\\n args['photos'] = 'yes';\\n args['ssection_id'] = this.schedulesection_id;\\n args['sdivision_id'] = this.scheduledivision_id;\\n args['adjudicators'] = 'no';\\n this.sections.schedule_sections.addTxt = '';\\n this.sections.schedule_sections.changeTxt = '';\\n this.sections.schedule_divisions.addTxt = '';\\n this.sections.schedule_divisions.changeTxt = '';\\n } else if( this.isSelected('more', 'lists') == 'yes' ) {\\n args['lists'] = 'yes';\\n args['list_id'] = this.list_id;\\n args['listsection_id'] = this.listsection_id;\\n } else if( this.isSelected('more', 'invoices') == 'yes' ) {\\n this.size = 'xlarge narrowaside';\\n args['invoices'] = 'yes';\\n if( this.invoice_typestatus > 0 ) {\\n args['invoice_typestatus'] = this.invoice_typestatus;\\n }\\n } else if( this.isSelected('more', 'adjudicators') == 'yes' ) {\\n this.size = 'xlarge';\\n args['adjudicators'] = 'yes';\\n } else if( this.isSelected('more', 'files') == 'yes' ) {\\n this.size = 'xlarge';\\n args['files'] = 'yes';\\n } else if( this.isSelected('more', 'certificates') == 'yes' ) {\\n this.size = 'xlarge';\\n args['certificates'] = 'yes';\\n } else if( this.sections._tabs.selected == 'messages' ) {\\n args['messages'] = 'yes';\\n // Which emails to get\\n args['messages_status'] = this.messages_status;\\n this.sections.messages.headerValues[1] = 'Date';\\n if( this.messages_status == 30 ) {\\n this.sections.messages.headerValues[1] = 'Scheduled';\\n } else if( this.messages_status == 50 ) {\\n this.sections.messages.headerValues[1] = 'Sent';\\n }\\n } else if( this.isSelected('more', 'emails') == 'yes' ) {\\n args['sections'] = 'yes';\\n // Which emails to get\\n args['emails_list'] = this.sections.emails_tabs.selected;\\n } else if( this.isSelected('more', 'sponsors') == 'yes' ) {\\n //} else if( this.sections._tabs.selected == 'sponsors' ) {\\n this.size = 'xlarge';\\n args['sponsors'] = 'yes';\\n } else if( this.isSelected('more', 'sponsors-old') == 'yes' ) {\\n args['sponsors'] = 'yes';\\n }\\n if( this.section_id > 0 ) {\\n args['section_id'] = this.section_id;\\n }\\n if( this.teacher_customer_id > 0 ) {\\n args['teacher_customer_id'] = this.teacher_customer_id;\\n }\\n if( this.registration_tag != '' ) {\\n args['registration_tag'] = this.registration_tag;\\n }\\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', args, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.festival;\\n p.data = rsp.festival;\\n p.label = rsp.festival.name;\\n p.sections.registration_search.livesearchcols = 5;\\n p.sections.registrations.num_cols = 5;\\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status'];\\n if( (rsp.festival.flags&0x10) == 0x10 ) {\\n p.sections.registration_search.livesearchcols = 6;\\n p.sections.registrations.num_cols = 6;\\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Plus'];\\n } else if( (rsp.festival.flags&0x02) == 0x02 ) {\\n p.sections.registration_search.livesearchcols = 6;\\n p.sections.registrations.num_cols = 6;\\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'];\\n }\\n p.sections.timeslot_comments.headerValues[2] = '';\\n p.sections.timeslot_comments.headerValues[3] = '';\\n p.sections.timeslot_comments.headerValues[4] = '';\\n if( rsp.festival.sections != null ) {\\n p.data.registration_sections = [];\\n p.data.emails_sections = [];\\n p.data.registration_sections.push({'id':0, 'name':'All'});\\n p.data.emails_sections.push({'id':0, 'name':'All'});\\n for(var i in rsp.festival.sections) {\\n// p.data.registration_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\\n p.data.registration_sections.push(rsp.festival.sections[i]);\\n p.data.emails_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\\n }\\n// p.data.registration_sections = rsp.festival.sections;\\n }\\n if( rsp.festival.schedule_sections != null ) {\\n for(var i in rsp.festival.schedule_sections) {\\n if( p.schedulesection_id > 0 && rsp.festival.schedule_sections[i].id == p.schedulesection_id ) {\\n if( rsp.festival.schedule_sections[i].adjudicator1_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id] != null ) {\\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id].name;\\n }\\n if( rsp.festival.schedule_sections[i].adjudicator2_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id] != null ) {\\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id].name;\\n }\\n if( rsp.festival.schedule_sections[i].adjudicator3_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id] != null ) {\\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id].name;\\n }\\n }\\n }\\n }\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.refresh();\\n p.show(cb);\\n // \\n // Auto remember last search\\n //\\n if( p.sections['syllabus_search'].lastsearch != null \\n && p.sections['syllabus_search'].lastsearch != '' \\n ) {\\n M.gE(p.panelUID + '_syllabus_search').value = p.sections['syllabus_search'].lastsearch;\\n var t = M.gE(p.panelUID + '_syllabus_search_livesearch_grid');\\n t.style.display = 'table';\\n p.liveSearchCb('syllabus_search', null, p.sections['syllabus_search'].lastsearch);\\n delete p.sections['syllabus_search'].lastsearch;\\n }\\n else if( p.sections['registration_search'].lastsearch != null \\n && p.sections['registration_search'].lastsearch != '' \\n ) {\\n M.gE(p.panelUID + '_registration_search').value = p.sections['registration_search'].lastsearch;\\n var t = M.gE(p.panelUID + '_registration_search_livesearch_grid');\\n t.style.display = 'table';\\n p.liveSearchCb('registration_search', null, p.sections['registration_search'].lastsearch);\\n delete p.sections['registration_search'].lastsearch;\\n }\\n });\\n }\\n this.festival.timeslotImageAdd = function(tid, row) {\\n this.timeslot_image_uploader_tid = tid;\\n this.timeslot_image_uploader_row = row;\\n this.image_uploader = M.aE('input', this.panelUID + '_' + tid + '_upload', 'file_uploader');\\n this.image_uploader.setAttribute('name', tid);\\n this.image_uploader.setAttribute('type', 'file');\\n this.image_uploader.setAttribute('onchange', 'M.ciniki_musicfestivals_main.festival.timeslotImageUpload();');\\n this.image_uploader.click();\\n }\\n this.festival.timeslotImageUpload = function() {\\n var files = this.image_uploader.files;\\n M.startLoad();\\n M.api.postJSONFile('ciniki.musicfestivals.timeslotImageDrop', {'tnid':M.curTenantID, 'festival_id':this.festival_id, \\n 'timeslot_id':this.timeslot_image_uploader_tid},\\n files[0],\\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.stopLoad();\\n M.api.err(rsp);\\n return false;\\n }\\n M.stopLoad();\\n var p = M.ciniki_musicfestivals_main.festival;\\n var t = M.gE(p.panelUID + '_timeslot_photos_grid');\\n var cell = t.children[0].children[p.timeslot_image_uploader_row].children[1];\\n cell.innerHTML += '';\\n });\\n }\\n this.festival.festivalCopy = function(old_fid) {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalCopy', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'old_festival_id':old_fid}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.festival.open();\\n });\\n }\\n this.festival.syllabusDownload = function() {\\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id});\\n }\\n this.festival.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.festival.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');';\\n }\\n return null;\\n }\\n this.festival.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');';\\n }\\n return null;\\n }\\n this.festival.addButton('edit', 'Edit', 'M.ciniki_musicfestivals_main.edit.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id);');\\n this.festival.addClose('Back');\\n this.festival.addButton('next', 'Next');\\n this.festival.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Festival\\n //\\n this.edit = new M.panel('Festival', 'ciniki_musicfestivals_main', 'edit', 'mc', 'large mediumaside', 'sectioned', 'ciniki.musicfestivals.main.edit');\\n this.edit.data = null;\\n this.edit.festival_id = 0;\\n this.edit.nplist = [];\\n this.edit.sections = {\\n/* '_document_logo_id':{'label':'Document Header Logo', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'header_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue('header_logo_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }}, */\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'name':{'label':'Name', 'type':'text'},\\n 'start_date':{'label':'Start', 'type':'date'},\\n 'end_date':{'label':'End', 'type':'date'},\\n 'status':{'label':'Status', 'type':'toggle', 'toggles':{'10':'Active', '30':'Current', '60':'Archived'}},\\n 'flags1':{'label':'Registrations Open', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags'},\\n 'flags2':{'label':'Virtual Option', 'type':'flagtoggle', 'default':'off', 'bit':0x02, 'field':'flags',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x4000); },\\n 'on_fields':['flags3','virtual_date', 'upload_end_dt'],\\n },\\n 'flags3':{'label':'Virtual Pricing', 'type':'flagtoggle', 'default':'off', 'bit':0x04, 'field':'flags', 'visible':'no'},\\n 'flags4':{'label':'Section End Dates', 'type':'flagtoggle', 'default':'off', 'bit':0x08, 'field':'flags'},\\n 'flags5':{'label':'Adjudication Plus', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\\n },\\n 'earlybird_date':{'label':'Earlybird Deadline', 'type':'datetime'},\\n 'live_date':{'label':'Live Deadline', 'type':'datetime'},\\n 'virtual_date':{'label':'Virtual Deadline', 'type':'datetime', 'visible':'no'},\\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime'},\\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime', 'visible':'no'},\\n }},\\n '_settings':{'label':'', 'aside':'yes', 'fields':{\\n 'age-restriction-msg':{'label':'Age Restriction Message', 'type':'text'},\\n 'president-name':{'label':'President Name', 'type':'text'},\\n }},\\n// Remove 2022, could be readded in future\\n// '_hybrid':{'label':'In Person/Virtual Choices', 'aside':'yes', 'fields':{\\n// 'inperson-choice-msg':{'label':'In Person Choice', 'type':'text', 'hint':'in person on a scheduled date'},\\n// 'virtual-choice-msg':{'label':'Virtual Choice', 'type':'text', 'hint':'virtually and submit a video'},\\n// }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'documents', 'tabs':{\\n// 'website':{'label':'Website', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\\\'website\\\\');'},\\n 'documents':{'label':'Documents', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\\\'documents\\\\');'},\\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\\\'registrations\\\\');'},\\n }},\\n '_primary_image_id':{'label':'Primary Image', 'type':'imageform', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue('primary_image_id', iid, null, null);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }},\\n '_description':{'label':'Description', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_document_logo_id':{'label':'Document Image', 'type':'imageform',\\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'document_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue('document_logo_id', iid, null, null);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }},\\n '_document_header_msg':{'label':'Header Message', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'document_header_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_document_footer_msg':{'label':'Footer Message', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'document_footer_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_comments_pdf':{'label':'Comments PDF Options', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'flags6':{'label':'Header Adjudicator Name', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\\n 'flags7':{'label':'Timeslot Date/Time', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\\n 'comments_grade_label':{'label':'Grade Label', 'default':'Mark', 'type':'text'},\\n 'comments_footer_msg':{'label':'Footer Message', 'type':'text'},\\n }},\\n '_certificates_pdf':{'label':'Certificates PDF Options', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'flags8':{'label':'Include Pronouns', 'type':'flagtoggle', 'default':'off', 'bit':0x80, 'field':'flags'},\\n }},\\n '_syllabus':{'label':'Syllabus Options', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'flags5':{'label':'Include Section/Category as Class Name', 'type':'flagtoggle', 'default':'off', 'bit':0x0100, 'field':'flags'},\\n }},\\n '_registration_parent_msg':{'label':'Registration Form', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'registration-parent-msg':{'label':'Parents Intro', 'type':'textarea', 'size':'medium'},\\n 'registration-teacher-msg':{'label':'Teachers Intro', 'type':'textarea', 'size':'medium'},\\n 'registration-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\\n }},\\n '_competitor_parent_msg':{'label':'Individual Competitor Form', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'competitor-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-individual-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\\n }},\\n }},\\n '_competitor_group_parent_msg':{'label':'Group/Ensemble Competitor Form', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'competitor-group-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-group-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-group-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-group-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\\n }},\\n }},\\n '_waiver':{'label':'Waiver Message', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'waiver-title':{'label':'Title', 'type':'text'},\\n 'waiver-msg':{'label':'Message', 'type':'textarea', 'size':'medium'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\\n 'updatename':{'label':'Update Public Names', \\n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.edit.updateNames();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\\n }},\\n };\\n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.edit.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.festivalHistory', 'args':{'tnid':M.curTenantID, 'festival_id':this.festival_id, 'field':i}};\\n }\\n this.edit.switchTab = function(tab) {\\n this.sections._tabs.selected = tab;\\n this.showHideSection('_primary_image_id');\\n this.showHideSection('_description');\\n this.showHideSection('_document_logo_id');\\n this.showHideSection('_document_header_msg');\\n this.showHideSection('_document_footer_msg');\\n this.showHideSection('_comments_pdf');\\n this.showHideSection('_certificates_pdf');\\n this.showHideSection('_syllabus');\\n this.showHideSection('_registration_parent_msg');\\n this.showHideSection('_registration_teacher_msg');\\n this.showHideSection('_registration_adult_msg');\\n this.showHideSection('_competitor_parent_msg');\\n this.showHideSection('_competitor_teacher_msg');\\n this.showHideSection('_competitor_adult_msg');\\n this.showHideSection('_competitor_group_parent_msg');\\n this.showHideSection('_competitor_group_teacher_msg');\\n this.showHideSection('_competitor_group_adult_msg');\\n this.showHideSection('_waiver');\\n this.refreshSection('_tabs');\\n }\\n this.edit.updateNames = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.registrationNamesUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.alert(\\\"Done\\\");\\n });\\n }\\n this.edit.open = function(cb, fid, list) {\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.edit;\\n p.data = rsp.festival;\\n if( (rsp.festival.flags&0x02) == 0x02 ) {\\n p.sections.general.fields.flags3.visible = 'yes';\\n p.sections.general.fields.virtual_date.visible = 'yes';\\n p.sections.general.fields.upload_end_dt.visible = 'yes';\\n } else {\\n p.sections.general.fields.virtual_date.visible = 'no';\\n p.sections.general.fields.upload_end_dt.visible = 'no';\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.edit.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.edit.close();'; }\\n if( this.festival_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.festivalUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.festivalAdd', {'tnid':M.curTenantID}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.edit.festival_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.edit.remove = function() {\\n M.confirm('Are you sure you want to remove festival?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalDelete', {'tnid':M.curTenantID, 'festival_id':M.ciniki_musicfestivals_main.edit.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.edit.close();\\n });\\n });\\n }\\n this.edit.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.edit.save(\\\\'M.ciniki_musicfestivals_main.edit.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.edit.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.edit.save(\\\\'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.edit.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.edit.save();');\\n this.edit.addClose('Cancel');\\n this.edit.addButton('next', 'Next');\\n this.edit.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Section\\n //\\n this.section = new M.panel('Section', 'ciniki_musicfestivals_main', 'section', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.section');\\n this.section.data = null;\\n this.section.festival_id = 0;\\n this.section.section_id = 0;\\n this.section.nplists = {};\\n this.section.nplist = [];\\n this.section.sections = {\\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id',0);\\n return true;\\n },\\n },\\n }},\\n 'general':{'label':'Section', 'aside':'yes', 'fields':{\\n 'name':{'label':'Name', 'type':'text', 'required':'yes'},\\n 'sequence':{'label':'Order', 'type':'text', 'required':'yes', 'size':'small'},\\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Hidden'}}},\\n 'live_end_dt':{'label':'Live Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x08) == 0x08 ? 'yes' : 'no';},\\n },\\n 'virtual_end_dt':{'label':'Virtual Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\\n },\\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\\n },\\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\\n },\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'categories', 'tabs':{\\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\\\'categories\\\\');'},\\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\\\'synopsis\\\\');'},\\n }},\\n '_synopsis':{'label':'Synopsis', \\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\\n },\\n '_description':{'label':'Description', \\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\\n },\\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'categories' ? 'yes' : 'hidden'; },\\n 'addTxt':'Add Category',\\n 'addFn':'M.ciniki_musicfestivals_main.section.openCategory(0);',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\\n }},\\n };\\n this.section.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.section.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.sectionHistory', 'args':{'tnid':M.curTenantID, 'section_id':this.section_id, 'field':i}};\\n }\\n this.section.cellValue = function(s, i, j, d) {\\n switch (j) {\\n case 0: return d.name;\\n }\\n }\\n this.section.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.section.openCategory(\\\\'' + d.id + '\\\\');';\\n }\\n this.section.openCategory = function(cid) {\\n this.save(\\\"M.ciniki_musicfestivals_main.category.open('M.ciniki_musicfestivals_main.section.open();', '\\\" + cid + \\\"', this.section_id, this.festival_id, this.nplists.categories);\\\");\\n }\\n this.section.switchTab = function(tab) {\\n this.sections._tabs.selected = tab;\\n this.refresh();\\n this.show();\\n }\\n this.section.downloadSyllabusPDF = function() {\\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\\n }\\n this.section.open = function(cb, sid, fid, list) {\\n if( sid != null ) { this.section_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.sectionGet', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'categories':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.section;\\n p.data = rsp.section;\\n p.festival_id = rsp.section.festival_id;\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.section.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.section.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.section_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.sectionUpdate', {'tnid':M.curTenantID, 'section_id':this.section_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.sectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.section.section_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.section.remove = function() {\\n M.confirm('Are you sure you want to remove section?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.sectionDelete', {'tnid':M.curTenantID, 'section_id':M.ciniki_musicfestivals_main.section.section_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.section.close();\\n });\\n });\\n }\\n this.section.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.section.save(\\\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.section.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.section.save(\\\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.section.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\\n this.section.addClose('Cancel');\\n this.section.addButton('next', 'Next');\\n this.section.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Section Classes\\n //\\n this.classes = new M.panel('Section', 'ciniki_musicfestivals_main', 'classes', 'mc', 'full', 'sectioned', 'ciniki.musicfestivals.main.classes');\\n this.classes.data = null;\\n this.classes.festival_id = 0;\\n this.classes.section_id = 0;\\n this.classes.nplists = {};\\n this.classes.nplist = [];\\n this.classes.sections = {\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'fees', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x40); },\\n 'tabs':{\\n 'fees':{'label':'Fees', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\\\"fees\\\");'},\\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\\\"trophies\\\");'},\\n }},\\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':7,\\n 'headerValues':['Order', 'Category', 'Code', 'Class', 'Levels', 'Earlybird', 'Live', 'Virtual'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'text', 'number', 'number', 'number'],\\n 'dataMaps':['joined_sequence', 'category_name', 'code', 'class_name', 'level', 'earlybird_fee', 'fee', 'virtual_fee'],\\n },\\n/* '_buttons':{'label':'', 'halfsize':'yes', 'buttons':{\\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\\n }}, */\\n };\\n this.classes.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n this.open();\\n }\\n this.classes.cellValue = function(s, i, j, d) {\\n if( this.sections.classes.dataMaps[j] != null ) {\\n if( this.sections.classes.dataMaps[j].match(/fee/) ) {\\n return M.formatDollar(d[this.sections.classes.dataMaps[j]]);\\n }\\n if( this.sections.classes.dataMaps[j] == 'num_registrations' && d[this.sections.classes.dataMaps[j]] == 0 ) {\\n return '';\\n }\\n return d[this.sections.classes.dataMaps[j]];\\n }\\n }\\n this.classes.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.classes.open();\\\\',\\\\'' + d.id + '\\\\',\\\\'' + d.category_id + '\\\\',\\\\'' + this.festival_id + '\\\\',M.ciniki_musicfestivals_main.classes.nplists.classes);';\\n }\\n this.classes.downloadSyllabusPDF = function() {\\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\\n }\\n this.classes.open = function(cb, sid, fid, list) {\\n if( sid != null ) { this.section_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.sectionClasses', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'list':this.sections._tabs.selected}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.classes;\\n p.data = rsp;\\n p.sections.classes.headerValues = ['Order', 'Category', 'Code', 'Class'];\\n p.sections.classes.sortTypes = ['text', 'text', 'text', 'text'];\\n p.sections.classes.dataMaps = ['joined_sequence', 'category_name', 'code', 'class_name'];\\n if( p.sections._tabs.selected == 'trophies' ) {\\n p.sections.classes.headerValues.push('Trophies');\\n p.sections.classes.sortTypes.push('text');\\n p.sections.classes.dataMaps.push('trophies');\\n } else {\\n if( M.modFlagOn('ciniki.musicfestivals', 0x1000) ) {\\n p.sections.classes.headerValues.push('Levels');\\n p.sections.classes.sortTypes.push('text');\\n p.sections.classes.dataMaps.push('levels');\\n }\\n p.sections.classes.headerValues.push('Earlybird');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('earlybird_fee');\\n p.sections.classes.headerValues.push('Fee');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('fee');\\n if( (rsp.festival.flags&0x04) == 0x04 ) {\\n p.sections.classes.headerValues.push('Virtual');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('virtual_fee');\\n }\\n if( M.modFlagOn('ciniki.musicfestivals', 0x0800) ) {\\n p.sections.classes.headerValues.push('Earlybird Plus');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('earlybird_plus_fee');\\n p.sections.classes.headerValues.push('Plus');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('plus_fee');\\n }\\n p.sections.classes.headerValues.push('Registrations');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('num_registrations');\\n p.sections.classes.num_cols = p.sections.classes.headerValues.length;\\n }\\n\\n p.festival_id = rsp.section.festival_id;\\n p.sections.classes.label = rsp.section.name + ' - Classes';\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.classes.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');';\\n }\\n return null;\\n }\\n this.classes.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');';\\n }\\n return null;\\n }\\n this.classes.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\\n this.classes.addClose('Cancel');\\n this.classes.addButton('next', 'Next');\\n this.classes.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Category\\n //\\n this.category = new M.panel('Category', 'ciniki_musicfestivals_main', 'category', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.category');\\n this.category.data = null;\\n this.category.category_id = 0;\\n this.category.nplists = {};\\n this.category.nplist = [];\\n this.category.sections = {\\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.category.setFieldValue('primary_image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.category.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }},\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'section_id':{'label':'Section', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'sequence':{'label':'Order', 'required':'yes', 'type':'text'},\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'classes', 'tabs':{\\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\\\'classes\\\\');'},\\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\\\'synopsis\\\\');'},\\n }},\\n '_synopsis':{'label':'Synopsis', \\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\\n },\\n '_description':{'label':'Description', \\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\\n },\\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'classes' ? 'yes' : 'hidden'; },\\n 'headerValues':['Code', 'Name', 'Earlybird', 'Fee', 'Virtual'],\\n 'addTxt':'Add Class',\\n 'addFn':'M.ciniki_musicfestivals_main.category.openClass(0);',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.category.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.category.category_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.category.remove();'},\\n }},\\n };\\n this.category.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.category.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.categoryHistory', 'args':{'tnid':M.curTenantID, 'category_id':this.category_id, 'field':i}};\\n }\\n this.category.cellValue = function(s, i, j, d) {\\n switch (j) {\\n case 0: return d.code;\\n case 1: return d.name;\\n case 2: return (d.earlybird_fee > 0 ? M.formatDollar(d.earlybird_fee) : '');\\n case 3: return (d.fee > 0 ? M.formatDollar(d.fee) : '');\\n case 4: return (d.virtual_fee > 0 ? M.formatDollar(d.virtual_fee) : '');\\n }\\n }\\n this.category.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.category.openClass(\\\\'' + d.id + '\\\\');';\\n }\\n this.category.openClass = function(cid) {\\n this.save(\\\"M.ciniki_musicfestivals_main.class.open('M.ciniki_musicfestivals_main.category.open();','\\\" + cid + \\\"', this.category_id, this.festival_id, this.nplists.classes);\\\");\\n }\\n this.category.switchTab = function(tab) {\\n this.sections._tabs.selected = tab;\\n this.refresh();\\n this.show();\\n }\\n this.category.open = function(cb, cid, sid,fid,list) {\\n if( cid != null ) { this.category_id = cid; }\\n if( sid != null ) { this.section_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.categoryGet', {'tnid':M.curTenantID, \\n 'category_id':this.category_id, 'festival_id':this.festival_id, 'section_id':this.section_id,\\n 'sections':'yes', 'classes':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.category;\\n p.data = rsp.category;\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.sections.general.fields.section_id.options = rsp.sections;\\n if( M.ciniki_musicfestivals_main.festival.data.flags != null \\n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \\n ) {\\n p.sections.classes.num_cols = 5;\\n } else {\\n p.sections.classes.num_cols = 4;\\n }\\n\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.category.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.category.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.category_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.categoryUpdate', {'tnid':M.curTenantID, 'category_id':this.category_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.categoryAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.category.category_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.category.remove = function() {\\n M.confirm('Are you sure you want to remove category?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.categoryDelete', {'tnid':M.curTenantID, 'category_id':M.ciniki_musicfestivals_main.category.category_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.category.close();\\n });\\n });\\n }\\n this.category.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.category.save(\\\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.category.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.category.save(\\\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.category.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.category.save();');\\n this.category.addClose('Cancel');\\n this.category.addButton('next', 'Next');\\n this.category.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Class\\n //\\n this.class = new M.panel('Class', 'ciniki_musicfestivals_main', 'class', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.class');\\n this.class.data = null;\\n this.class.festival_id = 0;\\n this.class.class_id = 0;\\n this.class.nplists = {};\\n this.class.nplist = [];\\n this.class.sections = {\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'category_id':{'label':'Category', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'code':{'label':'Code', 'type':'text', 'size':'small'},\\n 'name':{'label':'Name', 'type':'text'},\\n// 'level':{'label':'Level', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\\n// 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\\n// },\\n 'levels':{'label':'Level', 'type':'tags', 'tags':[], 'hint':'Enter a new level:', 'sort':'no',\\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\\n },\\n 'sequence':{'label':'Order', 'type':'text'},\\n 'earlybird_fee':{'label':'Earlybird Fee', 'type':'text', 'size':'small'},\\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\\n 'virtual_fee':{'label':'Virtual Fee', 'type':'text', 'size':'small',\\n 'visible':function() { \\n if( M.ciniki_musicfestivals_main.festival.data.flags != null \\n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \\n ) {\\n return 'yes';\\n }\\n return 'no';\\n },\\n },\\n 'earlybird_plus_fee':{'label':'Earlybird Plus Fee', 'type':'text', 'size':'small',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\\n },\\n 'plus_fee':{'label':'Plus Fee', 'type':'text', 'size':'small',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\\n },\\n }},\\n// '_tags':{'label':'Tags', \\n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n// 'fields':{\\n// }},\\n 'registration':{'label':'Registration Options', 'aside':'yes', 'fields':{\\n 'flags1':{'label':'Online Registrations', 'type':'flagtoggle', 'default':'on', 'bit':0x01, 'field':'flags'},\\n 'flags2':{'label':'Multiple/Registrant', 'type':'flagtoggle', 'default':'on', 'bit':0x02, 'field':'flags'},\\n 'flags5':{'label':'2nd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags'},\\n 'flags6':{'label':'3rd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\\n 'flags7':{'label':'4th Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\\n 'flags13':{'label':'2nd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x1000, 'field':'flags'},\\n 'flags14':{'label':'2nd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x2000, 'field':'flags'},\\n 'flags15':{'label':'3rd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x4000, 'field':'flags'},\\n 'flags16':{'label':'3rd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x8000, 'field':'flags'},\\n }},\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':3, \\n 'headerValues':['Competitor', 'Teacher', 'Status'],\\n 'noData':'No registrations',\\n// 'addTxt':'Add Registration',\\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.class.class_id,M.ciniki_musicfestivals_main.festival.festival_id,null,\\\\'festival\\\\');',\\n },\\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':3, \\n 'headerValues':['Category', 'Name'],\\n 'cellClasses':['', '', 'alignright'],\\n 'noData':'No trophies',\\n 'addTxt':'Add Trophy',\\n 'addFn':'M.ciniki_musicfestivals_main.class.save(\\\"M.ciniki_musicfestivals_main.class.addTrophy();\\\");',\\n },\\n '_buttons':{'label':'', 'aside':'yes', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.class.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.class.class_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.class.remove();'},\\n }},\\n };\\n this.class.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.class.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.classHistory', 'args':{'tnid':M.curTenantID, 'class_id':this.class_id, 'field':i}};\\n }\\n this.class.cellValue = function(s, i, j, d) {\\n if( s == 'registrations' ) {\\n switch(j) {\\n case 0: return d.display_name; // + M.subdue(' (',d.pronoun,')');\\n case 1: return d.teacher_name;\\n case 2: return d.status_text;\\n }\\n }\\n if( s == 'trophies' ) {\\n switch(j) {\\n case 0: return d.category;\\n case 1: return d.name;\\n case 2: return '';\\n }\\n }\\n }\\n this.class.rowFn = function(s, i, d) {\\n if( s == 'registrations' ) {\\n return 'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.class.open();\\\\',\\\\'' + d.id + '\\\\',0,0,M.ciniki_musicfestivals_main.class.festival_id, null,\\\\'festival\\\\');';\\n }\\n return '';\\n }\\n this.class.addTrophy = function() {\\n M.ciniki_musicfestivals_main.classtrophy.open('M.ciniki_musicfestivals_main.class.open();',this.class_id);\\n }\\n this.class.attachTrophy = function(i) {\\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyAdd', {'tnid':M.curTenantID, 'class_id':this.class_id, 'trophy_id':i}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.open();\\n });\\n }\\n this.class.removeTrophy = function(i) {\\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyRemove', {'tnid':M.curTenantID, 'class_id':this.class_id, 'tc_id':i}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.open();\\n });\\n }\\n/* this.class.liveSearchCb = function(s, i, value) {\\n if( i == 'level' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.classFieldSearch', {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'festival_id':M.ciniki_musicfestivals_main.class.festival_id, 'limit':15}, \\n function(rsp) {\\n M.ciniki_musicfestivals_main.class.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.class.panelUID + '_' + i), rsp.results); \\n });\\n }\\n }\\n this.class.liveSearchResultValue = function(s, f, i, j, d) {\\n return d.name;\\n }\\n this.class.liveSearchResultRowFn = function(s, f, i, j, d) {\\n if( f == 'level' ) {\\n return 'M.ciniki_musicfestivals_main.class.updateField(\\\\'' + s + '\\\\',\\\\'' + f + '\\\\',\\\\'' + escape(d.name) + '\\\\');';\\n }\\n }\\n this.class.updateField = function(s, f, r) {\\n M.gE(this.panelUID + '_' + f).value = unescape(r);\\n this.removeLiveSearch(s, f);\\n } */\\n this.class.open = function(cb, iid, cid, fid, list) {\\n if( iid != null ) { this.class_id = iid; }\\n if( cid != null ) { this.category_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.classGet', {'tnid':M.curTenantID, 'class_id':this.class_id, 'festival_id':this.festival_id, 'category_id':this.category_id, \\n 'registrations':'yes', 'categories':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.class;\\n p.data = rsp.class;\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.sections.general.fields.category_id.options = rsp.categories;\\n p.sections.general.fields.levels.tags = [];\\n if( rsp.levels != null ) {\\n p.sections.general.fields.levels.tags = rsp.levels;\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.class.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.class.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.class_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.classUpdate', {'tnid':M.curTenantID, 'class_id':this.class_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.classAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.class_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.class.remove = function() {\\n M.confirm('Are you sure you want to remove class?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.classDelete', {'tnid':M.curTenantID, 'class_id':M.ciniki_musicfestivals_main.class.class_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.close();\\n });\\n });\\n }\\n this.class.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.class.save(\\\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.class.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.class.save(\\\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.class.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.class.save();');\\n this.class.addClose('Cancel');\\n this.class.addButton('next', 'Next');\\n this.class.addLeftButton('prev', 'Prev');\\n\\n //\\n // This panel lets the user select a trophy to attach to a class\\n //\\n this.classtrophy = new M.panel('Select Trophy', 'ciniki_musicfestivals_main', 'classtrophy', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophyclass');\\n this.classtrophy.sections = {\\n 'trophies':{'label':'Select Trophy', 'type':'simplegrid', 'num_cols':3,\\n 'noData':'No trophies',\\n },\\n };\\n this.classtrophy.cellValue = function(s, i, j, d) {\\n if( s == 'trophies' ) {\\n switch(j) {\\n case 0: return d.category;\\n case 1: return d.name;\\n case 2: return '';\\n }\\n }\\n }\\n this.classtrophy.open = function(cb, cid) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID, 'class_id':cid}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.classtrophy;\\n p.data = rsp;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.classtrophy.addClose('Back');\\n\\n //\\n // Registration\\n //\\n this.registration = new M.panel('Registration', 'ciniki_musicfestivals_main', 'registration', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.registration');\\n this.registration.data = null;\\n this.registration.festival_id = 0;\\n this.registration.teacher_customer_id = 0;\\n this.registration.competitor1_id = 0;\\n this.registration.competitor2_id = 0;\\n this.registration.competitor3_id = 0;\\n this.registration.competitor4_id = 0;\\n// this.registration.competitor5_id = 0;\\n this.registration.registration_id = 0;\\n this.registration.nplist = [];\\n this.registration._source = '';\\n this.registration.sections = {\\n// '_tabs':{'label':'', 'type':'paneltabs', 'field_id':'rtype', 'selected':'30', 'tabs':{\\n// '30':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"30\\\");'},\\n// '50':{'label':'Duet', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"50\\\");'},\\n// '60':{'label':'Trio', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"60\\\");'},\\n// '90':{'label':'Ensemble', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"90\\\");'},\\n// }},\\n 'teacher_details':{'label':'Teacher', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\\\',\\\\'customer_id\\\\':M.ciniki_musicfestivals_main.registration.teacher_customer_id});',\\n 'changeTxt':'Change',\\n 'changeFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\\\',\\\\'customer_id\\\\':0});',\\n },\\n '_display_name':{'label':'Duet/Trio/Ensemble Name', 'aside':'yes',\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\\n 'fields':{ \\n 'display_name':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n 'competitor1_details':{'label':'Competitor 1', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'cellClasses':['label', ''],\\n 'addTxt':'',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 1);',\\n 'changeTxt':'Add',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 1);',\\n },\\n 'competitor2_details':{'label':'Competitor 2', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>30?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 2);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 2);',\\n },\\n 'competitor3_details':{'label':'Competitor 3', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>50?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 3);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 3);',\\n },\\n 'competitor4_details':{'label':'Competitor 4', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 4);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 4);',\\n },\\n/* 'competitor5_details':{'label':'Competitor 5', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 5);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 5);',\\n }, */\\n 'invoice_details':{'label':'Invoice', 'type':'simplegrid', 'num_cols':2,\\n 'cellClasses':['label', ''],\\n },\\n '_class':{'label':'Registration', 'fields':{\\n// 'status':{'label':'Status', 'required':'yes', 'type':'toggle', 'toggles':{'5':'Draft', '10':'Applied', '50':'Paid', '60':'Cancelled'}},\\n// 'payment_type':{'label':'Payment', 'type':'toggle', 'toggles':{'20':'Square', '50':'Visa', '55':'Mastercard', '100':'Cash', '105':'Cheque', '110':'Email', '120':'Other', '121':'Online'}},\\n 'class_id':{'label':'Class', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\\n },\\n 'title1':{'label':'Title', 'type':'text'},\\n 'perf_time1':{'label':'Perf Time', 'type':'minsec', 'size':'small'},\\n 'title2':{'label':'2nd Title', 'type':'text',\\n 'visible':'no',\\n },\\n 'perf_time2':{'label':'2nd Time', 'type':'minsec', 'max_minutes':30, 'second_interval':5, 'size':'small',\\n 'visible':'no',\\n },\\n 'title3':{'label':'3rd Title', 'type':'text',\\n 'visible':'no',\\n },\\n 'perf_time3':{'label':'3rd Time', 'type':'minsec', 'size':'small',\\n 'visible':'no',\\n },\\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\\n 'participation':{'label':'Participate', 'type':'select', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x12) > 0 ? 'yes' : 'no'},\\n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\\n 'options':{\\n '0':'in person on a date to be scheduled',\\n '1':'virtually and submit a video online',\\n }},\\n 'video_url1':{'label':'1st Video', 'type':'text', \\n 'visible':'no',\\n },\\n 'music_orgfilename1':{'label':'1st Music', 'type':'file',\\n 'visible':'no',\\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(1);',\\n },\\n 'video_url2':{'label':'2nd Video', 'type':'text', \\n 'visible':'no',\\n },\\n 'music_orgfilename2':{'label':'2nd Music', 'type':'file',\\n 'visible':'no',\\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(2);',\\n },\\n 'video_url3':{'label':'3rd Video', 'type':'text', \\n 'visible':'no',\\n },\\n 'music_orgfilename3':{'label':'3rd Music', 'type':'file',\\n 'visible':'no',\\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(3);',\\n },\\n 'placement':{'label':'Placement', 'type':'text',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x08); },\\n },\\n }},\\n '_tags':{'label':'Tags', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n 'fields':{\\n 'tags':{'label':'', 'hidelabel':'yes', 'type':'tags', 'tags':[], 'hint':'Enter a new tag:'},\\n }},\\n/* 'music_buttons':{'label':'', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x02) == 0x02 ? 'yes' : 'no'},\\n 'buttons':{\\n 'add':{'label':'Upload Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename == '' ? 'yes' : 'no'},\\n },\\n 'upload':{'label':'Replace Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\\n },\\n 'download':{'label':'Download PDF', 'fn':'M.ciniki_musicfestivals_main.registration.downloadPDF();',\\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\\n },\\n }}, */\\n '_notes':{'label':'Registration Notes', 'fields':{\\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_internal_notes':{'label':'Internal Admin Notes', 'fields':{\\n 'internal_notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.registration.save();'},\\n 'printcert':{'label':'Download Certificate PDF', \\n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.registration.printCert();'},\\n 'printcomments':{'label':'Download Comments PDF', \\n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.registration.printComments();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.registration.remove();'},\\n }},\\n };\\n this.registration.fieldValue = function(s, i, d) { \\n// if( i == 'music_orgfilename' ) {\\n// if( this.data[i] == '' ) {\\n// return '';\\n// } else {\\n// return this.data[i] + ' ';\\n// }\\n// }\\n return this.data[i]; \\n }\\n this.registration.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.registrationHistory', 'args':{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'field':i}};\\n }\\n this.registration.cellValue = function(s, i, j, d) {\\n if( s == 'competitor1_details' || s == 'competitor2_details' || s == 'competitor3_details' || s == 'competitor4_details' ) {\\n switch(j) {\\n case 0 : return d.label;\\n case 1 : \\n if( d.label == 'Email' ) {\\n return M.linkEmail(d.value);\\n } else if( d.label == 'Address' ) {\\n return d.value.replace(/\\\\n/g, '
            ');\\n }\\n return d.value;\\n }\\n }\\n if( s == 'teacher_details' ) {\\n switch(j) {\\n case 0: return d.detail.label;\\n case 1:\\n if( d.detail.label == 'Email' ) {\\n return M.linkEmail(d.detail.value);\\n } else if( d.detail.label == 'Address' ) {\\n return d.detail.value.replace(/\\\\n/g, '
            ');\\n }\\n return d.detail.value;\\n }\\n }\\n if( s == 'invoice_details' ) {\\n switch(j) {\\n case 0: return d.label;\\n case 1: return d.value.replace(/\\\\n/, '
            ');\\n }\\n }\\n }\\n this.registration.rowFn = function(s, i, d) {\\n if( s == 'invoice_details' && this._source != 'invoice' && this._source != 'pos' ) {\\n return 'M.startApp(\\\\'ciniki.sapos.invoice\\\\',null,\\\\'M.ciniki_musicfestivals_main.registration.open();\\\\',\\\\'mc\\\\',{\\\\'invoice_id\\\\':\\\\'' + this.data.invoice_id + '\\\\'});';\\n }\\n }\\n this.registration.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n this.refreshSection('_tabs');\\n this.showHideSection('_display_name');\\n this.showHideSection('competitor2_details');\\n this.showHideSection('competitor3_details');\\n this.showHideSection('competitor4_details');\\n// this.showHideSection('competitor5_details');\\n }\\n this.registration.updateForm = function(s, i, cf) {\\n var festival = this.data.festival;\\n var cid = this.formValue('class_id');\\n var participation = this.formValue('participation');\\n for(var i in this.classes) {\\n if( this.classes[i].id == cid ) {\\n var c = this.classes[i];\\n if( cf == null ) {\\n if( (festival.flags&0x10) == 0x10 && participation == 2 && c.earlybird_plus_fee > 0 ) {\\n this.setFieldValue('fee', c.earlybird_plus_fee);\\n } else if( (festival.flags&0x10) == 0x10 && participation == 2 && c.plus_fee > 0 ) {\\n this.setFieldValue('fee', c.plus_fee);\\n } else if( (festival.flags&0x04) == 0x04 && participation == 1 ) {\\n this.setFieldValue('fee', c.virtual_fee);\\n } else if( festival.earlybird == 'yes' && c.earlybird_fee > 0 ) {\\n this.setFieldValue('fee', c.earlybird_fee);\\n } else {\\n this.setFieldValue('fee', c.fee);\\n }\\n }\\n\\n this.sections._class.fields.title2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\\n this.sections._class.fields.perf_time2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\\n this.sections._class.fields.title3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\\n this.sections._class.fields.perf_time3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\\n this.sections._class.fields.video_url1.visible = (participation == 1 ? 'yes' : 'no');\\n this.sections._class.fields.video_url2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\\n this.sections._class.fields.video_url3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\\n this.sections._class.fields.music_orgfilename1.visible = (participation == 1 ? 'yes' : 'no');\\n this.sections._class.fields.music_orgfilename2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\\n this.sections._class.fields.music_orgfilename3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\\n\\n this.sections._display_name.visible = (c.flags&0x70) > 0 ? 'yes' : 'hidden';\\n this.sections.competitor2_details.visible = (c.flags&0x10) == 0x10 ? 'yes' : 'hidden';\\n this.sections.competitor3_details.visible = (c.flags&0x20) == 0x20 ? 'yes' : 'hidden';\\n this.sections.competitor4_details.visible = (c.flags&0x40) == 0x40 ? 'yes' : 'hidden';\\n this.showHideSection('competitor2_details');\\n this.showHideSection('competitor3_details');\\n this.showHideSection('competitor4_details');\\n this.showHideSection('_display_name');\\n this.showHideFormField('_class', 'title2');\\n this.showHideFormField('_class', 'perf_time2');\\n this.showHideFormField('_class', 'title3');\\n this.showHideFormField('_class', 'perf_time3');\\n this.showHideFormField('_class', 'video_url1');\\n this.showHideFormField('_class', 'video_url2');\\n this.showHideFormField('_class', 'video_url3');\\n this.showHideFormField('_class', 'music_orgfilename1');\\n this.showHideFormField('_class', 'music_orgfilename2');\\n this.showHideFormField('_class', 'music_orgfilename3');\\n }\\n }\\n }\\n this.registration.addCompetitor = function(cid,c) {\\n this.save(\\\"M.ciniki_musicfestivals_main.competitor.open('M.ciniki_musicfestivals_main.registration.updateCompetitor(\\\" + c + \\\");',\\\" + cid + \\\",\\\" + this.festival_id + \\\",null,M.ciniki_musicfestivals_main.registration.data.billing_customer_id);\\\");\\n }\\n this.registration.updateCompetitor = function(c) {\\n var p = M.ciniki_musicfestivals_main.competitor;\\n if( this['competitor' + c + '_id'] != p.competitor_id ) {\\n this['competitor' + c + '_id'] = p.competitor_id;\\n this.save(\\\"M.ciniki_musicfestivals_main.registration.open();\\\");\\n } else { \\n this.open();\\n }\\n/*\\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'competitor_id':this['competitor'+c+'_id']}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data['competitor'+c+'_details'] = rsp.details;\\n if( p['competitor' + c + '_id'] == 0 ) {\\n p.sections['competitor'+c+'_details'].addTxt = '';\\n p.sections['competitor'+c+'_details'].changeTxt = 'Add';\\n } else {\\n p.sections['competitor'+c+'_details'].addTxt = 'Edit';\\n p.sections['competitor'+c+'_details'].changeTxt = 'Change';\\n }\\n p.refreshSection('competitor'+c+'_details');\\n p.show();\\n }); */\\n }\\n this.registration.updateTeacher = function(cid) {\\n if( cid != null ) { \\n this.teacher_customer_id = cid;\\n if( this.teacher_customer_id > 0 ) {\\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.teacher_customer_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data.teacher_details = rsp.details;\\n if( p.customer_id == 0 ) {\\n p.sections.teacher_details.addTxt = '';\\n p.sections.teacher_details.changeTxt = 'Add';\\n } else {\\n p.sections.teacher_details.addTxt = 'Edit';\\n p.sections.teacher_details.changeTxt = 'Change';\\n }\\n p.refreshSection('teacher_details');\\n p.show();\\n });\\n } else {\\n this.data.teacher_details = [];\\n this.sections.teacher_details.addTxt = '';\\n this.sections.teacher_details.changeTxt = 'Add';\\n this.refreshSection('teacher_details');\\n this.show();\\n }\\n } else {\\n this.show();\\n }\\n }\\n this.registration.printCert = function() {\\n M.api.openFile('ciniki.musicfestivals.registrationCertificatesPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\\n }\\n this.registration.printComments = function() {\\n M.api.openFile('ciniki.musicfestivals.registrationCommentsPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\\n }\\n/* this.registration.uploadPDF = function() {\\n if( this.upload == null ) {\\n this.upload = M.aE('input', this.panelUID + '_music_orgfilename_upload', 'image_uploader');\\n this.upload.setAttribute('name', 'music_orgfilename');\\n this.upload.setAttribute('type', 'file');\\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\\n }\\n this.upload.value = '';\\n this.upload.click();\\n }\\n this.registration.uploadFile = function() {\\n var f = this.upload;\\n M.api.postJSONFile('ciniki.musicfestivals.registrationMusicAdd', \\n {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id}, \\n f.files[0], \\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data.music_orgfilename = rsp.registration.music_orgfilename;\\n// p.refreshSection('music_buttons');\\n p.setFieldValue('music_orgfilename', rsp.registration.music_orgfilename);\\n });\\n } */\\n this.registration.downloadMusic = function(i) {\\n M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'num':i});\\n }\\n// this.registration.downloadPDF = function() {\\n// M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id});\\n// }\\n this.registration.open = function(cb, rid, tid, cid, fid, list, source) {\\n if( rid != null ) { this.registration_id = rid; }\\n if( tid != null ) { this.teacher_customer_id = tid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( cid != null ) { this.class_id = cid; }\\n if( list != null ) { this.nplist = list; }\\n if( source != null ) { this._source = source; }\\n M.api.getJSONCb('ciniki.musicfestivals.registrationGet', {'tnid':M.curTenantID, 'registration_id':this.registration_id, \\n 'teacher_customer_id':this.teacher_customer_id, 'festival_id':this.festival_id, 'class_id':this.class_id, \\n }, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data = rsp.registration;\\n p.classes = rsp.classes;\\n if( p.festival_id == 0 ) {\\n p.festival_id = rsp.registration.festival_id;\\n }\\n// p.sections._tabs.selected = rsp.registration.rtype;\\n p.sections._class.fields.class_id.options = rsp.classes;\\n p.sections._class.fields.class_id.options.unshift({'id':0, 'name':''});\\n p.teacher_customer_id = parseInt(rsp.registration.teacher_customer_id);\\n if( p.teacher_customer_id == 0 ) {\\n p.sections.teacher_details.addTxt = '';\\n p.sections.teacher_details.changeTxt = 'Add';\\n } else {\\n p.sections.teacher_details.addTxt = 'Edit';\\n p.sections.teacher_details.changeTxt = 'Change';\\n }\\n for(var i = 1; i<= 4; i++) {\\n p['competitor' + i + '_id'] = parseInt(rsp.registration['competitor' + i + '_id']);\\n if( p['competitor' + i + '_id'] == 0 ) {\\n p.sections['competitor' + i + '_details'].addTxt = '';\\n p.sections['competitor' + i + '_details'].changeTxt = 'Add';\\n } else {\\n p.sections['competitor' + i + '_details'].addTxt = 'Edit';\\n p.sections['competitor' + i + '_details'].changeTxt = 'Change';\\n }\\n }\\n if( (p.data.festival.flags&0x10) == 0x10 ) {\\n p.sections._class.fields.participation.options = {\\n '0':'Regular Adjudication',\\n '2':'Adjudication Plus',\\n };\\n }\\n else if( (p.data.festival.flags&0x02) == 0x02 ) {\\n p.sections._class.fields.participation.options = {\\n '0':'in person on a date to be scheduled',\\n '1':'virtually and submit a video online',\\n };\\n if( p.data.festival['inperson-choice-msg'] != null && p.data.festival['inperson-choice-msg'] != '' ) {\\n p.sections._class.fields.participation.options[0] = p.data.festival['inperson-choice-msg'];\\n }\\n if( p.data.festival['virtual-choice-msg'] != null && p.data.festival['virtual-choice-msg'] != '' ) {\\n p.sections._class.fields.participation.options[1] = p.data.festival['virtual-choice-msg'];\\n }\\n }\\n if( rsp.tags != null ) {\\n p.sections._tags.fields.tags.tags = rsp.tags;\\n }\\n p.refresh();\\n p.show(cb);\\n p.updateForm(null,null,'no');\\n });\\n }\\n this.registration.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.registration.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.formValue('class_id') == 0 ) {\\n M.alert(\\\"You must select a class.\\\");\\n return false;\\n }\\n// if( this.competitor1_id == 0 ) {\\n// M.alert(\\\"You must have a competitor.\\\");\\n// return false;\\n// }\\n if( this.registration_id > 0 ) {\\n var c = this.serializeFormData('no');\\n if( this.teacher_customer_id != this.data.teacher_customer_id ) {\\n c.append('teacher_customer_id', this.teacher_customer_id);\\n }\\n if( this.competitor1_id != this.data.competitor1_id ) { c.append('competitor1_id', this.competitor1_id); }\\n if( this.competitor2_id != this.data.competitor2_id ) { c.append('competitor2_id', this.competitor2_id); }\\n if( this.competitor3_id != this.data.competitor3_id ) { c.append('competitor3_id', this.competitor3_id); }\\n if( this.competitor4_id != this.data.competitor4_id ) { c.append('competitor4_id', this.competitor4_id); }\\n// if( this.competitor5_id != this.data.competitor5_id ) { c.append('competitor5_id', this.competitor5_id); }\\n if( c != '' ) {\\n \\n M.api.postJSONFormData('ciniki.musicfestivals.registrationUpdate', {'tnid':M.curTenantID, 'registration_id':this.registration_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n c += '&teacher_customer_id=' + this.teacher_customer_id;\\n c += '&competitor1_id=' + this.competitor1_id;\\n c += '&competitor2_id=' + this.competitor2_id;\\n c += '&competitor3_id=' + this.competitor3_id;\\n c += '&competitor4_id=' + this.competitor4_id;\\n// c += '&competitor5_id=' + this.competitor5_id;\\n M.api.postJSONCb('ciniki.musicfestivals.registrationAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.registration.registration_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.registration.remove = function() {\\n var msg = 'Are you sure you want to remove this registration?';\\n if( this.data.invoice_id > 0 && this.data.invoice_status >= 50 ) {\\n msg = '**WARNING** Removing this registration will NOT remove the item from the Invoice. You will need make sure they have received a refund for the registration.';\\n }\\n M.confirm(msg,null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.registrationDelete', {'tnid':M.curTenantID, 'registration_id':M.ciniki_musicfestivals_main.registration.registration_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.registration.close();\\n });\\n });\\n }\\n this.registration.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.registration.save(\\\\'M.ciniki_musicfestivals_main.registration.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.registration.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.registration.save(\\\\'M.ciniki_musicfestivals_main.registration_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.registration.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.registration.save();');\\n this.registration.addClose('Cancel');\\n this.registration.addButton('next', 'Next');\\n this.registration.addLeftButton('prev', 'Prev');\\n\\n\\n //\\n // The panel to add/edit a competitor\\n //\\n this.competitor = new M.panel('Competitor', 'ciniki_musicfestivals_main', 'competitor', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.competitor');\\n this.competitor.data = null;\\n this.competitor.festival_id = 0;\\n this.competitor.competitor_id = 0;\\n this.competitor.billing_customer_id = 0;\\n this.competitor.nplist = [];\\n this.competitor.sections = {\\n '_ctype':{'label':'', 'type':'paneltabs', 'selected':10, 'aside':'yes', 'tabs':{\\n '10':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\\\"10\\\");'},\\n '50':{'label':'Group/Ensemble', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\\\"50\\\");'},\\n }},\\n 'general':{'label':'Competitor', 'aside':'yes', 'fields':{\\n 'first':{'label':'First Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\\n 'last':{'label':'Last Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\\n 'name':{'label':'Name', 'required':'yes', 'type':'text', 'livesearch':'yes', 'visible':'hidden'},\\n 'public_name':{'label':'Public Name', 'type':'text'},\\n 'pronoun':{'label':'Pronoun', 'type':'text'},\\n 'conductor':{'label':'Conductor', 'type':'text', 'visible':'no'},\\n 'num_people':{'label':'# People', 'type':'number', 'size':'small', 'visible':'no'},\\n 'parent':{'label':'Parent', 'type':'text', 'visible':'yes'},\\n }},\\n '_other':{'label':'', 'aside':'yes', 'fields':{\\n 'age':{'label':'Age', 'type':'text'},\\n 'study_level':{'label':'Study/Level', 'type':'text'},\\n 'instrument':{'label':'Instrument', 'type':'text'},\\n 'flags1':{'label':'Waiver', 'type':'flagtoggle', 'bit':0x01, 'field':'flags', 'toggles':{'':'Unsigned', 'signed':'Signed'}},\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'contact', 'visible':'yes',\\n 'tabs':{\\n 'contact':{'label':'Contact Info', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\\\"contact\\\");'},\\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\\\"emails\\\");'},\\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\\\"registrations\\\");'},\\n }},\\n '_address':{'label':'Contact Info', \\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\\n 'fields':{\\n 'address':{'label':'Address', 'type':'text'},\\n 'city':{'label':'City', 'type':'text', 'size':'small'},\\n 'province':{'label':'Province', 'type':'text', 'size':'small'},\\n 'postal':{'label':'Postal Code', 'type':'text', 'size':'small'},\\n 'country':{'label':'Country', 'type':'text', 'size':'small'},\\n 'phone_home':{'label':'Home Phone', 'type':'text', 'size':'small'},\\n 'phone_cell':{'label':'Cell Phone', 'type':'text', 'size':'small'},\\n 'email':{'label':'Email', 'type':'text'},\\n }},\\n '_notes':{'label':'Competitor Notes', 'aside':'no', \\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\\n 'fields':{\\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n 'messages':{'label':'Draft Emails', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\\n 'headerValues':['Status', 'Subject'],\\n 'noData':'No drafts or scheduled emails',\\n 'addTxt':'Send Email',\\n 'addFn':'M.ciniki_musicfestivals_main.competitor.save(\\\"M.ciniki_musicfestivals_main.competitor.addmessage();\\\");',\\n },\\n 'emails':{'label':'Send Emails', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\\n 'headerValues':['Date Sent', 'Subject'],\\n 'noData':'No emails sent',\\n },\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden';},\\n 'headerValues':['Category', 'Code', 'Class', 'Status'],\\n 'noData':'No registrations',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.competitor.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.competitor.competitor_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.competitor.remove();'},\\n }},\\n };\\n this.competitor.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.competitor.switchType = function(t) {\\n this.sections._ctype.selected = t;\\n if( t == 50 ) {\\n this.sections.general.fields.first.visible = 'no';\\n this.sections.general.fields.last.visible = 'no';\\n this.sections.general.fields.name.visible = 'yes';\\n this.sections.general.fields.public_name.visible = 'no';\\n this.sections.general.fields.pronoun.visible = 'no';\\n this.sections.general.fields.conductor.visible = 'yes';\\n this.sections.general.fields.num_people.visible = 'yes';\\n this.sections.general.fields.parent.label = 'Contact Person';\\n } else {\\n this.sections.general.fields.first.visible = 'yes';\\n this.sections.general.fields.last.visible = 'yes';\\n this.sections.general.fields.name.visible = 'no';\\n this.sections.general.fields.public_name.visible = 'yes';\\n this.sections.general.fields.pronoun.visible = M.modFlagSet('ciniki.musicfestivals', 0x80);\\n this.sections.general.fields.conductor.visible = 'no';\\n this.sections.general.fields.num_people.visible = 'no';\\n this.sections.general.fields.parent.label = 'Parent';\\n }\\n this.showHideFormField('general', 'first');\\n this.showHideFormField('general', 'last');\\n this.showHideFormField('general', 'name');\\n this.showHideFormField('general', 'public_name');\\n this.showHideFormField('general', 'pronoun');\\n this.showHideFormField('general', 'conductor');\\n this.showHideFormField('general', 'num_people');\\n this.showHideFormField('general', 'parent');\\n this.refreshSections(['_ctype']);\\n }\\n this.competitor.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n this.refreshSections(['_tabs', '_address','_notes','messages', 'emails', 'registrations']);\\n }\\n this.competitor.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.competitorHistory', 'args':{'tnid':M.curTenantID, 'competitor_id':this.competitor_id, 'field':i}};\\n }\\n this.competitor.liveSearchCb = function(s, i, value) {\\n if( i == 'name' || i == 'first' || i == 'last' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.competitorSearch', \\n {'tnid':M.curTenantID, 'start_needle':value, 'limit':25}, function(rsp) { \\n M.ciniki_musicfestivals_main.competitor.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.competitor.panelUID + '_' + i), rsp.competitors); \\n });\\n }\\n }\\n this.competitor.liveSearchResultValue = function(s, f, i, j, d) {\\n return d.name;\\n }\\n this.competitor.liveSearchResultRowFn = function(s, f, i, j, d) { \\n return 'M.ciniki_musicfestivals_main.competitor.open(null,\\\\'' + d.id + '\\\\');';\\n }\\n this.competitor.cellValue = function(s, i, j, d) {\\n if( s == 'messages' ) {\\n switch(j) {\\n case 0: return d.status_text;\\n case 1: return d.subject;\\n }\\n }\\n if( s == 'emails' ) {\\n switch(j) {\\n case 0: return (d.status != 30 ? d.status_text : d.date_sent);\\n case 1: return d.subject;\\n }\\n }\\n if( s == 'registrations' ) {\\n switch(j) {\\n case 0: return d.section_name + ' - ' + d.category_name;\\n case 1: return d.class_code;\\n case 2: return d.class_name;\\n case 3: return d.status_text;\\n }\\n }\\n }\\n this.competitor.rowFn = function(s, i, d) {\\n if( s == 'messages' ) {\\n return 'M.ciniki_musicfestivals_main.competitor.save(\\\"M.ciniki_musicfestivals_main.message.open(\\\\'M.ciniki_musicfestivals_main.competitor.open();\\\\',\\\\'' + d.id + '\\\\');\\\");';\\n }\\n if( s == 'emails' ) {\\n return 'M.startApp(\\\\'ciniki.mail.main\\\\',null,\\\\'M.ciniki_musicfestivals_main.competitor.reopen();\\\\',\\\\'mc\\\\',{\\\\'message_id\\\\':\\\\'' + d.id + '\\\\'});';\\n }\\n return '';\\n }\\n this.competitor.addmessage = function() {\\n M.ciniki_musicfestivals_main.message.addnew('M.ciniki_musicfestivals_main.competitor.open();',this.festival_id,'ciniki.musicfestivals.competitor',this.competitor_id);\\n }\\n this.competitor.reopen = function() {\\n this.show();\\n }\\n this.competitor.open = function(cb, cid, fid, list, bci) {\\n if( cid != null ) { this.competitor_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n if( bci != null ) { this.billing_customer_id = bci; }\\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id, 'emails':'yes', 'registrations':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.competitor;\\n p.data = rsp.competitor;\\n if( p.competitor_id == 0 ) {\\n p.sections._tabs.selected = 'contact';\\n p.sections._tabs.visible = 'no';\\n } else {\\n p.sections._tabs.visible = 'yes';\\n }\\n p.sections._ctype.selected = rsp.competitor.ctype;\\n p.refresh();\\n p.show(cb);\\n p.switchType(p.sections._ctype.selected);\\n });\\n }\\n this.competitor.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.competitor.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.competitor_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( this.sections._ctype.selected != this.data.ctype ) {\\n c += '&ctype=' + this.sections._ctype.selected;\\n }\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.competitorUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n c += '&ctype=' + this.sections._ctype.selected;\\n M.api.postJSONCb('ciniki.musicfestivals.competitorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'billing_customer_id':this.billing_customer_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.competitor.competitor_name = rsp.name;\\n M.ciniki_musicfestivals_main.competitor.competitor_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.competitor.remove = function() {\\n M.confirm('Are you sure you want to remove competitor?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.competitorDelete', {'tnid':M.curTenantID, 'competitor_id':M.ciniki_musicfestivals_main.competitor.competitor_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.competitor.close();\\n });\\n });\\n }\\n this.competitor.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.competitor.save(\\\\'M.ciniki_musicfestivals_main.competitor.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.competitor.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.competitor.save(\\\\'M.ciniki_musicfestivals_main.competitor_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.competitor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.competitor.save();');\\n this.competitor.addClose('Cancel');\\n this.competitor.addButton('next', 'Next');\\n this.competitor.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Section\\n //\\n this.schedulesection = new M.panel('Schedule Section', 'ciniki_musicfestivals_main', 'schedulesection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.schedulesection');\\n this.schedulesection.data = null;\\n this.schedulesection.festival_id = 0;\\n this.schedulesection.schedulesection_id = 0;\\n this.schedulesection.nplist = [];\\n this.schedulesection.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'flags':{'label':'Options', 'type':'flags', 'flags':{\\n '1':{'name':'Release Schedule'},\\n '2':{'name':'Release Comments'},\\n '3':{'name':'Release Certificates'},\\n }},\\n }},\\n 'adjudicators':{'label':'Adjudicators', 'fields':{\\n 'adjudicator1_id':{'label':'First', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\\n 'adjudicator2_id':{'label':'Second', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\\n 'adjudicator3_id':{'label':'Third', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.schedulesection.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.schedulesection.schedulesection_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.schedulesection.remove();'},\\n }},\\n };\\n this.schedulesection.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.schedulesection.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleSectionHistory', 'args':{'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'field':i}};\\n }\\n this.schedulesection.downloadPDF = function(f,i,n) {\\n M.api.openFile('ciniki.musicfestivals.schedulePDF',{'tnid':M.curTenantID, 'festival_id':f, 'schedulesection_id':i, 'names':n});\\n }\\n this.schedulesection.open = function(cb, sid, fid, list) {\\n if( sid != null ) { this.schedulesection_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionGet', \\n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.schedulesection;\\n p.data = rsp.schedulesection;\\n rsp.adjudicators.unshift({'id':'0', 'name':'None'});\\n p.sections.adjudicators.fields.adjudicator1_id.options = rsp.adjudicators;\\n p.sections.adjudicators.fields.adjudicator2_id.options = rsp.adjudicators;\\n p.sections.adjudicators.fields.adjudicator3_id.options = rsp.adjudicators;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.schedulesection.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.schedulesection.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.schedulesection_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionUpdate', \\n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.schedulesection.schedulesection_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.schedulesection.remove = function() {\\n M.confirm('Are you sure you want to remove this section?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionDelete', {'tnid':M.curTenantID, 'schedulesection_id':M.ciniki_musicfestivals_main.schedulesection.schedulesection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.schedulesection.close();\\n });\\n });\\n }\\n this.schedulesection.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\\\'M.ciniki_musicfestivals_main.schedulesection.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.schedulesection.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\\\'M.ciniki_musicfestivals_main.schedulesection_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.schedulesection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.schedulesection.save();');\\n this.schedulesection.addClose('Cancel');\\n this.schedulesection.addButton('next', 'Next');\\n this.schedulesection.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Division\\n //\\n this.scheduledivision = new M.panel('Schedule Division', 'ciniki_musicfestivals_main', 'scheduledivision', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.scheduledivision');\\n this.scheduledivision.data = null;\\n this.scheduledivision.festival_id = 0;\\n this.scheduledivision.ssection_id = 0;\\n this.scheduledivision.scheduledivision_id = 0;\\n this.scheduledivision.nplist = [];\\n this.scheduledivision.sections = {\\n 'general':{'label':'', 'fields':{\\n 'ssection_id':{'label':'Section', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'division_date':{'label':'Date', 'required':'yes', 'type':'date'},\\n 'address':{'label':'Address', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduledivision.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.scheduledivision.remove();'},\\n }},\\n };\\n this.scheduledivision.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.scheduledivision.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleDivisionHistory', 'args':{'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'field':i}};\\n }\\n this.scheduledivision.open = function(cb, sid, ssid, fid, list) {\\n if( sid != null ) { this.scheduledivision_id = sid; }\\n if( ssid != null ) { this.ssection_id = ssid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionGet', \\n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id, 'ssection_id':this.ssection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.scheduledivision;\\n p.data = rsp.scheduledivision;\\n p.sections.general.fields.ssection_id.options = rsp.schedulesections;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.scheduledivision.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduledivision.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.scheduledivision_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionUpdate', \\n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.scheduledivision.remove = function() {\\n M.confirm('Are you sure you want to remove this division?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionDelete', {'tnid':M.curTenantID, 'scheduledivision_id':M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduledivision.close();\\n });\\n });\\n }\\n this.scheduledivision.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\\\'M.ciniki_musicfestivals_main.scheduledivision.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduledivision.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\\\'M.ciniki_musicfestivals_main.scheduledivision_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduledivision.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduledivision.save();');\\n this.scheduledivision.addClose('Cancel');\\n this.scheduledivision.addButton('next', 'Next');\\n this.scheduledivision.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Time Slot\\n //\\n this.scheduletimeslot = new M.panel('Schedule Time Slot', 'ciniki_musicfestivals_main', 'scheduletimeslot', 'mc', 'xlarge', 'sectioned', 'ciniki.musicfestivals.main.scheduletimeslot');\\n this.scheduletimeslot.data = null;\\n this.scheduletimeslot.festival_id = 0;\\n this.scheduletimeslot.scheduletimeslot_id = 0;\\n this.scheduletimeslot.sdivision_id = 0;\\n this.scheduletimeslot.nplist = [];\\n this.scheduletimeslot.sections = {\\n 'general':{'label':'', 'fields':{\\n 'sdivision_id':{'label':'Division', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'slot_time':{'label':'Time', 'required':'yes', 'type':'text', 'size':'small'},\\n 'class1_id':{'label':'Class 1', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class2_id':{'label':'Class 2', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class3_id':{'label':'Class 3', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class4_id':{'label':'Class 4', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class5_id':{'label':'Class 5', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'name':{'label':'Name', 'type':'text'},\\n }},\\n '_options':{'label':'',\\n 'visible':function() {\\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\\n var c1 = p.formValue('class1_id');\\n var c2 = p.formValue('class2_id');\\n var c3 = p.formValue('class3_id');\\n var c4 = p.formValue('class4_id');\\n var c5 = p.formValue('class5_id');\\n// if( c1 == null && p.data.class1_id > 0 && p.data.class2_id == 0 && p.data.class3_id == 0 && p.data.class4_id == 0 && p.data.class5_id == 0 ) { return 'yes'; }\\n if( c1 == null && p.data.class1_id > 0 ) { \\n return 'yes'; \\n }\\n// return (c1 != null && c1 > 0 && (c2 == null || c2 == 0) && (c3 == null || c3 == 0) ? 'yes' : 'hidden');\\n return (c1 != null && c1 > 0 ? 'yes' : 'hidden');\\n },\\n 'fields':{\\n 'flags1':{'label':'Split Class', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags', \\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n }},\\n '_registrations1':{'label':'Class 1 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations1':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[], \\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations2':{'label':'Class 2 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations2':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations3':{'label':'Class 3 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations3':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations4':{'label':'Class 4 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations4':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations5':{'label':'Class 5 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations5':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_sorting1':{'label':'Class 1 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting2':{'label':'Class 2 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting3':{'label':'Class 3 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting4':{'label':'Class 4 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting5':{'label':'Class 5 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_description':{'label':'Description', 'fields':{\\n 'description':{'label':'Description', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.remove();'},\\n }},\\n };\\n this.scheduletimeslot.fieldValue = function(s, i, d) { \\n if( i == 'registrations1' || i == 'registrations2' || i == 'registrations3' || i == 'registrations4' || i == 'registrations5' ) {\\n return this.data.registrations;\\n }\\n return this.data[i]; \\n }\\n this.scheduletimeslot.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'field':i}};\\n }\\n this.scheduletimeslot.updateRegistrations = function() {\\n var c1_id = this.formValue('class1_id');\\n var c2_id = this.formValue('class2_id');\\n var c3_id = this.formValue('class3_id');\\n var c4_id = this.formValue('class4_id');\\n var c5_id = this.formValue('class5_id');\\n this.sections._registrations1.visible = 'hidden';\\n this.sections._registrations2.visible = 'hidden';\\n this.sections._registrations3.visible = 'hidden';\\n this.sections._registrations4.visible = 'hidden';\\n this.sections._registrations5.visible = 'hidden';\\n if( this.formValue('flags1') == 'on' && this.formValue('class1_id') > 0 && this.data.classes != null ) {\\n for(var i in this.data.classes) {\\n if( this.data.classes[i].id == c1_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations1.visible = 'yes';\\n this.sections._registrations1.fields.registrations1.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c2_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations2.visible = 'yes';\\n this.sections._registrations2.fields.registrations2.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c3_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations3.visible = 'yes';\\n this.sections._registrations3.fields.registrations3.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c4_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations4.visible = 'yes';\\n this.sections._registrations4.fields.registrations4.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c5_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations5.visible = 'yes';\\n this.sections._registrations5.fields.registrations5.list = this.data.classes[i].registrations;\\n }\\n }\\n }\\n }\\n this.showHideSection('_registrations1');\\n this.showHideSection('_registrations2');\\n this.showHideSection('_registrations3');\\n this.showHideSection('_registrations4');\\n this.showHideSection('_registrations5');\\n if( this.sections._registrations1.visible == 'yes' ) {\\n this.refreshSection('_registrations1');\\n }\\n if( this.sections._registrations2.visible == 'yes' ) {\\n this.refreshSection('_registrations2');\\n }\\n if( this.sections._registrations3.visible == 'yes' ) {\\n this.refreshSection('_registrations3');\\n }\\n if( this.sections._registrations4.visible == 'yes' ) {\\n this.refreshSection('_registrations4');\\n }\\n if( this.sections._registrations5.visible == 'yes' ) {\\n this.refreshSection('_registrations5');\\n }\\n this.updateSorting();\\n }\\n this.scheduletimeslot.updateSorting = function() {\\n var c1_id = this.formValue('class1_id');\\n var c2_id = this.formValue('class2_id');\\n var c3_id = this.formValue('class3_id');\\n var c4_id = this.formValue('class4_id');\\n var c5_id = this.formValue('class5_id');\\n // Update the class registrations\\n this.sections._sorting1.fields = {};\\n this.sections._sorting2.fields = {};\\n this.sections._sorting3.fields = {};\\n this.sections._sorting4.fields = {};\\n this.sections._sorting5.fields = {};\\n this.sections._sorting1.visible = 'hidden';\\n this.sections._sorting2.visible = 'hidden';\\n this.sections._sorting3.visible = 'hidden';\\n this.sections._sorting4.visible = 'hidden';\\n this.sections._sorting5.visible = 'hidden';\\n for(var i in this.data.classes) {\\n if( c1_id > 0 && this.data.classes[i].id == c1_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations1');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting1.visible = 'yes';\\n this.sections._sorting1.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c2_id > 0 && this.data.classes[i].id == c2_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations2');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting2.visible = 'yes';\\n this.sections._sorting2.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c3_id > 0 && this.data.classes[i].id == c3_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations3');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting3.visible = 'yes';\\n this.sections._sorting3.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c4_id > 0 && this.data.classes[i].id == c4_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations4');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting4.visible = 'yes';\\n this.sections._sorting4.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c5_id > 0 && this.data.classes[i].id == c5_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations5');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting5.visible = 'yes';\\n this.sections._sorting5.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n }\\n this.showHideSection('_options');\\n this.refreshSection('_sorting1');\\n this.refreshSection('_sorting2');\\n this.refreshSection('_sorting3');\\n this.refreshSection('_sorting4');\\n this.refreshSection('_sorting5');\\n this.showHideSection('_sorting1');\\n this.showHideSection('_sorting2');\\n this.showHideSection('_sorting3');\\n this.showHideSection('_sorting4');\\n this.showHideSection('_sorting5'); \\n return true;\\n }\\n this.scheduletimeslot.open = function(cb, sid, did, fid, list) {\\n if( sid != null ) { this.scheduletimeslot_id = sid; }\\n if( did != null ) { this.sdivision_id = did; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotGet', \\n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id, 'sdivision_id':this.sdivision_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\\n p.data = rsp.scheduletimeslot;\\n p.data.classes = rsp.classes;\\n p.sections.general.fields.sdivision_id.options = rsp.scheduledivisions;\\n rsp.classes.unshift({'id':0, 'name':'No Class'});\\n p.sections.general.fields.class1_id.options = rsp.classes;\\n p.sections.general.fields.class2_id.options = rsp.classes;\\n p.sections.general.fields.class3_id.options = rsp.classes;\\n p.sections.general.fields.class4_id.options = rsp.classes;\\n p.sections.general.fields.class5_id.options = rsp.classes;\\n/* p.sections._registrations1.visible = 'hidden';\\n if( rsp.scheduletimeslot.class1_id > 0 && rsp.classes != null ) {\\n for(var i in rsp.classes) {\\n if( rsp.classes[i].id == rsp.scheduletimeslot.class1_id ) {\\n if( rsp.classes[i].registrations != null ) {\\n if( (rsp.scheduletimeslot.flags&0x01) > 0 ) {\\n p.sections._registrations1.visible = 'yes';\\n }\\n p.sections._registrations1.fields.registrations1.list = rsp.classes[i].registrations;\\n }\\n }\\n }\\n } */\\n p.refresh();\\n p.show(cb);\\n p.updateRegistrations();\\n });\\n }\\n this.scheduletimeslot.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduletimeslot.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.scheduletimeslot_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotUpdate', \\n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.scheduletimeslot.remove = function() {\\n M.confirm('Are you sure you want to remove timeslot?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotDelete', {'tnid':M.curTenantID, 'scheduletimeslot_id':M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduletimeslot.close();\\n });\\n });\\n }\\n this.scheduletimeslot.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\\\'M.ciniki_musicfestivals_main.scheduletimeslot.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduletimeslot.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\\\'M.ciniki_musicfestivals_main.scheduletimeslot_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduletimeslot.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduletimeslot.save();');\\n this.scheduletimeslot.addClose('Cancel');\\n this.scheduletimeslot.addButton('next', 'Next');\\n this.scheduletimeslot.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Time Slot Comments\\n //\\n this.timeslotcomments = new M.panel('Comments', 'ciniki_musicfestivals_main', 'timeslotcomments', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotcomments');\\n this.timeslotcomments.data = null;\\n this.timeslotcomments.festival_id = 0;\\n this.timeslotcomments.timeslot_id = 0;\\n this.timeslotcomments.nplist = [];\\n this.timeslotcomments.sections = {};\\n this.timeslotcomments.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.timeslotcomments.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.timeslot_id, 'field':i}};\\n }\\n this.timeslotcomments.cellValue = function(s, i, j, d) {\\n switch(j) {\\n case 0 : return d.label;\\n case 1 : return d.value;\\n }\\n }\\n this.timeslotcomments.open = function(cb, tid, fid, list) {\\n if( tid != null ) { this.timeslot_id = tid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsGet', \\n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.timeslotcomments;\\n p.data = rsp.timeslot;\\n p.sections = {};\\n for(var i in rsp.timeslot.registrations) {\\n var registration = rsp.timeslot.registrations[i];\\n p.sections['details_' + i] = {'label':'Registration', 'type':'simplegrid', 'num_cols':2, 'aside':'yes'};\\n p.data['details_' + i] = [\\n {'label':'Class', 'value':registration.reg_class_name},\\n {'label':'Participant', 'value':registration.name},\\n {'label':'Title', 'value':registration.title1},\\n {'label':'Video', 'value':M.hyperlink(registration.video_url1)},\\n {'label':'Music', 'value':registration.music_orgfilename1},\\n ];\\n if( (registration.reg_flags&0x1000) == 0x1000 ) {\\n p.data['details_' + i].push({'label':'2nd Title', 'value':registration.title2});\\n p.data['details_' + i].push({'label':'2nd Video', 'value':M.hyperlink(registration.video_url2)});\\n p.data['details_' + i].push({'label':'2nd Music', 'value':registration.music_orgfilename2});\\n }\\n if( (registration.reg_flags&0x4000) == 0x4000 ) {\\n p.data['details_' + i].push({'label':'3rd Title', 'value':registration.title3});\\n p.data['details_' + i].push({'label':'3rd Video', 'value':M.hyperlink(registration.video_url3)});\\n p.data['details_' + i].push({'label':'3rd Music', 'value':registration.music_orgfilename3});\\n }\\n // \\n // Setup the comment, grade & score fields, could be for multiple adjudicators\\n //\\n for(var j in rsp.adjudicators) {\\n p.sections['comments_' + i] = {'label':rsp.adjudicators[j].display_name, 'fields':{}};\\n p.sections['comments_' + i].fields['comments_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n 'label':'Comments', \\n 'type':'textarea', \\n 'size':'large',\\n };\\n// p.sections['comments_' + i].fields['grade_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n// 'label':'Grade', \\n// 'type':'text', \\n// 'size':'small',\\n// };\\n p.sections['comments_' + i].fields['score_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n 'label':'Mark', \\n 'type':'text', \\n 'size':'small',\\n };\\n/* if( M.modFlagOn('ciniki.musicfestivals', 0x08) ) {\\n p.sections['comments_' + i].fields['placement_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n 'label':'Placement', \\n 'type':'text', \\n 'size':'large',\\n };\\n }*/\\n }\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.timeslotcomments.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotcomments.close();'; }\\n if( !this.checkForm() ) { return false; }\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsUpdate', \\n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n }\\n this.timeslotcomments.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotcomments.save();');\\n this.timeslotcomments.addClose('Cancel');\\n\\n\\n //\\n // Adjudicators\\n //\\n this.adjudicator = new M.panel('Adjudicator', 'ciniki_musicfestivals_main', 'adjudicator', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.adjudicator');\\n this.adjudicator.data = null;\\n this.adjudicator.festival_id = 0;\\n this.adjudicator.adjudicator_id = 0;\\n this.adjudicator.customer_id = 0;\\n this.adjudicator.nplist = [];\\n this.adjudicator.sections = {\\n '_image_id':{'label':'Adjudicator Photo', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }}, \\n 'customer_details':{'label':'Adjudicator', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\\\',\\\\'customer_id\\\\':M.ciniki_musicfestivals_main.adjudicator.data.customer_id});',\\n 'changeTxt':'Change customer',\\n 'changeFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\\\',\\\\'customer_id\\\\':0});',\\n },\\n '_discipline':{'label':'Discipline', 'fields':{\\n 'discipline':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_description':{'label':'Full Bio', 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'xlarge'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.adjudicator.save();'},\\n 'delete':{'label':'Remove Adjudicator', \\n 'visible':function() {return M.ciniki_musicfestivals_main.adjudicator.adjudicator_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.adjudicator.remove();'},\\n }},\\n };\\n this.adjudicator.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.adjudicator.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.adjudicatorHistory', 'args':{'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id, 'field':i}};\\n }\\n this.adjudicator.cellValue = function(s, i, j, d) {\\n if( s == 'customer_details' && j == 0 ) { return d.detail.label; }\\n if( s == 'customer_details' && j == 1 ) {\\n if( d.detail.label == 'Email' ) {\\n return M.linkEmail(d.detail.value);\\n } else if( d.detail.label == 'Address' ) {\\n return d.detail.value.replace(/\\\\n/g, '
            ');\\n }\\n return d.detail.value;\\n }\\n };\\n this.adjudicator.open = function(cb, aid, cid, fid, list) {\\n if( cb != null ) { this.cb = cb; }\\n if( aid != null ) { this.adjudicator_id = aid; }\\n if( cid != null ) { this.customer_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n if( aid != null && aid == 0 && cid != null && cid == 0 ) {\\n M.startApp('ciniki.customers.edit',null,this.cb,'mc',{'next':'M.ciniki_musicfestivals_main.adjudicator.openCustomer', 'customer_id':0});\\n return true;\\n }\\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorGet', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'adjudicator_id':this.adjudicator_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.adjudicator;\\n p.data = rsp.adjudicator;\\n if( rsp.adjudicator.id > 0 ) {\\n p.festival_id = rsp.adjudicator.festival_id;\\n }\\n p.customer_id = rsp.adjudicator.customer_id;\\n if( p.customer_id == 0 ) {\\n p.sections.customer_details.addTxt = '';\\n p.sections.customer_details.changeTxt = 'Add';\\n } else {\\n p.sections.customer_details.addTxt = 'Edit';\\n p.sections.customer_details.changeTxt = 'Change';\\n }\\n p.refresh();\\n p.show();\\n });\\n }\\n this.adjudicator.openCustomer = function(cid) {\\n this.open(null,null,cid);\\n }\\n this.adjudicator.updateCustomer = function(cid) {\\n if( cid != null ) { this.customer_id = cid; }\\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.customer_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.adjudicator;\\n p.data.customer_details = rsp.details;\\n if( p.customer_id == 0 ) {\\n p.sections.customer_details.addTxt = '';\\n p.sections.customer_details.changeTxt = 'Add';\\n } else {\\n p.sections.customer_details.addTxt = 'Edit';\\n p.sections.customer_details.changeTxt = 'Change';\\n }\\n p.refreshSection('customer_details');\\n p.show();\\n });\\n }\\n this.adjudicator.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.adjudicator.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.adjudicator_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorUpdate', {'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorAdd', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.adjudicator.adjudicator_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.adjudicator.remove = function() {\\n M.confirm('Are you sure you want to remove adjudicator?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorDelete', {'tnid':M.curTenantID, 'adjudicator_id':M.ciniki_musicfestivals_main.adjudicator.adjudicator_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.adjudicator.close();\\n });\\n });\\n }\\n this.adjudicator.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\\\'M.ciniki_musicfestivals_main.adjudicator.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.adjudicator.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\\\'M.ciniki_musicfestivals_main.adjudicator_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.adjudicator.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.adjudicator.save();');\\n this.adjudicator.addClose('Cancel');\\n this.adjudicator.addButton('next', 'Next');\\n this.adjudicator.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to display the add form\\n //\\n this.addfile = new M.panel('Add File', 'ciniki_musicfestivals_main', 'addfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.addfile');\\n this.addfile.default_data = {'type':'20'};\\n this.addfile.festival_id = 0;\\n this.addfile.data = {}; \\n this.addfile.sections = {\\n '_file':{'label':'File', 'fields':{\\n 'uploadfile':{'label':'', 'type':'file', 'hidelabel':'yes'},\\n }},\\n 'info':{'label':'Information', 'type':'simpleform', 'fields':{\\n 'name':{'label':'Title', 'type':'text'},\\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\\n }},\\n '_save':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.addfile.save();'},\\n }},\\n };\\n this.addfile.fieldValue = function(s, i, d) { \\n if( this.data[i] != null ) { return this.data[i]; } \\n return ''; \\n };\\n this.addfile.open = function(cb, eid) {\\n this.reset();\\n this.data = {'name':''};\\n this.file_id = 0;\\n this.festival_id = eid;\\n this.refresh();\\n this.show(cb);\\n };\\n this.addfile.save = function() {\\n var c = this.serializeFormData('yes');\\n if( c != '' ) {\\n M.api.postJSONFormData('ciniki.musicfestivals.fileAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c,\\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.addfile.file_id = rsp.id;\\n M.ciniki_musicfestivals_main.addfile.close();\\n });\\n } else {\\n this.close();\\n }\\n };\\n this.addfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.addfile.save();');\\n this.addfile.addClose('Cancel');\\n\\n //\\n // The panel to display the edit form\\n //\\n this.editfile = new M.panel('File', 'ciniki_musicfestivals_main', 'editfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.info.editfile');\\n this.editfile.file_id = 0;\\n this.editfile.data = null;\\n this.editfile.sections = {\\n 'info':{'label':'Details', 'type':'simpleform', 'fields':{\\n 'name':{'label':'Title', 'type':'text'},\\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\\n }},\\n '_save':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editfile.save();'},\\n 'download':{'label':'Download', 'fn':'M.ciniki_musicfestivals_main.editfile.download(M.ciniki_musicfestivals_main.editfile.file_id);'},\\n 'delete':{'label':'Delete', 'fn':'M.ciniki_musicfestivals_main.editfile.remove();'},\\n }},\\n };\\n this.editfile.fieldValue = function(s, i, d) { \\n return this.data[i]; \\n }\\n this.editfile.sectionData = function(s) {\\n return this.data[s];\\n };\\n this.editfile.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.fileHistory', 'args':{'tnid':M.curTenantID, 'file_id':this.file_id, 'field':i}};\\n };\\n this.editfile.open = function(cb, fid) {\\n if( fid != null ) { this.file_id = fid; }\\n M.api.getJSONCb('ciniki.musicfestivals.fileGet', {'tnid':M.curTenantID, 'file_id':this.file_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.editfile;\\n p.data = rsp.file;\\n p.refresh();\\n p.show(cb);\\n });\\n };\\n this.editfile.save = function() {\\n var c = this.serializeFormData('no');\\n if( c != '' ) {\\n M.api.postJSONFormData('ciniki.musicfestivals.fileUpdate', {'tnid':M.curTenantID, 'file_id':this.file_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.editfile.close();\\n });\\n }\\n };\\n this.editfile.remove = function() {\\n M.confirm('Are you sure you want to delete \\\\'' + this.data.name + '\\\\'? All information about it will be removed and unrecoverable.',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.fileDelete', {'tnid':M.curTenantID, 'file_id':M.ciniki_musicfestivals_main.editfile.file_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.editfile.close();\\n });\\n });\\n };\\n this.editfile.download = function(fid) {\\n M.api.openFile('ciniki.musicfestivals.fileDownload', {'tnid':M.curTenantID, 'file_id':fid});\\n };\\n this.editfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editfile.save();');\\n this.editfile.addClose('Cancel');\\n\\n //\\n // The panel to email a teacher their list of registrations\\n //\\n this.emailregistrations = new M.panel('Email Registrations', 'ciniki_musicfestivals_main', 'emailregistrations', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.emailregistrations');\\n this.emailregistrations.data = {};\\n this.emailregistrations.sections = {\\n '_subject':{'label':'', 'type':'simpleform', 'aside':'yes', 'fields':{\\n 'subject':{'label':'Subject', 'type':'text'},\\n }},\\n '_message':{'label':'Message', 'type':'simpleform', 'aside':'yes', 'fields':{\\n 'message':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n '_save':{'label':'', 'aside':'yes', 'buttons':{\\n 'send':{'label':'Send', 'fn':'M.ciniki_musicfestivals_main.emailregistrations.send();'},\\n }},\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\\n 'headerValues':['Class', 'Registrant', 'Title', 'Time', 'Virtual'],\\n 'cellClasses':['', '', '', '', ''],\\n },\\n };\\n this.emailregistrations.fieldValue = function(s, i, d) { return ''; }\\n this.emailregistrations.cellValue = function(s, i, j, d) {\\n if( s == 'registrations' ) {\\n switch (j) {\\n case 0: return d.class_code;\\n case 1: return d.display_name;\\n case 2: return d.title1;\\n case 3: return d.perf_time1;\\n case 4: return (d.participation == 1 ? 'Virtual' : 'In Person');\\n }\\n }\\n }\\n this.emailregistrations.open = function(cb, reg) {\\n this.sections.registrations.label = M.ciniki_musicfestivals_main.festival.sections.registrations.label;\\n this.data.registrations = M.ciniki_musicfestivals_main.festival.data.registrations;\\n this.refresh();\\n this.show(cb);\\n };\\n this.emailregistrations.send = function() {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.registrationsEmailSend', \\n {'tnid':M.curTenantID, 'teacher_id':M.ciniki_musicfestivals_main.festival.teacher_customer_id, 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id}, c, \\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.emailregistrations.close();\\n });\\n }\\n this.emailregistrations.addButton('send', 'Send', 'M.ciniki_musicfestivals_main.emailregistrations.send();');\\n this.emailregistrations.addClose('Cancel');\\n\\n //\\n // The panel to edit Sponsor\\n //\\n this.sponsor = new M.panel('Sponsor', 'ciniki_musicfestivals_main', 'sponsor', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.sponsor');\\n this.sponsor.data = null;\\n this.sponsor.festival_id = 0;\\n this.sponsor.sponsor_id = 0;\\n this.sponsor.nplist = [];\\n this.sponsor.sections = {\\n '_image_id':{'label':'Logo', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.sponsor.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.sponsor.setFieldValue(fid, 0);\\n return true;\\n },\\n },\\n }},\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'url':{'label':'Website', 'type':'text'},\\n 'sequence':{'label':'Order', 'type':'text', 'size':'small'},\\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Level 1'}, '2':{'name':'Level 2'}}},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.sponsor.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.sponsor.sponsor_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.sponsor.remove();'},\\n }},\\n };\\n this.sponsor.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.sponsor.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.sponsorHistory', 'args':{'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'field':i}};\\n }\\n this.sponsor.open = function(cb, sid, fid) {\\n if( sid != null ) { this.sponsor_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n M.api.getJSONCb('ciniki.musicfestivals.sponsorGet', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.sponsor;\\n p.data = rsp.sponsor;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.sponsor.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.sponsor.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.sponsor_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.sponsorUpdate', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.sponsorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.sponsor.sponsor_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.sponsor.remove = function() {\\n M.confirm('Are you sure you want to remove sponsor?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.sponsorDelete', {'tnid':M.curTenantID, 'sponsor_id':M.ciniki_musisfestivals_main.sponsor.sponsor_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.sponsor.close();\\n });\\n });\\n }\\n this.sponsor.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.sponsor.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.sponsor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.sponsor.save();');\\n this.sponsor.addClose('Cancel');\\n this.sponsor.addButton('next', 'Next');\\n this.sponsor.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Time Slot Image\\n //\\n this.timeslotimage = new M.panel('Schedule Time Slot Image', 'ciniki_musicfestivals_main', 'timeslotimage', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotimage');\\n this.timeslotimage.data = null;\\n this.timeslotimage.timeslot_image_id = 0;\\n this.timeslotimage.nplist = [];\\n this.timeslotimage.sections = {\\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.timeslotimage.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n },\\n }},\\n 'general':{'label':'', 'fields':{\\n 'title':{'label':'Title', 'type':'text'},\\n 'flags':{'label':'Options', 'type':'text'},\\n 'sequence':{'label':'Order', 'type':'text'},\\n }},\\n '_description':{'label':'Description', 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.timeslotimage.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.timeslotimage.remove();'},\\n }},\\n };\\n this.timeslotimage.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.timeslotimage.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.timeslotImageHistory', 'args':{'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id, 'field':i}};\\n }\\n this.timeslotimage.open = function(cb, tid, list) {\\n if( tid != null ) { this.timeslot_image_id = tid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageGet', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.timeslotimage;\\n p.data = rsp.image;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.timeslotimage.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotimage.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.timeslot_image_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageUpdate', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageAdd', {'tnid':M.curTenantID}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.timeslotimage.remove = function() {\\n M.confirm('Are you sure you want to remove timeslotimage?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageDelete', {'tnid':M.curTenantID, 'timeslot_image_id':M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.timeslotimage.close();\\n });\\n });\\n }\\n this.timeslotimage.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.timeslotimage.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.timeslotimage.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotimage.save();');\\n this.timeslotimage.addClose('Cancel');\\n this.timeslotimage.addButton('next', 'Next');\\n this.timeslotimage.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit a List\\n //\\n this.list = new M.panel('List', 'ciniki_musicfestivals_main', 'list', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.list');\\n this.list.data = null;\\n this.list.list_id = 0;\\n this.list.festival_id = 0;\\n this.list.nplist = [];\\n this.list.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'category':{'label':'Category', 'required':'yes', 'type':'text'},\\n }},\\n '_intro':{'label':'Introduction', 'fields':{\\n 'intro':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.list.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.list.list_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.list.remove();'},\\n }},\\n };\\n this.list.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.list.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.listHistory', 'args':{'tnid':M.curTenantID, 'list_id':this.list_id, 'field':i}};\\n }\\n this.list.open = function(cb, lid, fid, list) {\\n if( lid != null ) { this.list_id = lid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.listGet', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.list;\\n p.data = rsp.list;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.list.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.list.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.list_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.listUpdate', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.listAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.list.list_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.list.remove = function() {\\n M.confirm('Are you sure you want to remove list?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.listDelete', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.list.close();\\n });\\n });\\n }\\n this.list.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.list.save(\\\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.list.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.list.save(\\\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.list.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.list.save();');\\n this.list.addClose('Cancel');\\n this.list.addButton('next', 'Next');\\n this.list.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit List Section\\n //\\n this.listsection = new M.panel('List Section', 'ciniki_musicfestivals_main', 'listsection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listsection');\\n this.listsection.data = null;\\n this.listsection.list_id = 0;\\n this.listsection.listsection_id = 0;\\n this.listsection.nplist = [];\\n this.listsection.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'sequence':{'label':'Order', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listsection.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.listsection.listsection_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.listsection.remove();'},\\n }},\\n };\\n this.listsection.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.listsection.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.listSectionHistory', 'args':{'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'field':i}};\\n }\\n this.listsection.open = function(cb, lid, list_id, list) {\\n if( lid != null ) { this.listsection_id = lid; }\\n if( list_id != null ) { this.list_id = list_id; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.listSectionGet', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'list_id':this.list_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.listsection;\\n p.data = rsp.listsection;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.listsection.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listsection.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.listsection_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.listSectionUpdate', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.listSectionAdd', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listsection.listsection_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.listsection.remove = function() {\\n M.confirm('Are you sure you want to remove listsection?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.listSectionDelete', {'tnid':M.curTenantID, 'listsection_id':M.ciniki_musicfestivals_main.listsection.listsection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listsection.close();\\n });\\n });\\n }\\n this.listsection.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.listsection.save(\\\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listsection.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.listsection.save(\\\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listsection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listsection.save();');\\n this.listsection.addClose('Cancel');\\n this.listsection.addButton('next', 'Next');\\n this.listsection.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit List Entry\\n //\\n this.listentry = new M.panel('List Entry', 'ciniki_musicfestivals_main', 'listentry', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listentry');\\n this.listentry.data = null;\\n this.listentry.listsection_id = 0;\\n this.listentry.listentry_id = 0;\\n this.listentry.nplist = [];\\n this.listentry.sections = {\\n 'general':{'label':'List Entry', 'fields':{\\n 'sequence':{'label':'Number', 'type':'text'},\\n 'award':{'label':'Award', 'type':'text'},\\n 'amount':{'label':'Amount', 'type':'text'},\\n 'donor':{'label':'Donor', 'type':'text'},\\n 'winner':{'label':'Winner', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listentry.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.listentry.listentry_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.listentry.remove();'},\\n }},\\n };\\n this.listentry.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.listentry.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.listEntryHistory', 'args':{'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'field':i}};\\n }\\n this.listentry.open = function(cb, lid, sid, list) {\\n if( lid != null ) { this.listentry_id = lid; }\\n if( sid != null ) { this.listsection_id = sid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.listEntryGet', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'section_id':this.listsection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.listentry;\\n p.data = rsp.listentry;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.listentry.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listentry.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.listentry_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.listEntryUpdate', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.listEntryAdd', {'tnid':M.curTenantID, 'section_id':this.listsection_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listentry.listentry_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.listentry.remove = function() {\\n M.confirm('Are you sure you want to remove listentry?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.listEntryDelete', {'tnid':M.curTenantID, 'listentry_id':M.ciniki_musicfestivals_main.listentry.listentry_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listentry.close();\\n });\\n });\\n }\\n this.listentry.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.listentry.save(\\\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listentry.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.listentry.save(\\\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listentry.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listentry.save();');\\n this.listentry.addClose('Cancel');\\n this.listentry.addButton('next', 'Next');\\n this.listentry.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Certificate\\n //\\n this.certificate = new M.panel('Certificate', 'ciniki_musicfestivals_main', 'certificate', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.certificate');\\n this.certificate.data = null;\\n this.certificate.festival_id = 0;\\n this.certificate.certificate_id = 0;\\n this.certificate.nplist = [];\\n this.certificate.sections = {\\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.certificate.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n },\\n }},\\n 'general':{'label':'Certificate', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'orientation':{'label':'Orientation', 'type':'toggle', 'toggles':{'L':'Landscape', 'P':'Portrait'}},\\n// FIXME: Add section support and min score support\\n// 'section_id':{'label':'Section', 'type':'select', 'options':{}, 'complex_options':{'name':'name', 'value':'id'}},\\n// 'min_score':{'label':'Minimum Score', 'type':'text', 'size':'small'},\\n }},\\n 'fields':{'label':'Auto Filled Fields', 'type':'simplegrid', 'num_cols':1,\\n 'addTxt':'Add Field',\\n 'addFn':'M.ciniki_musicfestivals_main.certificate.save(\\\"M.ciniki_musicfestivals_main.certfield.open(\\\\'M.ciniki_musicfestivals_main.certificate.open();\\\\',0,M.ciniki_musicfestivals_main.certificate.certificate_id);\\\");',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certificate.save();'},\\n 'download':{'label':'Generate Test', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTestOutlines();',\\n },\\n 'download2':{'label':'Generate Test No Outlines', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTest();',\\n },\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certificate.remove();',\\n },\\n }},\\n };\\n this.certificate.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.certificate.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.certificateHistory', 'args':{'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'field':i}};\\n }\\n this.certificate.cellValue = function(s, i, j, d) {\\n if( s == 'fields' ) {\\n switch(j) {\\n case 0: return d.name;\\n }\\n }\\n }\\n this.certificate.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.certificate.save(\\\"M.ciniki_musicfestivals_main.certfield.open(\\\\'M.ciniki_musicfestivals_main.certificate.open();\\\\',' + d.id + ',M.ciniki_musicfestivals_main.certificate.certificate_id);\\\");';\\n }\\n this.certificate.open = function(cb, cid, fid, list) {\\n if( cid != null ) { this.certificate_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.certificate;\\n p.data = rsp.certificate;\\n// p.sections.general.fields.section_id.options = rsp.sections;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.certificate.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certificate.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.certificate_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.certificateUpdate', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.certificateAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certificate.certificate_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.certificate.generateTestOutlines = function() {\\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf', 'outlines':'yes'});\\n }\\n this.certificate.generateTest = function() {\\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf'});\\n }\\n this.certificate.remove = function() {\\n M.confirm('Are you sure you want to remove certificate?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.certificateDelete', {'tnid':M.curTenantID, 'certificate_id':M.ciniki_musicfestivals_main.certificate.certificate_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certificate.close();\\n });\\n });\\n }\\n this.certificate.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.certificate.save(\\\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certificate.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.certificate.save(\\\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certificate.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certificate.save();');\\n this.certificate.addClose('Cancel');\\n this.certificate.addButton('next', 'Next');\\n this.certificate.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Certificate Field\\n //\\n this.certfield = new M.panel('Certificate Field', 'ciniki_musicfestivals_main', 'certfield', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.certfield');\\n this.certfield.data = null;\\n this.certfield.field_id = 0;\\n this.certfield.certificate_id = 0;\\n this.certfield.nplist = [];\\n this.certfield.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'field':{'label':'Field', 'type':'select', 'options':{\\n 'class':'Class',\\n 'timeslotdate':'Timeslot Date',\\n 'participant':'Participant',\\n 'title':'Title',\\n 'adjudicator':'Adjudicator',\\n 'placement':'Placement',\\n 'text':'Text',\\n }},\\n 'xpos':{'label':'X Position', 'required':'yes', 'type':'text'},\\n 'ypos':{'label':'Y Position', 'required':'yes', 'type':'text'},\\n 'width':{'label':'Width', 'required':'yes', 'type':'text'},\\n 'height':{'label':'Height', 'required':'yes', 'type':'text'},\\n 'font':{'label':'Font', 'type':'select', 'options':{\\n 'times':'Times',\\n 'helvetica':'Helvetica',\\n 'vidaloka':'Vidaloka',\\n 'scriptina':'Scriptina',\\n 'allison':'Allison',\\n 'greatvibes':'Great Vibes',\\n }},\\n 'size':{'label':'Size', 'type':'text'},\\n 'style':{'label':'Style', 'type':'select', 'options':{\\n '':'Normal',\\n 'B':'Bold',\\n 'I':'Italic',\\n 'BI':'Bold Italic',\\n }},\\n 'align':{'label':'Align', 'type':'select', 'options':{\\n 'L':'Left',\\n 'C':'Center',\\n 'R':'Right',\\n }},\\n 'valign':{'label':'Vertial', 'type':'select', 'options':{\\n 'T':'Top',\\n 'M':'Middle',\\n 'B':'Bottom',\\n }},\\n// 'color':{'label':'Color', 'type':'text'},\\n// 'bgcolor':{'label':'Background Color', 'type':'text'},\\n 'text':{'label':'Text', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certfield.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certfield.field_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certfield.remove();'},\\n }},\\n };\\n this.certfield.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.certfield.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.certfieldHistory', 'args':{'tnid':M.curTenantID, 'field_id':this.field_id, 'field':i}};\\n }\\n this.certfield.open = function(cb, fid, cid, list) {\\n if( fid != null ) { this.field_id = fid; }\\n if( cid != null ) { this.certificate_id = cid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.certfieldGet', {'tnid':M.curTenantID, 'field_id':this.field_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.certfield;\\n p.data = rsp.field;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.certfield.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certfield.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.field_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.certfieldUpdate', {'tnid':M.curTenantID, 'field_id':this.field_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.certfieldAdd', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certfield.field_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.certfield.remove = function() {\\n M.confirm('Are you sure you want to remove certfield?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.certfieldDelete', {'tnid':M.curTenantID, 'field_id':M.ciniki_musicfestivals_main.certfield.field_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certfield.close();\\n });\\n });\\n }\\n this.certfield.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.certfield.save(\\\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certfield.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.certfield.save(\\\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certfield.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certfield.save();');\\n this.certfield.addClose('Cancel');\\n this.certfield.addButton('next', 'Next');\\n this.certfield.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Trophy\\n //\\n this.trophy = new M.panel('Trophy', 'ciniki_musicfestivals_main', 'trophy', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.trophy');\\n this.trophy.data = null;\\n this.trophy.trophy_id = 0;\\n this.trophy.nplist = [];\\n this.trophy.sections = {\\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.trophy.setFieldValue('primary_image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n },\\n }},\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'category':{'label':'Category', 'type':'text'},\\n 'donated_by':{'label':'Donated By', 'type':'text'},\\n 'first_presented':{'label':'First Presented', 'type':'text'},\\n 'criteria':{'label':'Criteria', 'type':'text'},\\n }},\\n '_description':{'label':'Description', 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n 'winners':{'label':'Winners', 'type':'simplegrid', 'num_cols':2, \\n 'addTxt':'Add Winner',\\n 'addFn':'M.ciniki_musicfestivals_main.trophy.save(\\\"M.ciniki_musicfestivals_main.trophywinner.open(\\\\'M.ciniki_musicfestivals_main.trophy.open();\\\\',0,M.ciniki_musicfestivals_main.trophy.trophy_id);\\\");',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophy.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.trophy.trophy_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.trophy.remove();'},\\n }},\\n };\\n this.trophy.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.trophy.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.trophyHistory', 'args':{'tnid':M.curTenantID, 'trophy_id':this.trophy_id, 'field':i}};\\n }\\n this.trophy.cellValue = function(s, i, j, d) {\\n if( s == 'winners' ) {\\n switch(j) {\\n case 0: return d.year;\\n case 1: return d.name;\\n }\\n }\\n }\\n this.trophy.rowFn = function(s, i, d) {\\n if( s == 'winners' ) {\\n return 'M.ciniki_musicfestivals_main.trophy.save(\\\"M.ciniki_musicfestivals_main.trophywinner.open(\\\\'M.ciniki_musicfestivals_main.trophy.open();\\\\',' + d.id + ',M.ciniki_musicfestivals_main.trophy.trophy_id);\\\");';\\n }\\n }\\n this.trophy.open = function(cb, tid, list) {\\n if( tid != null ) { this.trophy_id = tid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.trophyGet', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.trophy;\\n p.data = rsp.trophy;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.trophy.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophy.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.trophy_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.trophyUpdate', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.trophyAdd', {'tnid':M.curTenantID}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophy.trophy_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.trophy.remove = function() {\\n M.confirm('Are you sure you want to remove trophy?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyDelete', {'tnid':M.curTenantID, 'trophy_id':M.ciniki_musicfestivals_main.trophy.trophy_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophy.close();\\n });\\n });\\n }\\n this.trophy.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.trophy.save(\\\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophy.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.trophy.save(\\\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophy.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophy.save();');\\n this.trophy.addClose('Cancel');\\n this.trophy.addButton('next', 'Next');\\n this.trophy.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Trophy Winner\\n //\\n this.trophywinner = new M.panel('Trophy Winner', 'ciniki_musicfestivals_main', 'trophywinner', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophywinner');\\n this.trophywinner.data = null;\\n this.trophywinner.trophy_id = 0;\\n this.trophywinner.winner_id = 0;\\n this.trophywinner.nplist = [];\\n this.trophywinner.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'year':{'label':'Year', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophywinner.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.trophywinner.winner_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.trophywinner.remove();'},\\n }},\\n };\\n this.trophywinner.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.trophywinner.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.trophyWinnerHistory', 'args':{'tnid':M.curTenantID, 'winner_id':this.winner_id, 'field':i}};\\n }\\n this.trophywinner.open = function(cb, wid, tid, list) {\\n if( wid != null ) { this.winner_id = wid; }\\n if( tid != null ) { this.trophy_id = tid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerGet', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.trophywinner;\\n p.data = rsp.winner;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.trophywinner.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophywinner.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.winner_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerUpdate', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerAdd', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophywinner.winner_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.trophywinner.remove = function() {\\n M.confirm('Are you sure you want to remove trophywinner?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerDelete', {'tnid':M.curTenantID, 'winner_id':M.ciniki_musicfestivals_main.trophywinner.winner_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophywinner.close();\\n });\\n });\\n }\\n this.trophywinner.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophywinner.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophywinner.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophywinner.save();');\\n this.trophywinner.addClose('Cancel');\\n this.trophywinner.addButton('next', 'Next');\\n this.trophywinner.addLeftButton('prev', 'Prev');\\n\\n \\n //\\n // This panel will allow mass updates to City and Province\\n //\\n this.editcityprov = new M.panel('Update', 'ciniki_musicfestivals_main', 'editcityprov', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.editcityprov');\\n this.editcityprov.data = null;\\n this.editcityprov.city = '';\\n this.editcityprov.province = '';\\n this.editcityprov.sections = {\\n 'general':{'label':'', 'fields':{\\n 'city':{'label':'City', 'type':'text', 'visible':'yes'},\\n 'province':{'label':'Province', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editcityprov.save();'},\\n }},\\n };\\n this.editcityprov.open = function(cb, c, p) {\\n if( c != null ) {\\n this.city = unescape(c);\\n this.sections.general.fields.city.visible = 'yes';\\n } else {\\n this.sections.general.fields.city.visible = 'no';\\n }\\n this.province = unescape(p);\\n this.data = {\\n 'city':unescape(c),\\n 'province':unescape(p),\\n };\\n this.refresh();\\n this.show(cb);\\n }\\n this.editcityprov.save = function() {\\n var args = {\\n 'tnid':M.curTenantID, \\n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\\n };\\n if( this.sections.general.fields.city.visible == 'yes' ) {\\n args['old_city'] = M.eU(this.city);\\n args['new_city'] = M.eU(this.formValue('city'));\\n }\\n args['old_province'] = M.eU(this.province);\\n args['new_province'] = M.eU(this.formValue('province'));\\n M.api.getJSONCb('ciniki.musicfestivals.competitorCityProvUpdate', args, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.editcityprov.close();\\n });\\n }\\n this.editcityprov.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editcityprov.save();');\\n this.editcityprov.addClose('Cancel');\\n\\n //\\n // Create and send a email message to a selection of competitors/teachers with\\n // filtering for section, timeslot sections, etc\\n //\\n this.message = new M.panel('Message',\\n 'ciniki_musicfestivals_main', 'message',\\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.message');\\n this.message.data = {};\\n this.message.festival_id = 0;\\n this.message.message_id = 0;\\n this.message.upload = null;\\n this.message.nplist = [];\\n this.message.sections = {\\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label mediumlabel', ''],\\n // Status\\n // # competitors\\n // # teachers\\n // 'dt_sent':{'label':'Year', 'type':'text'},\\n },\\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label', ''],\\n 'addTxt':'Add/Remove Recipient(s)',\\n //'addFn':'M.ciniki_musicfestivals_main.messagerefs.open(\\\\'M.ciniki_musicfestivals_main.message.open();\\\\',M.ciniki_musicfestivals_main.message.message_id);',\\n 'addFn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.openrefs();\\\");',\\n },\\n '_subject':{'label':'Subject', 'fields':{\\n 'subject':{'label':'Subject', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_content':{'label':'Message', 'fields':{\\n 'content':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n/* '_file':{'label':'Attach Files', \\n 'fields':{\\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\\n }}, */\\n 'files':{'label':'Attachments', 'type':'simplegrid', 'num_cols':2,\\n 'cellClasses':['', 'alignright fabuttons'],\\n 'noData':'No attachments',\\n 'addTxt':'Attach File',\\n 'addTopFn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.fileAdd();\\\");',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.save();',\\n },\\n 'back':{'label':'Back', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status > 10 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.close();',\\n },\\n 'sendtest':{'label':'Send Test Message', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.sendTest();\\\");',\\n },\\n 'schedule':{'label':'Schedule', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.schedule();',\\n },\\n 'unschedule':{'label':'Unschedule', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 30 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.unschedule();',\\n },\\n 'sendnow':{'label':'Send Now', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.sendNow();\\\");'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.message_id > 0 && M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.remove();',\\n },\\n }},\\n };\\n// this.message.fieldValue = function(s, i, d) {\\n// return this.data[i];\\n// }\\n this.message.cellValue = function(s, i, j, d) {\\n if( s == 'details' ) {\\n switch(j) {\\n case 0: return d.label;\\n case 1: return d.value;\\n }\\n }\\n if( s == 'objects' ) {\\n switch(j) {\\n case 0: return d.type;\\n case 1: return d.label;\\n }\\n }\\n if( s == 'files' ) {\\n switch(j) {\\n case 0: return d.filename;\\n }\\n if( this.data.status == 10 && j == 1 ) {\\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\\\'' + escape(d.filename) + '\\\\');')\\n + M.faBtn('&#xf014;', 'Delete', 'M.ciniki_musicfestivals_main.message.fileDelete(\\\\'' + escape(d.filename) + '\\\\');');\\n }\\n if( this.data.status > 10 && j == 1 ) {\\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\\\'' + escape(d.filename) + '\\\\');');\\n }\\n return '';\\n }\\n }\\n// this.message.cellFn = function(s, i, j, d) {\\n// if( s == 'objects' ) {\\n// }\\n// return '';\\n// }\\n // Add a new message with object and object_id\\n this.message.addnew = function(cb, fid, o, oid) {\\n var args = {'tnid':M.curTenantID, 'festival_id':fid};\\n args['subject'] = '';\\n args['object'] = o;\\n args['object_id'] = oid;\\n M.api.getJSONCb('ciniki.musicfestivals.messageAdd', args, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.open(cb, rsp.id);\\n });\\n }\\n this.message.openrefs = function() {\\n M.ciniki_musicfestivals_main.messagerefs.open('M.ciniki_musicfestivals_main.message.open();', M.ciniki_musicfestivals_main.message.message_id);\\n }\\n this.message.fileAdd = function() {\\n if( this.upload == null ) {\\n this.upload = M.aE('input', this.panelUID + '_file_upload', 'image_uploader');\\n this.upload.setAttribute('name', 'filename');\\n this.upload.setAttribute('type', 'file');\\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\\n }\\n this.upload.value = '';\\n this.upload.click();\\n }\\n this.message.uploadFile = function() {\\n var f = this.upload;\\n M.api.postJSONFile('ciniki.musicfestivals.messageFileAdd', {'tnid':M.curTenantID, 'message_id':this.message_id}, f.files[0],\\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.message;\\n p.data.files = rsp.files;\\n p.refreshSection('files');\\n });\\n }\\n this.message.fileDelete = function(f) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageFileDelete', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.message;\\n p.data.files = rsp.files;\\n p.refreshSection('files');\\n });\\n }\\n this.message.fileDownload = function(f) {\\n M.api.openFile('ciniki.musicfestivals.messageFileDownload', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f});\\n }\\n this.message.open = function(cb, mid, fid, list) {\\n if( mid != null ) { this.message_id = mid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, 'message_id':this.message_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.message;\\n p.data = rsp.message;\\n if( rsp.message.status == 10 ) {\\n p.sections.objects.addTxt = \\\"Add/Remove Recipients\\\";\\n } else {\\n p.sections.objects.addTxt = \\\"View Recipients\\\";\\n }\\n if( rsp.message.status == 10 ) {\\n p.addClose('Cancel');\\n p.sections._subject.fields.subject.editable = 'yes';\\n p.sections._content.fields.content.editable = 'yes';\\n } else {\\n p.addClose('Back');\\n p.sections._subject.fields.subject.editable = 'no';\\n p.sections._content.fields.content.editable = 'no';\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.message.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.message.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.message_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.messageAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'status':10}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.message_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.message.sendTest = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':this.message_id, 'send':'test'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.alert(rsp.msg);\\n M.ciniki_musicfestivals_main.message.open();\\n });\\n }\\n this.message.sendNow = function() {\\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \\n + ' will receive this email.

            ';\\n M.confirm(msg + ' Is this email correct and ready to send?', null, function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id, 'send':'all'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.alert(rsp.msg);\\n M.ciniki_musicfestivals_main.message.open();\\n });\\n });\\n }\\n this.message.schedule = function() {\\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \\n + ' will receive this email.

            ';\\n M.confirm(msg + 'Are you sure the email is correct and ready to be sent?', null, function() {\\n M.ciniki_musicfestivals_main.messageschedule.open();\\n });\\n }\\n this.message.schedulenow = function() {\\n var sd = M.ciniki_musicfestivals_main.messageschedule.formValue('dt_scheduled');\\n if( sd != this.data.dt_scheduled ) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'dt_scheduled':sd, 'status':30}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.close();\\n });\\n } else {\\n this.close();\\n }\\n }\\n this.message.unschedule = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'status':10}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.open();\\n });\\n }\\n this.message.remove = function() {\\n M.confirm('Are you sure you want to remove message?', null, function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageDelete', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.close();\\n });\\n });\\n }\\n this.message.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.message.save(\\\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.message.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.message.save(\\\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.message.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.message.save();');\\n this.message.addButton('next', 'Next');\\n this.message.addLeftButton('prev', 'Prev');\\n this.message.helpSections = function() {\\n return {\\n 'help':{'label':'Substitutions', 'type':'htmlcontent',\\n 'html':'The following substitutions are available in the Message:

            '\\n + '{_first_} = Teacher/Individual first name, Group/Ensemble full name
            '\\n + '{_name_} = Teacher/Individual/Group full name
            '\\n },\\n };\\n }\\n\\n //\\n // This panel will let the user select a date and time to send the scheduled message\\n //\\n this.messageschedule = new M.panel('Schedule Message',\\n 'ciniki_musicfestivals_main', 'messageschedule',\\n 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.messageschedule');\\n this.messageschedule.data = {};\\n this.messageschedule.sections = {\\n 'general':{'label':'Schedule Date and Time', 'fields':{\\n 'dt_scheduled':{'label':'', 'hidelabel':'yes', 'type':'datetime'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'send':{'label':'Schedule', \\n 'fn':'M.ciniki_musicfestivals_main.message.schedulenow();',\\n },\\n 'delete':{'label':'Cancel',\\n 'fn':'M.ciniki_musicfestivals_main.message.open();',\\n },\\n }},\\n };\\n this.messageschedule.open = function() {\\n if( M.ciniki_musicfestivals_main.message.data.dt_scheduled != '0000-00-00 00:00:00' ) {\\n this.data = {\\n 'dt_scheduled':M.ciniki_musicfestivals_main.message.data.dt_scheduled_text,\\n };\\n } else {\\n this.data.dt_scheduled = '';\\n }\\n this.refresh();\\n this.show();\\n }\\n\\n\\n //\\n // This panel shows the available objects that can be used to send a message to.\\n //\\n this.messagerefs = new M.panel('Message Recipients',\\n 'ciniki_musicfestivals_main', 'messagerefs',\\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.messagerefs');\\n this.messagerefs.data = {};\\n this.messagerefs.festival_id = 0;\\n this.messagerefs.message_id = 0;\\n this.messagerefs.section_id = 0;\\n this.messagerefs.category_id = 0;\\n this.messagerefs.schedule_id = 0;\\n this.messagerefs.division_id = 0;\\n this.messagerefs.nplist = [];\\n this.messagerefs.sections = {\\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label mediumlabel', ''],\\n // Status\\n // # competitors\\n // # teachers\\n // 'dt_sent':{'label':'Year', 'type':'text'},\\n },\\n 'excluded':{'label':'', 'aside':'yes', 'fields':{\\n 'flags1':{'label':'Include', 'type':'flagspiece', 'default':'off', 'mask':0x03,\\n 'field':'flags', 'toggle':'yes', 'join':'yes',\\n\\n 'flags':{'0':{'name':'Everybody'},'2':{'name':'Only Competitors'}, '1':{'name':'Only Teachers'}},\\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\\n },\\n }},\\n/* '_excluded':{'label':'', 'aside':'yes', 'fields':{\\n 'flags1':{'label':'Exclude Competitors', 'type':'flagtoggle', 'default':'off', 'bit':0x01,\\n 'field':'flags',\\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\\n },\\n 'flags2':{'label':'Exclude Teachers', 'type':'flagtoggle', 'default':'off', 'bit':0x02,\\n 'field':'flags',\\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\\n },\\n }}, */\\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':3, 'aside':'yes',\\n 'cellClasses':['label mediumlabel', '', 'alignright'],\\n 'noData':'No Recipients',\\n// 'addTxt':'Add Recipient(s)',\\n// 'addFn':'M.ciniki_musicfestivals_main.message.addobjects();',\\n },\\n '_extract':{'label':'', 'aside':'yes', 'buttons':{\\n 'extract':{'label':'Extract Recipients', 'fn':'M.ciniki_musicfestivals_main.messagerefs.extractRecipients();'},\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'sections', 'tabs':{\\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"sections\\\");'},\\n 'categories':{'label':'Categories', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.section_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"categories\\\");',\\n },\\n 'classes':{'label':'Classes', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.category_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"classes\\\");',\\n },\\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"schedule\\\");'},\\n 'divisions':{'label':'Divisions', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.schedule_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"divisions\\\");',\\n },\\n 'timeslots':{'label':'Timeslots', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.division_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"timeslots\\\");',\\n },\\n 'tags':{'label':'Registration Tags', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"tags\\\");',\\n },\\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"teachers\\\");'},\\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"competitors\\\");'},\\n }},\\n/* '_file':{'label':'Attach Files', \\n 'fields':{\\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\\n }}, */\\n 'sections':{'label':'Syllabus', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'categories' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'classes' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'schedule':{'label':'Schedule', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'schedule' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'divisions' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'timeslots':{'label':'Timeslots', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'timeslots' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'tags':{'label':'Registration Tags', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'tags' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n// 'competitor_search':{'label':'Search Competitors', 'type':'simplegrid', 'num_cols':2,\\n// 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\\n// 'cellClasses':['', 'alignright fabuttons'],\\n// },\\n 'competitors':{'label':'Competitors', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\\n 'headerValues':['Name', 'Status'],\\n 'headerClasses':['', 'alignright'],\\n 'cellClasses':['', 'alignright fabuttons'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'alttext'],\\n },\\n 'teachers':{'label':'Teachers', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'teachers' ? 'yes' : 'no';},\\n 'headerValues':['Name', 'Status'],\\n 'headerClasses':['', 'alignright'],\\n 'cellClasses':['', 'alignright fabuttons'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'alttext'],\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'done':{'label':'Done', 'fn':'M.ciniki_musicfestivals_main.messagerefs.close();'},\\n }},\\n };\\n this.messagerefs.cellSortValue = function(s, i, j, d) {\\n if( d.added != null && d.added == 'yes' ) {\\n return 1;\\n } else if( d.included != null && d.included == 'yes' ) {\\n return 2;\\n } else {\\n return 3;\\n }\\n }\\n this.messagerefs.cellValue = function(s, i, j, d) {\\n if( s == 'details' ) {\\n switch(j) {\\n case 0: return d.label;\\n case 1: return d.value;\\n }\\n }\\n if( s == 'objects' ) {\\n switch(j) {\\n case 0: return d.type;\\n case 1: return d.label;\\n case 2: return '&#xf014;&nbsp;';\\n }\\n }\\n if( s == 'sections' || s == 'categories' || s == 'classes' || s == 'schedule' || s == 'divisions' || s == 'timeslots' || s == 'tags' || s == 'competitors' ) {\\n if( j == 0 ) {\\n return d.name;\\n }\\n if( j == 1 ) {\\n if( d.added != null && d.added == 'yes' ) {\\n if( this.data.message.status == 10 ) {\\n return '';\\n } else {\\n return 'Added';\\n }\\n } else if( d.included != null && d.included == 'yes' ) {\\n return 'Included';\\n } else if( d.object != null && d.partial == null ) {\\n if( this.data.message.status == 10 ) {\\n return '';\\n } else {\\n return '';\\n }\\n } else if( d.object != null && d.partial == null ) {\\n return '';\\n }\\n }\\n }\\n if( s == 'teachers' ) {\\n if( j == 0 ) {\\n return d.name;\\n }\\n if( j == 1 ) {\\n var html = '';\\n if( d.included != null ) {\\n return 'Included';\\n }\\n else if( d.students != null ) {\\n return '';\\n }\\n else if( d.added != null ) {\\n return '';\\n }\\n else { \\n return ''\\n + ' ';\\n }\\n }\\n \\n }\\n }\\n this.messagerefs.cellFn = function(s, i, j, d) {\\n if( s == 'objects' && j == 2 ) { \\n return 'M.ciniki_musicfestivals_main.messagerefs.removeObject(\\\\'' + d.object + '\\\\',\\\\'' + d.object_id + '\\\\');';\\n }\\n }\\n this.messagerefs.rowClass = function(s, i, d) {\\n if( (d.partial != null && d.partial == 'yes') ) {\\n return 'statusorange';\\n }\\n else if( (d.added != null && d.added == 'yes')\\n || (d.included != null && d.included == 'yes') \\n || (d.students != null && d.students == 'yes') \\n ) {\\n return 'statusgreen';\\n }\\n }\\n this.messagerefs.rowFn = function(s, i, d) {\\n if( s == 'sections' || s == 'categories' || s == 'schedule' || s == 'divisions' ) {\\n if( d.added == null && d.included == null ) {\\n return 'M.ciniki_musicfestivals_main.messagerefs.switchSubTab(\\\\'' + s + '\\\\',' + d.id + ');';\\n }\\n }\\n return '';\\n }\\n this.messagerefs.extractRecipients = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'extractrecipients',\\n }, this.openFinish);\\n }\\n this.messagerefs.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n if( t == 'sections' || t == 'schedule' || t == 'teachers' || t == 'competitors' || t == 'tags' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n this.registration_tag = '';\\n }\\n else if( t == 'categories' ) {\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n this.registration_tag = '';\\n }\\n else if( t == 'divisions' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.division_id = 0;\\n this.registration_tag = '';\\n }\\n this.open();\\n }\\n this.messagerefs.switchSubTab = function(s, id) {\\n/* if( s == 'sections' || s == 'schedule' || s == 'teachers' || s == 'competitors' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n }\\n else if( s == 'categories' ) {\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n }\\n else if( s == 'divisions' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.division_id = 0;\\n } */\\n if( s == 'sections' ) {\\n this.section_id = id;\\n this.switchTab('categories');\\n }\\n if( s == 'categories' ) {\\n this.category_id = id;\\n this.switchTab('classes');\\n }\\n if( s == 'schedule' ) {\\n this.schedule_id = id;\\n this.switchTab('divisions');\\n }\\n if( s == 'divisions' ) {\\n this.division_id = id;\\n this.switchTab('timeslots');\\n }\\n }\\n this.messagerefs.updateFlags = function() {\\n var f = this.data.message.flags;\\n if( (this.formValue('flags1')&0x01) == 0x01 ) {\\n f |= 0x01;\\n } else {\\n f &= 0xFFFE;\\n }\\n if( (this.formValue('flags1')&0x02) == 0x02 ) {\\n f |= 0x02;\\n } else {\\n f &= 0xFFFD;\\n }\\n if( f != this.data.message.flags ) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'updateflags',\\n 'flags':f,\\n }, this.openFinish);\\n } \\n }\\n this.messagerefs.addObject = function(o, oid) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'addref',\\n 'object':o,\\n 'object_id':oid,\\n }, this.openFinish);\\n }\\n this.messagerefs.removeObject = function(o, oid) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'removeref',\\n 'object':o,\\n 'object_id':oid,\\n }, this.openFinish);\\n }\\n this.messagerefs.open = function(cb, mid) {\\n if( cb != null ) { this.cb = cb; }\\n if( mid != null ) { this.message_id = mid; }\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n }, this.openFinish);\\n }\\n this.messagerefs.openFinish = function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.messagerefs;\\n p.data = rsp;\\n p.data.flags = rsp.message.flags;\\n p.data.details = rsp.message.details;\\n p.data.objects = rsp.message.objects;\\n p.refresh();\\n p.show();\\n }\\n this.messagerefs.goback = function() {\\n if( this.sections._tabs.selected == 'categories' ) {\\n this.switchTab(\\\"sections\\\");\\n } else if( this.sections._tabs.selected == 'classes' ) {\\n this.switchTab(\\\"categories\\\");\\n } else if( this.sections._tabs.selected == 'divisions' ) {\\n this.switchTab(\\\"schedule\\\");\\n } else if( this.sections._tabs.selected == 'timeslots' ) {\\n this.switchTab(\\\"divisions\\\");\\n } else {\\n this.close();\\n }\\n }\\n this.messagerefs.addLeftButton('back', 'Back', 'M.ciniki_musicfestivals_main.messagerefs.goback();');\\n\\n //\\n // Start the app\\n // cb - The callback to run when the user leaves the main panel in the app.\\n // ap - The application prefix.\\n // ag - The app arguments.\\n //\\n this.start = function(cb, ap, ag) {\\n args = {};\\n if( ag != null ) {\\n args = eval(ag);\\n }\\n \\n //\\n // Create the app container\\n //\\n var ac = M.createContainer(ap, 'ciniki_musicfestivals_main', 'yes');\\n if( ac == null ) {\\n M.alert('App Error');\\n return false;\\n }\\n\\n //\\n // Initialize for tenant\\n //\\n if( this.curTenantID == null || this.curTenantID != M.curTenantID ) {\\n this.tenantInit();\\n this.curTenantID = M.curTenantID;\\n }\\n\\n if( args.item_object != null && args.item_object == 'ciniki.musicfestivals.registration' && args.item_object_id != null ) {\\n this.registration.open(cb, args.item_object_id, 0, 0, 0, null, args.source);\\n } else if( args.registration_id != null && args.registration_id != '' ) {\\n this.registration.open(cb, args.registration_id, 0, 0, 0, null, '');\\n } else if( args.festival_id != null && args.festival_id != '' ) {\\n this.festival.list_id = 0;\\n this.festival.open(cb, args.festival_id, null);\\n } else {\\n this.festival.list_id = 0;\\n this.menu.sections._tabs.selected = 'festivals';\\n this.menu.open(cb);\\n }\\n }\\n\\n this.tenantInit = function() {\\n this.festival.typestatus = '';\\n this.festival.sections.ipv_tabs.selected = 'all';\\n this.classes.sections._tabs.selected = 'fees';\\n this.festival.section_id = 0;\\n this.festival.schedulesection_id = 0;\\n this.festival.scheduledivision_id = 0;\\n this.festival.list_id = 0;\\n this.festival.listsection_id = 0;\\n this.festival.nplists = {};\\n this.festival.nplist = [];\\n this.festival.messages_status = 10;\\n this.festival.city_prov = 'All';\\n this.festival.province = 'All';\\n this.festival.registration_tag = '';\\n }\\n}\",\n \"function toMenu()\\n {\\n /**\\n * Opens a fan of a desk in the pause menu\\n */\\n function openFan()\\n {\\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\\n desk.toggleFan(4, 35, 10, true);\\n for (var counter = 0; counter < desk.cards.length; counter++)\\n {\\n if (state.isWin)\\n {\\n desk.cards[counter].turn(true);\\n desk.cards[counter].dataset.turned = true;\\n }\\n else if (desk.cards[counter].dataset.turned == true)\\n {\\n desk.cards[counter].turn(true);\\n }\\n }\\n state.isWin = false;\\n }\\n\\n /**\\n * Shows menu elements\\n */\\n function showMenu()\\n {\\n if (state.screen == \\\"GAME\\\")\\n {\\n cards[0].removeEventListener(\\\"move\\\", showMenuId);\\n DOM.pause.deskContainer.style.opacity = 1;\\n DOM.cardsContainer.classList.add(CSS.hidden);\\n }\\n\\n if (state.isWin)\\n {\\n DOM.pause.deskContainer.style.opacity = 0;\\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \\\"Победа со счётом: \\\" : \\\"Потрачено: \\\") + state.score;\\n DOM.pause.options.continue.disabled = true;\\n state.score = 0;\\n }\\n else\\n {\\n DOM.pause.headline.innerHTML = \\\"MEMORY GAME\\\";\\n }\\n\\n DOM.container.classList.remove(CSS.container.game);\\n DOM.container.classList.add(CSS.container.pause);\\n state.screen = \\\"MENU\\\";\\n\\n toggleHideElements(\\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\\n animation.duration.hide,\\n false,\\n openFan.bind(this)\\n );\\n }\\n\\n /**\\n * Hides a game field\\n */\\n function hideGameField(follower)\\n {\\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\\n }\\n\\n /**\\n * Moves cards from the field to the desk\\n */\\n function takeCards()\\n {\\n if (state.turnedCard)\\n {\\n state.turnedCard.turn(true);\\n }\\n\\n showMenuId = cards[0].addEventListener(\\\"move\\\", showMenu);\\n\\n for (var counter = 0; counter < cards.length; counter++)\\n {\\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \\\"PX\\\", height: sizes.desk.height + \\\"PX\\\"}, true);\\n }\\n }\\n\\n state.cardsTurnable = false;\\n if (state.screen == \\\"GAME\\\")\\n {\\n var showMenuId;\\n hideGameField();\\n takeCards();\\n }\\n else\\n {\\n hideGameField(showMenu.bind(this));\\n }\\n }\",\n \"function HappyMealMenu() {\\n \\n const dispatch = useDispatch();\\n const menu = useSelector(state => state.happyMeal.menu, shallowEqual);\\n \\n // use 'react-redux' to load in happy meals from backend. \\n useEffect(() => {\\n dispatch(fetchMenuFromAPI('LOAD_HAPPY_MEAL_MENU', 'happy-meal'));\\n }, [dispatch]);\\n \\n return (\\n // render happy meal items as a list of buttons. \\n
            \\n {menu && menu.map(food => \\n )\\n }\\n
            \\n )\\n}\",\n \"function spellsMenu() {\\n $scope.menuTitle = createText(\\\"Spells\\\", [20, 10]);\\n createText(\\\"Not yet implemented\\\", [50, 80], {});\\n }\",\n \"function showMenu() {\\n rectMode(CENTER);\\n fill(colorList[2]);\\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[5]);\\n text(\\\"How to Play\\\", buttonX, buttonY);\\n\\n fill(colorList[3]);\\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[4]);\\n text(\\\"Dancing Block\\\", buttonX, secondButtonYpos);\\n \\n}\",\n \"function simulat_menu_infos() {\\n display_menu_infos();\\n}\",\n \"createMenus (){\\n \\n $.each(MenuData.menus, ( menuName, menuItems )=>{\\n \\n $('#gameNav-'+menuName+'Panel > .menu-links').html('');\\n \\n $.each(menuItems,( index, item )=>{\\n \\n var realRoute,itemLink,action,routeId;\\n \\n if(item.hideIfNotAuthenticated && !this.get('session.isAuthenticated')){\\n return true;\\n }\\n \\n if(item.label){\\n // Translate item label\\n let key = \\\"menu.\\\"+Ember.String.dasherize(menuName)+\\\".\\\"+Ember.String.dasherize(item.label);\\n item.tLabel = this.get('i18n').t(key);\\n }\\n \\n // Serialize route name for use as CSS id name\\n item.cssRoute = item.route.replace(/\\\\./g,'_');\\n \\n // Track actionable link\\n let addEvent = true;\\n \\n if(item.menuRoute){\\n \\n // For routes which don't appear in the menu but will cause a different menu link to highlight\\n itemLink = $('');\\n addEvent = false;\\n \\n } else if(item.tempRoute){\\n itemLink = $(''+item.tLabel+'');\\n action = 'transitionAction';\\n realRoute = item.tempRoute;\\n \\n } else if(item.route){\\n itemLink = $(''+item.tLabel+'');\\n action = 'transitionAction';\\n realRoute = item.route;\\n \\n if(item.params && item.params.id){\\n routeId = item.params.id;\\n }\\n \\n } else if(item.action) {\\n itemLink = $(''+item.tLabel+'');\\n let actionName = 'menuAction'+item.label.alphaNumeric();\\n action = actionName;\\n this.set(actionName,item.action);\\n }\\n \\n if(itemLink){\\n \\n if(addEvent){\\n itemLink.on('click',(e)=>{\\n e.preventDefault();\\n this.sendAction(action,realRoute,routeId);\\n \\n if(routeId){\\n Ember.Blackout.transitionTo(realRoute,routeId);\\n } else {\\n Ember.Blackout.transitionTo(realRoute);\\n }\\n \\n this.selectMenuLink(item.route);\\n return false;\\n });\\n }\\n \\n $('#gameNav-'+menuName+'Panel > .menu-links').append(itemLink);\\n }\\n \\n });\\n });\\n\\n // Manually update hover watchers\\n Ember.Blackout.refreshHoverWatchers();\\n \\n }\",\n \"function showMenu(type) {\\n switch (type) {\\n case 'beer':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allBeveragesOfType(\\\"Öl\\\"));\\n break;\\n case 'wine':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allBeveragesOfType(\\\"vin\\\"));\\n break;\\n case 'spirits':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allBeveragesWithStrength(\\\"above\\\", 20));\\n break;\\n case 'alcoAbove':\\n lastMenu = type;\\n if (document.getElementById(\\\"alco_percent\\\") != null) {\\n alcoPercent = document.getElementById(\\\"alco_percent\\\").value;\\n }\\n addBasicMenu();\\n showParticularMenu(allBeveragesWithStrength(\\\"above\\\", alcoPercent));\\n break;\\n case 'alcoBelow':\\n lastMenu = type;\\n if (document.getElementById(\\\"alco_percent\\\") != null) {\\n alcoPercent = document.getElementById(\\\"alco_percent\\\").value;\\n }\\n addBasicMenu();\\n showParticularMenu(allBeveragesWithStrength(\\\"below\\\", alcoPercent));\\n break;\\n case 'tannin':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu([]);\\n break;\\n case 'gluten':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu([]);\\n break;\\n case 'rest':\\n currentFiltering = \\\"rest\\\";\\n showMenu(lastMenu);\\n break;\\n case 'cat':\\n currentFiltering = \\\"cat\\\";\\n showMenu(lastMenu);\\n break;\\n case 'back':\\n currentFiltering = \\\"none\\\";\\n showMenu(allMenuBeverages());\\n break;\\n default:\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allMenuBeverages());\\n }\\n}\",\n \"function showmenu(ev, category, deleted = false) {\\n //stop the real right click menu\\n ev.preventDefault();\\n var mouseX;\\n let element = \\\"\\\";\\n if (ev.pageX <= 200) {\\n mouseX = ev.pageX + 10;\\n } else {\\n let active_class = $(\\\"#sidebarCollapse\\\").attr(\\\"class\\\");\\n if (active_class.search(\\\"active\\\") == -1) {\\n mouseX = ev.pageX - 210;\\n } else {\\n mouseX = ev.pageX - 50;\\n }\\n }\\n\\n var mouseY = ev.pageY - 10;\\n\\n if (category === \\\"folder\\\") {\\n if (deleted) {\\n $(menuFolder)\\n .children(\\\"#reg-folder-delete\\\")\\n .html(\\\" Restore\\\");\\n $(menuFolder).children(\\\"#reg-folder-rename\\\").hide();\\n $(menuFolder).children(\\\"#folder-move\\\").hide();\\n $(menuFolder).children(\\\"#folder-description\\\").hide();\\n } else {\\n if ($(\\\".selected-item\\\").length > 2) {\\n $(menuFolder)\\n .children(\\\"#reg-folder-delete\\\")\\n .html(' Delete All');\\n $(menuFolder)\\n .children(\\\"#folder-move\\\")\\n .html(' Move All');\\n $(menuFolder).children(\\\"#reg-folder-rename\\\").hide();\\n $(menuFolder).children(\\\"#folder-description\\\").hide();\\n } else {\\n $(menuFolder)\\n .children(\\\"#reg-folder-delete\\\")\\n .html(\\\"Delete\\\");\\n $(menuFolder)\\n .children(\\\"#folder-move\\\")\\n .html(' Move');\\n $(menuFolder).children(\\\"#folder-move\\\").show();\\n $(menuFolder).children(\\\"#reg-folder-rename\\\").show();\\n $(menuFolder).children(\\\"#folder-description\\\").show();\\n }\\n }\\n menuFolder.style.display = \\\"block\\\";\\n $(\\\".menu.reg-folder\\\").css({ top: mouseY, left: mouseX }).fadeIn(\\\"slow\\\");\\n } else if (category === \\\"high-level-folder\\\") {\\n if (deleted) {\\n $(menuHighLevelFolders)\\n .children(\\\"#high-folder-delete\\\")\\n .html(\\\" Restore\\\");\\n $(menuHighLevelFolders).children(\\\"#high-folder-rename\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#folder-move\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#tooltip-folders\\\").show();\\n } else {\\n if ($(\\\".selected-item\\\").length > 2) {\\n $(menuHighLevelFolders)\\n .children(\\\"#high-folder-delete\\\")\\n .html(' Delete All');\\n $(menuHighLevelFolders).children(\\\"#high-folder-delete\\\").show();\\n $(menuHighLevelFolders).children(\\\"#high-folder-rename\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#folder-move\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#tooltip-folders\\\").show();\\n } else {\\n $(menuHighLevelFolders)\\n .children(\\\"#high-folder-delete\\\")\\n .html(\\\"Delete\\\");\\n $(menuHighLevelFolders).children(\\\"#high-folder-delete\\\").show();\\n $(menuHighLevelFolders).children(\\\"#high-folder-rename\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#folder-move\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#tooltip-folders\\\").show();\\n }\\n }\\n menuHighLevelFolders.style.display = \\\"block\\\";\\n $(\\\".menu.high-level-folder\\\")\\n .css({ top: mouseY, left: mouseX })\\n .fadeIn(\\\"slow\\\");\\n } else {\\n if (deleted) {\\n $(menuFile)\\n .children(\\\"#file-delete\\\")\\n .html(\\\" Restore\\\");\\n $(menuFile).children(\\\"#file-rename\\\").hide();\\n $(menuFile).children(\\\"#file-move\\\").hide();\\n $(menuFile).children(\\\"#file-description\\\").hide();\\n } else {\\n if ($(\\\".selected-item\\\").length > 2) {\\n $(menuFile)\\n .children(\\\"#file-delete\\\")\\n .html(' Delete All');\\n $(menuFile)\\n .children(\\\"#file-move\\\")\\n .html(' Move All');\\n $(menuFile).children(\\\"#file-rename\\\").hide();\\n $(menuFile).children(\\\"#file-description\\\").hide();\\n } else {\\n $(menuFile)\\n .children(\\\"#file-delete\\\")\\n .html(\\\"Delete\\\");\\n $(menuFile)\\n .children(\\\"#file-move\\\")\\n .html(' Move');\\n $(menuFile).children(\\\"#file-rename\\\").show();\\n $(menuFile).children(\\\"#file-move\\\").show();\\n $(menuFile).children(\\\"#file-description\\\").show();\\n }\\n }\\n menuFile.style.display = \\\"block\\\";\\n $(\\\".menu.file\\\").css({ top: mouseY, left: mouseX }).fadeIn(\\\"slow\\\");\\n }\\n}\",\n \"function menu(menuArray)\\n{\\n if(skip === true) {\\n skip = false;\\n }\\n novel.ignoreClicks = true;\\n novel.dialog.innerHTML =\\n menuArray[0].replace(/{{(.*?)}}/g, novel_interpolator);\\n novel.dialog.style.textAlign=\\\"center\\\";\\n for (var i = 1; i < menuArray.length; i += 2)\\n {\\n var mItem = new MenuItem((i-1) / 2, menuArray[i], menuArray[i+1]); \\n var el = mItem.domRef;\\n novel_addOnClick(el, menuArray[i+1]);\\n el.innerHTML = menuArray[i].replace(/{{(.*?)}}/g, novel_interpolator);\\n novel.tableau.appendChild(el);\\n novel.actors.push(mItem);\\n }\\n novel.paused = true;\\n}\",\n \"openMenu(scene, index = 0) {\\n this.index = index;\\n this.parentIndex = undefined;\\n\\n //A few initial variables\\n const gameWidth = scene.sys.game.config.width;\\n const gameHeight = scene.sys.game.config.height;\\n const cellWidth = 500;\\n const cellHeight = 48;\\n const length = this.categoriesGroup.getLength();\\n\\n //Remove old listeners & reset\\n this.closeMenus(scene);\\n\\n //Change alpha of selected menu\\n this.categoriesGroup.children.entries[index].setAlpha(1);\\n // this.categoriesGroup.children.entries[index].setBackgroundColor('#000000');\\n\\n //Vertical Line\\n const graphics = scene.add.graphics();\\n graphics.lineStyle(1, 0xffffff);\\n graphics.lineBetween(gameWidth - cellWidth, gameHeight * 2 / 3, gameWidth - cellWidth, gameHeight);\\n\\n const actions = this.categoriesGroup.children.entries[index].children;\\n this.actionsGroup = scene.add.group();\\n let nOfOptions = actions.length;\\n\\n for (let i = 0; i < nOfOptions; i++) {\\n let itemsLeft = \\\"\\\";\\n if (actions[i].supply > 0 && actions[i]) {\\n itemsLeft = ` (${ actions[i].supply })`;\\n }\\n else if (actions[i].supply <= 0) {\\n actions.pop(actions[i--]);\\n nOfOptions--;\\n continue;\\n }\\n\\n const y = gameHeight * 2 / 3 + cellHeight * i;\\n const x = 10 + gameWidth - cellWidth;\\n\\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', `${ actions[i].name + itemsLeft }`, 32);\\n addedText.setAlpha(0.5);\\n this.actionsGroup.add(addedText);\\n }\\n\\n //If there are no options in a particular menu, display an error\\n if (this.actionsGroup.children.size === 0) {\\n const y = gameHeight * 2 / 3;\\n const x = 10 + gameWidth - cellWidth;\\n\\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', 'Nothing to see here!', 32);\\n this.actionsGroup.add(addedText);\\n }\\n }\",\n \"function ocultarMenu(){\\n\\t\\t$(\\\"#js-menu-recipe\\\").hide();\\n}\",\n \"function addPlantMenu(menu) {\\n \\n //call a function to create UL with plants at the position of a click\\n const dropDownMenu = getUL(menu);\\n \\n //assign an onclick response that adds a plant(s)\\n dropDownMenu.addEventListener(\\\"click\\\", function(evt) {\\n \\n //make sure the click is on a custom choice (inside a menu)\\n if (!evt.target.classList.contains(\\\"customChoice\\\")) {\\n return;\\n }\\n \\n //capture plant li elements from the menu into an array so that their properties can be accessed\\n const ar = Array.from(evt.target.parentElement.getElementsByTagName(\\\"li\\\"));\\n \\n //when adding plants to a garden, x-offset is calculated for each height group; the following determines how many plants fall into each height group, then the width is divided by the number of plants to calculate the available horizontal space between plants\\n const xSp1 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\\\"data-avgh\\\"),0,24)).length);\\n const xSp2 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\\\"data-avgh\\\"),24,48)).length);\\n const xSp3 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\\\"data-avgh\\\"),48,72)).length);\\n const xSp4 = menu.gW / (ar.filter(x => Number(x.getAttribute(\\\"data-avgh\\\")) >= 72).length);\\n\\n //when adding plants to a garden, x-offset variable is calculated for each height group and 1x..4 is for current plant's offset\\n let x1 = x2 = x3 = x4 = 0;\\n //for vertical offset, the yOffset is for each plant height group then the y1..4 is the small offset for each plant, so that they're not clustered together\\n let y1 = y2 = y3 = y4 = 0;\\n \\n //loop through filtered plants and add them; when adding to a garden, the plant is centered within the garden; otherwise, it's placed to the left of menu; \\n //if the menu was brought up too close to the left edge of the screen, the plant is placed to the right; vertically, the plant is at the position of its listing in the menu\\n //unless 'Add All Plants' option is clicked, add 1 plant (because liCnt includes the 'Add All Plants' option, the itiration starts at 1, thus set liCnt to 2 for a sinlge addition)\\n for (let i = 1, liCnt = evt.target.innerText === \\\"Add All Plants\\\"? ar.length : 2; i < liCnt; i++) {\\n \\n //the x and y offsets for plants added to a garden or freestanding\\n let xOffset = yOffset = 0;\\n\\n //for plants added to a garden\\n if (menu.gId) {\\n //if adding all plants to a garden, space them at the intervals calculated below\\n if (evt.target.innerText === \\\"Add All Plants\\\") {\\n\\n //using garden height, gH, calculate the desired vertical spacing of plant groups; horizontally, plants are placed at xOffset intervals\\n yOffset = menu.gH / 3; //3 spaces between 4 groups\\n if (Number(evt.target.parentElement.children[i].getAttribute(\\\"data-avgh\\\")) < 24) {\\n //the shortest plants go to the front (bottom), thus the biggest offset\\n yOffset *= 2; \\n xOffset = menu.gX + x1 * xSp1;\\n x1++;\\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\\\"data-avgh\\\")) < 48) {\\n yOffset *= 1.5;\\n xOffset = menu.gX + x2 * xSp2;\\n x2++;\\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\\\"data-avgh\\\")) < 72) {\\n xOffset = menu.gX + x3 * xSp3;\\n x3++;\\n } else {\\n yOffset *= 0.5;\\n xOffset = menu.gX + x4 * xSp4;\\n x4++;\\n }\\n \\n yOffset = menu.gY + yOffset;\\n \\n //alternate vertical position slightly\\n if (i%2) yOffset += munit*2;\\n\\n }\\n else {\\n xOffset = menu.gX + menu.gW/2;\\n yOffset = menu.gY + menu.gH/2;\\n }\\n }\\n \\n //for freestanding plants\\n else {\\n //Y-OFFSET: when adding all plants, space them vertically 16px apart; otherwise, the vertical placing is at the location of the name in the list; \\n yOffset = evt.target.innerText === \\\"Add All Plants\\\" ? \\n parseInt(window.getComputedStyle(evt.target.parentElement).top) + 16 * i : \\n event.pageY;\\n //X-OFFSET: if the menu is too close (within 150px) to the left edge of the screen, add the plant on the right, otherwise - left\\n// todo: check if the x-calculation creates a result that's too long\\n if (parseInt(evt.target.parentElement.style.left) < 150) {\\n //xOffset needs to include the alphabet shortcuts that all plants have on the sides\\n xOffset = menu.type === \\\"all\\\" ? \\n parseInt(evt.target.parentElement.nextSibling.nextSibling.style.left) + munit * 5 : \\n parseInt(evt.target.parentElement.style.left) + parseInt(window.getComputedStyle(evt.target.parentElement).width) + munit * 3;\\n } else {\\n xOffset = menu.type === \\\"all\\\" ? \\n parseInt(evt.target.parentElement.nextSibling.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7 : \\n parseInt(evt.target.parentElement.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7;\\n }\\n }\\n \\n const plantLi = evt.target.innerText != \\\"Add All Plants\\\" ? evt.target : evt.target.parentElement.children[i];\\n\\n addPlant({\\n pId:null, //plant id is set to null, when creating a new plant\\n x: parseFloat(xOffset),\\n y: parseFloat(yOffset),\\n w:Number(plantLi.getAttribute(\\\"data-avgw\\\")),\\n h:Number(plantLi.getAttribute(\\\"data-avgh\\\")),\\n nm:plantLi.innerText, //plant's common name\\n gId:menu.gId?menu.gId:0, //a garden id, where the new plant is planted, 0 at first\\n lnm:plantLi.getAttribute(\\\"data-lnm\\\"), //plant's latin name\\n shp:plantLi.getAttribute(\\\"data-shp\\\"),\\n clr:plantLi.getAttribute(\\\"data-bloomC\\\"),\\n blm:plantLi.getAttribute(\\\"data-bloomM\\\")\\n });\\n }\\n });\\n \\n //the menu with event listeners have been created, now the menu is added to the document's body, not svg\\n document.body.appendChild(dropDownMenu);\\n}\",\n \"function startMenu() {\\n createManager();\\n}\",\n \"function menu(){\\n background(img,0);\\n //retangulo para selecionar a tela\\n fill(255, 204, 0)\\n rect(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\\n image(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\\n fill(233,495,67);\\n textSize(26);\\n text('JOGAR ', 250, 100)\\n //detalhes do texto abaixo\\n fill(233,495,67);\\n textSize(26);\\n text('INSTRUÇÕES', 230, 200);\\n text('CREDITOS', 230, 300);\\n }\",\n \"function RenderDish({selectedDish}){\\n //check for null dish\\n if(selectedDish!=null){\\n return(\\n \\n \\n \\n {selectedDish.name}\\n {selectedDish.description}\\n \\n \\n );\\n }else{\\n return(\\n
            \\n );\\n }\\n \\n }\",\n \"function menuItems() {\\n const farmMenu = document.createElement('div');\\n farmMenu.classList.add('menu');\\n \\n farmMenu.appendChild(createItem(\\n 'beef tartare', \\n '$14',\\n 'egestas pretium aenean pharetra magna ac placerat vestibulum'));\\n farmMenu.appendChild(createItem(\\n 'mussels provencale',\\n '$20',\\n 'sed adipiscing diam donec adipiscing tristique risus nec'));\\n farmMenu.appendChild(createItem(\\n 'scallops', \\n '$18',\\n 'vitae congue mauris rhoncus aenean vel elit scelerisque'));\\n farmMenu.appendChild(createItem(\\n 'flemish onion soup', \\n '$10',\\n 'elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus'));\\n farmMenu.appendChild(createItem(\\n 'braised short ribs', \\n '$22',\\n 'sagittis purus sit amet volutpat consequat mauris nunc'));\\n farmMenu.appendChild(createItem(\\n 'wedge salad', \\n '$10',\\n 'nibh sed pulvinar proin gravida hendrerit lectus a'));\\n farmMenu.appendChild(createItem(\\n 'charcuterie', \\n '$16',\\n 'non blandit massa enim nec dui nunc mattis'));\\n\\n return farmMenu;\\n }\",\n \"function showShop() {\\n\\tmenuHideAll();\\n\\t$('#shop').show();\\n\\tmenuResetColors();\\n\\tmenuSetColor('shopBox');\\n}\",\n \"function showMenu( el, type ) {\\n\\tvar list;\\n\\tvar type;\\n\\tvar target;\\n\\n\\tlist = el.childNodes;\\n\\n\\tif( type == null ) {\\n\\t\\ttype = 'TABLE';\\n\\t}\\n\\n\\tif ( el.className == \\\"menutitle\\\" ) {\\n\\t\\t// el.style.color = \\\"#4c6490\\\";\\n\\t\\tel.style.color = \\\"#eeeeff\\\";\\n\\t\\tel.style.backgroundColor = 'white';\\n\\t\\tel.style.borderStyle = 'solid';\\n\\t\\tel.style.borderWidth = '1px';\\n\\t\\tel.style.borderColor = '#4c6490';\\n\\t\\tel.style.margin = '1px';\\n\\t}\\n\\n\\tfor ( i=0; i < list.length; i++ ) {\\n\\t\\tif(( list[i].nodeName == 'DIV' ) &&\\n\\t\\t\\t( list[i].className == \\\"submenuitem\\\" ) ) {\\n\\t\\t\\tlist[i].style.borderStyle = 'solid';\\n\\t\\t\\tlist[i].style.borderColor = '#ccc';\\n\\t\\t\\tlist[i].style.borderWidth = '1px';\\n\\t\\t\\tlist[i].style.backgroundColor = '#fefeff';\\n\\t\\t}\\n\\n\\t\\tif( list[i].nodeName != type ) {\\n\\t\\t\\tcontinue;\\n\\t\\t};\\n\\n\\t\\tfadeInit ( list[i], 'in' );\\n\\t}\\n}\",\n \"function display_start_menu() {\\n\\tstart_layer.show();\\n\\tstart_layer.moveToTop();\\n\\t\\n\\tdisplay_menu(\\\"start_layer\\\");\\n\\tcharacter_layer.moveToTop();\\n\\tcharacter_layer.show();\\n\\tinventory_bar_layer.show();\\n\\t\\n\\tstage.draw();\\n\\t\\n\\tplay_music('start_layer');\\n}\",\n \"function getMenu(str) {\\n \\n\\tmanageDOM.clearContent(\\\"content\\\");\\n \\n\\t// query mongoDB for cached menu\\n\\tlet day = str === \\\"today\\\" ? \\\"Today\\\" : \\\"Tomorrow\\\";\\n\\tlet menuDay = Menu.findOne( {\\\"day\\\": day});\\n \\n\\t// Builds html elements for either today's or tomorrow's menu\\n\\tmenuDay.exec( (err, data) => {\\n\\t\\tif (err) throw (err);\\n\\t\\telse if (data != null) {\\n\\t\\t\\tlet arr = [];\\n\\t\\t\\tlet i = 1;\\n\\n\\t\\t\\tif (data.meal_0 != null) { arr.push(JSON.parse(data.meal_0)); }\\n\\t\\t\\tif (data.meal_1 != null) { arr.push(JSON.parse(data.meal_1)); }\\n\\t\\t\\tif (data.meal_2 != null) { arr.push(JSON.parse(data.meal_2)); }\\n \\n\\t\\t\\t// create an array of elements to build the DOM\\n\\t\\t\\tlet meal_list = [\\\"cantina-wrapper center-div\\\", \\\"cantina-greet\\\"];\\n\\t\\t\\tfor (let j = 0; j < arr.length; j++) {\\n\\t\\t\\t\\tmeal_list.push(\\\"spacer\\\" + i);\\n\\t\\t\\t\\tmeal_list.push(\\\"time\\\" + i);\\n\\t\\t\\t\\tmeal_list.push(\\\"meal\\\" + i);\\n\\t\\t\\t\\ti++;\\n\\t\\t\\t}\\n\\t\\t\\tif (data.cafe42 != null) {\\n\\t\\t\\t\\tmeal_list.push(\\\"spacer\\\" + i);\\n\\t\\t\\t\\tmeal_list.push(\\\"cafe\\\");\\n\\t\\t\\t}\\n\\n\\t\\t\\tmanageDOM.array2Div(meal_list);\\n \\n\\t\\t\\tdocument.getElementById(\\\"cantina-greet\\\").innerHTML = \\\"the 42 cantina menu for \\\" + str + \\\" is\\\";\\n \\n\\t\\t\\t// for each div, give it a class and add appropriate content whether it is time or meal descroption\\n\\t\\t\\tfor (i = 2; i < meal_list.length; i++) {\\n\\t\\t\\t\\tif (meal_list[i][0] === \\\"t\\\") {\\n\\t\\t\\t\\t\\tlet date = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].begin_at));\\n\\t\\t\\t\\t\\tlet date_end = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].end_at));\\n\\t\\t\\t\\t\\tlet t = document.getElementById(meal_list[i]);\\n\\t\\t\\t\\t\\tlet item = arr[Math.floor((i - 1) / 3)];\\n\\t\\t\\t\\t\\tt.setAttribute(\\\"class\\\", \\\"cantina-hours\\\");\\n\\t\\t\\t\\t\\tt.innerHTML = \\\"\\\\\\n $\\\" + item.price + \\\" -- \\\\\\n Served from \\\" + date.format(\\\"HH:mm\\\") + \\\" until \\\" + date_end.format(\\\"HH:mm\\\") + \\\":\\\"; \\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse if (meal_list[i][0] === \\\"m\\\") {\\n\\t\\t\\t\\t\\tlet m = document.getElementById(meal_list[i]);\\n\\t\\t\\t\\t\\tm.setAttribute(\\\"class\\\", \\\"meal\\\");\\n\\t\\t\\t\\t\\tlet item = arr[Math.floor((i - 2) / 3)];\\n\\t\\t\\t\\t\\tlet br = item.menu;\\n\\n\\t\\t\\t\\t\\t// Replaces 'line feed' and 'carriage return' with and HTML break\\n\\t\\t\\t\\t\\tbr = br.replace(/\\\\r\\\\n/g, \\\"
            \\\");\\n\\t\\t\\t\\t\\tm.innerHTML = br; \\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse if (meal_list[i][0] === \\\"c\\\") {\\n\\t\\t\\t\\t\\tlet c = document.getElementById(\\\"cafe\\\");\\n\\t\\t\\t\\t\\tc.setAttribute(\\\"class\\\", \\\"meal\\\");\\n\\t\\t\\t\\t\\tlet cafe42 = JSON.parse(data.cafe42);\\n\\t\\t\\t\\t\\tlet cafe42Menu = cafe42.menu;\\n\\t\\t\\t\\t\\tcafe42Menu = cafe42Menu.replace(/\\\\r\\\\n/g, \\\"
            \\\").replace(\\\"cafe 42\\\",\\n\\t\\t\\t\\t\\t\\t\\\"Cafe 42: ~ \\\\\\n \\\\\\n $\\\" + cafe42.price + \\\"\\\");\\n\\t\\t\\t\\t\\tc.innerHTML = cafe42Menu;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tlet s = document.getElementById(meal_list[i]);\\n\\t\\t\\t\\t\\ts.setAttribute(\\\"class\\\", \\\"spacing\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Error retrieving Cantina menu from Mongo DB\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"function dashSubMenu(){\\n\\t\\t\\tif(wid <= 600){\\n\\t\\t\\t\\tmenuHS();\\t\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\t$(\\\"#dashInSubMenuId\\\").css(\\\"background-color\\\", \\\"#0E0E0E\\\");\\n\\t\\t\\t$(\\\"#costInSubMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\t$(\\\"#sellInSubMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\t$(\\\"#stockMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\t$(\\\"#settingInSubMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\twindow.location.assign(\\\"index.php\\\");\\n}\",\n \"function openNewGameMenu () {\\n document.getElementById('menu-background').style.display = 'block';\\n document.getElementById('menu-content').style.display = 'block';\\n}\",\n \"function AddCustomMenuItems(menu) {\\n menu.AddItem(strMenuItemLoop, \\n (doLoop == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\\n menu.AddItem(strMenuItemShuffle, \\n (doShuffle == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function init_dash() {\\n dropDown();\\n}\",\n \"setupMenu () {\\n let dy = 17;\\n // create buttons for the action categories\\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\\n // create buttons for each command\\n for (let key of Object.keys(this.jobCommands)) {\\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\\n dy += button.height + 1;\\n }\\n // set the hit area for the menu\\n this.menu.calculateHitArea();\\n // menu is closed by default\\n this.menu.hideMenu();\\n }\",\n \"function displayMenu() {\\n inquirer.prompt(menuChoices).then((response) => {\\n switch (response.selection) {\\n case \\\"View Departments\\\":\\n //call function that shows all departments\\n viewDepartments();\\n break;\\n\\n case \\\"Add Department\\\":\\n //call function that adds a department\\n addDepartment();\\n break;\\n\\n case \\\"View Roles\\\":\\n getRole();\\n break;\\n\\n case \\\"Add Role\\\":\\n addRole();\\n break;\\n\\n case \\\"View Employees\\\":\\n viewEmployee();\\n break;\\n\\n case \\\"Add Employee\\\":\\n addEmployee();\\n break;\\n\\n case \\\"Update Employee\\\":\\n break;\\n\\n default:\\n connection.end();\\n process.exit();\\n // quit the app\\n }\\n });\\n}\",\n \"function onOpen() {\\n ui.createMenu('Daily Delivery Automation')\\n .addItem('Run', 'confirmStart').addToUi();\\n}\",\n \"function menu() {\\n\\t\\n // Title of Game\\n title = new createjs.Text(\\\"Poker Room\\\", \\\"50px Bembo\\\", \\\"#FF0000\\\");\\n title.x = width/3.1;\\n title.y = height/4;\\n\\n // Subtitle of Game\\n subtitle = new createjs.Text(\\\"Let's Play Poker\\\", \\\"30px Bembo\\\", \\\"#FF0000\\\");\\n subtitle.x = width/2.8;\\n subtitle.y = height/2.8;\\n\\n // Creating Buttons for Game\\n addToMenu(title);\\n addToMenu(subtitle);\\n startButton();\\n howToPlayButton();\\n\\n // update to show title and subtitle\\n stage.update();\\n}\",\n \"function Restaurant(name, menu){\\n this.name = name;\\n this.menu = menu;\\n}\",\n \"function menuzordActive () {\\n if ($(\\\"#menuzord\\\").length) {\\n $(\\\"#menuzord\\\").menuzord({\\n indicatorFirstLevel: ''\\n });\\n };\\n}\",\n \"function C999_Common_Achievements_MainMenu() {\\n C999_Common_Achievements_ResetImage();\\n\\tSetScene(\\\"C000_Intro\\\", \\\"ChapterSelect\\\");\\n}\",\n \"function getMenus(restaurant) {\\n restaurantId = restaurant || \\\"\\\";\\n if (restaurantId) {\\n restaurantId = \\\"/?restaurant_id=\\\" + restaurantId;\\n }\\n $.get(\\\"/api/menus\\\" + restaurantId, function (data) {\\n console.log(\\\"Menus\\\", data);\\n menus = data;\\n if (!menus || !menus.length) {\\n displayEmpty(restaurant);\\n }\\n else {\\n initializeRows();\\n }\\n });\\n }\",\n \"showMenu() {\\n this._game = null;\\n this.stopRefresh();\\n this._view.renderMenu();\\n this._view.bindStartGame(this.startGame.bind(this));\\n this._view.bindShowScores(this.showScores.bind(this));\\n }\",\n \"function mainMenu() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"Add Departments\\\",\\n \\\"Add Roles\\\",\\n \\\"Add Employees\\\",\\n \\\"View Departments\\\",\\n \\\"View Roles\\\",\\n \\\"View Employees\\\",\\n \\\"Update Role\\\",\\n \\\"Update Manager\\\"\\n // \\\"View Employees by Manager\\\"\\n ]\\n })\\n // Case statement for selection of menu item\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"Add Departments\\\":\\n addDepartments();\\n break;\\n case \\\"Add Roles\\\":\\n addRoles();\\n break;\\n case \\\"Add Employees\\\":\\n addEmployees();\\n break;\\n case \\\"View Departments\\\":\\n viewDepartments();\\n break;\\n\\n case \\\"View Roles\\\":\\n viewRoles();\\n break;\\n case \\\"View Employees\\\":\\n viewEmployees();\\n break;\\n case \\\"Update Role\\\":\\n updateRole();\\n break;\\n case \\\"Update Manager\\\":\\n updateManager();\\n break;\\n // case \\\"View Employees by Manager\\\":\\n // viewEmployeesByManager();\\n // break;\\n }\\n });\\n}\",\n \"renderMenu(data) {\\n // check if there is 1 valid category\\n if (data.size < 1) {\\n selectors.$content.append(`

            Infelizmente, nenhuma notícia foi encontrada!

            `)\\n console.log(\\\"nenhuma categoria encontrada\\\");\\n return;\\n }\\n\\n data.forEach(el => {\\n selectors.$menu.append(`
          • ${el.nome}

          • `)\\n })\\n\\n\\n selectors.$menu.find(\\\"li\\\").filter(\\\".item\\\").on('click', (e) => {\\n this._initShowNews(e.currentTarget.id)\\n })\\n }\",\n \"function toMenu() {\\n\\tclearScreen();\\n\\tviewPlayScreen();\\n}\",\n \"function menu() {\\n inquirer\\n .prompt({\\n name: \\\"menuOptions\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products\\\", \\\"View Low Inventory\\\", \\\"Add Inventory\\\", \\\"Add New Product\\\"]\\n })\\n .then(function(answer) {\\n // based on their answer, run appropriate function\\n if (answer.menuOptions === \\\"View Products\\\") {\\n viewProducts();\\n }\\n else if (answer.menuOptions === \\\"View Low Inventory\\\") {\\n viewLowInventory();\\n }\\n else if (answer.menuOptions === \\\"Add Inventory\\\") {\\n addInventory();\\n }\\n else if (answer.menuOptions === \\\"Add New Product\\\") {\\n addNewProduct();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function testMenuPostion( menu ){\\n \\n }\",\n \"showQuickMenu() { $(`#${this.quickMenuId}`).show(); }\",\n \"function menu(){\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"exit\\\"\\n ]\\n }).then(function(answer){\\n switch(answer.action){\\n case \\\"View Products for Sale\\\":\\n products();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addToInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"exit\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function itemMenu(e) {\\n\\te.preventDefault();\\n\\tItemSelection = e.target;\\n\\tconst[idx, isSource] = findNode(ItemSelection);\\n\\tconst elemName = (isSource) ? \\\"sourceDropdown\\\" : \\\"deviceDropdown\\\";\\n\\tconst menu = document.getElementById(elemName);\\n\\tmenu.style.top = `${e.pageY}px`;\\n\\tmenu.style.left = `2rem`;\\n\\tmenu.classList.toggle(\\\"show\\\");\\n}\",\n \"function showHoodies()\\n{\\n\\t//show all items with theid 'hoodies'\\n\\tdocument.getElementById('hoodies').style.display = \\\"block\\\";\\n\\t//hide all other items\\n\\tdocument.getElementById('hats').style.display = \\\"none\\\";\\n\\tdocument.getElementById('accessories').style.display = \\\"none\\\";\\n\\tdocument.getElementById('skate').style.display = \\\"none\\\";\\n\\tdocument.getElementById('show').style.display = \\\"block\\\";\\n}\",\n \"constructor(){\\n super();\\n this.menu = [\\n {\\n path: '/',\\n title: 'Home'\\n },\\n {\\n path: '/npc',\\n title: 'Npc\\\\'s'\\n },\\n {\\n path: '/enemies',\\n title: 'Enemies'\\n },\\n {\\n path: '/bosses',\\n title: 'Bosses'\\n },\\n {\\n path: '/places',\\n title: 'Places'\\n },\\n {\\n path: '/about',\\n title: 'About'\\n },\\n ];\\n }\",\n \"function showMenu() {\\n if(newGame) {\\n $('#main').show();\\n }\\n else {\\n $('#end').show();\\n }\\n}\",\n \"function superfishSetup() {\\n\\t\\t$('#navigation').find('.menu').superfish({\\n\\t\\t\\tdelay: 200,\\n\\t\\t\\tanimation: {opacity:'show', height:'show'},\\n\\t\\t\\tspeed: 'fast',\\n\\t\\t\\tcssArrows: true,\\n\\t\\t\\tautoArrows: true,\\n\\t\\t\\tdropShadows: false\\n\\t\\t});\\n\\t}\",\n \"function renderDish(dish) {\\n //setting up column and cards to add to the row\\n let column = $(\\\"
            \\\");\\n //Create dish card\\n let card = $(\\\"
            \\\");\\n card.addClass(\\\"card z-depth-4\\\");\\n card.attr(\\\"data-number\\\", dish.dishNumber);\\n\\n //set up image with title and button---------\\n let cardImg = $(\\\"
            \\\");\\n cardImg.addClass(\\\"card-image\\\");\\n let img = $(\\\"\\\");\\n img.attr(\\\"src\\\", dish.foodImg);\\n //setting up title\\n let titleSpan = $(\\\"\\\");\\n titleSpan.addClass(\\\"card-title\\\");\\n let title = $(\\\"

            \\\");\\n titleSpan.append(title);\\n cardImg.append(img);\\n cardImg.append(titleSpan);\\n\\n let recipe = $(\\\"

            \\\");\\n //If no ingredients, dish is part of a choice\\n if (!dish.ingredients) {\\n //Choices is 3x2 at l\\n column.addClass(\\\"col s12 m6 l4\\\");\\n // Add choice class to attach to an event listener\\n card.addClass(\\\"hoverable choices\\\");\\n // Add button\\n let aTag = $(\\\"\\\");\\n aTag.addClass(\\\"btn-floating btn-large btn waves-effect waves-red halfway-fab cyan pulse\\\");\\n let iTag = $(\\\"\\\");\\n iTag.addClass(\\\"material-icons\\\");\\n iTag.text(\\\"add\\\");\\n aTag.append(iTag);\\n cardImg.append(aTag);\\n // Title goes in content \\n recipe.text(dish.foodName);\\n } else {\\n // If dish is not a choice is final result title goes in header and ingredients go in content\\n column.addClass(\\\"col s12 m6 l6\\\");\\n title.text(dish.foodName);\\n let header = $(\\\"

            \\\").text(\\\"Ingredients:\\\");\\n recipe.append(header);\\n for (let i = 0; i < dish.ingredients.length; i++){\\n let ingredient = $(\\\"

            \\\");\\n ingredient.text(`${i + 1}. ${dish.ingredients[i]}`)\\n recipe.append(ingredient);\\n }\\n }\\n\\n //setting up content-----------------------\\n let content = $(\\\"

            \\\");\\n content.addClass(\\\"card-content\\\");\\n content.append(recipe);\\n\\n //done setting up content / Append everythin to row\\n card.append(cardImg);\\n card.append(content);\\n column.append(card);\\n $(\\\"#choices\\\").append(column);\\n}\",\n \"function openMenu() {\\n g_IsMenuOpen = true;\\n}\",\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function getSubChapterMenu(){\\n\\t\\n}\",\n \"function createMenu() {\\n zeroStarArrays();\\n num_stars_input = createInput('');\\n num_stars_input.position(20, 50);\\n submit_num = createButton('# Stars');\\n submit_num.position(20 + num_stars_input.width, 50);\\n submit_num.mousePressed(setNumStars);\\n num_planets_input = createInput('');\\n num_planets_input.position(20 + num_stars_input.width + 70, 50);\\n submit_num_planets = createButton('# Planets');\\n submit_num_planets.position(20 + num_planets_input.width + num_stars_input.width + 70, 50);\\n submit_num_planets.mousePressed(setNumPlanets);\\n}\",\n \"function tl_start() {\\n $('#futureman_face, #menu-open').css('display', 'inherit');\\n $('.menu-open').css('visibility', 'inherit');\\n }\",\n \"function setMenu(menu){ \\n switch(menu){\\n case 'food-input-icon':\\n loadFoodMenu();\\n break; \\n \\n case 'stats-icon':\\n loadStatsMenu(); \\n break; \\n \\n case 'settings-icon':\\n loadSettingsMenu(); \\n break;\\n \\n case 'share-icon':\\n loadShareMenu(); \\n break;\\n \\n case 'sign-out-icon':\\n signOut(); \\n break;\\n case 'nav-icon':\\n loadNavMenu(); \\n \\n }\\n}\",\n \"function handleMenu(){\\n\\t$(\\\"#examples-menu\\\").mouseover(function(){\\n\\t\\tvar position = $(\\\"#examples-menu\\\").offset();\\n\\t\\tvar top = $(\\\"#examples-menu\\\").outerHeight();\\n\\t\\t$(\\\"ul.examples\\\").offset({left:position.left, top:top+position.top});\\n\\t\\t$(\\\"ul.examples\\\").show();\\n\\t})\\n\\t$(\\\"h1,table,img,form\\\").mouseover(function(){\\n\\t\\t$(\\\"ul.examples\\\").offset({left:0, top:0});\\n\\t\\t$(\\\"ul.examples\\\").hide();\\n\\t})\\t\\n}\",\n \"function mainMenu() {\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n { name: \\\"Add something\\\", value: createMenu },\\n { name: \\\"View something\\\", value: readMenu },\\n { name: \\\"Change something\\\", value: updateMenu },\\n { name: \\\"Remove something\\\", value: deleteMenu },\\n { name: \\\"Quit\\\", value: quit }\\n ]\\n }).then(({ action }) => action());\\n}\",\n \"function menu() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"Supervisor's Menu Options:\\\",\\n choices: [\\\"View Product Sales By Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"]\\n }\\n ]).then(function (answers) {\\n if (answers.choice === \\\"View Product Sales By Department\\\") {\\n displaySales();\\n }\\n else if (answers.choice === \\\"Create New Department\\\") {\\n createDepartment();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"showQuickMenu() { $(`.${this.quickMenu}`).show(); }\",\n \"function actionOnClick () {\\r\\n game.state.start(\\\"nameSelectionMenu\\\");\\r\\n}\",\n \"function mainMenuShow () {\\n $ (\\\"#menuButton\\\").removeAttr (\\\"title-1\\\");\\n $ (\\\"#menuButton\\\").attr (\\\"title\\\", htmlSafe (\\\"Stäng menyn\\\")); // i18n\\n $ (\\\"#menuButton\\\").html (\\\"×\\\");\\n $ (\\\".mainMenu\\\").show ();\\n}\",\n \"function burstMenu(title,color,selected) {\\t\\njQuery('.menu-item-'+title).mouseover(function () {\\n \\n jQuery('.show-item-'+title).css({\\n visibility: 'visible',\\n\\t\\t'z-index': '2'\\n });\\n\\t\\n\\t\\n jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n\\n jQuery('.show-item-'+title).mouseover(function () {\\n jQuery('.show-item-'+title).css({\\n visibility: 'visible',\\n\\t\\t\\t'z-index': '2'\\n });\\n jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n });\\n\\n jQuery('.show-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css({\\n visibility: 'hidden'\\n });\\n jQuery('.menu-item-'+title+' > a').css({\\n background: 'inherit'\\n })\\n });\\n\\n});\\n\\njQuery('.menu-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css({\\n visibility: 'hidden'\\n });\\n jQuery('.menu-item-'+title+' > a').css({\\n background: 'inherit'\\n })\\n});\\n\\nif (selected == true) {\\n \\njQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\\n\\n\\t jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n\\t\\t\\t\\n\\tjQuery('.menu-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\\n jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n\\t\\n\\t jQuery('.show-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\\n\\t jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n });\\n\\t\\n});\\n\\t\\t\\n}\\n\\t\\n}\",\n \"function qll_module_erepmenu()\\r\\n{\\r\\n\\tvar menu= new Array();\\r\\n\\tvar ul = new Array();\\r\\n\\r\\n\\tmenu[0]=document.getElementById('menu');\\r\\n\\tfor(i=1;i<=6;i++)\\r\\n\\t\\tmenu[i]=document.getElementById('menu'+i);\\r\\n\\t\\r\\n//\\tmenu[1].innerHTML=menu[1].innerHTML + '
              ';\\r\\n\\tmenu[2].innerHTML=menu[2].innerHTML + '
                ';\\r\\n\\tmenu[3].innerHTML=menu[3].innerHTML + '
                  ';\\r\\n\\tmenu[6].innerHTML=menu[6].innerHTML + '
                    ';\\r\\n\\t\\r\\n\\tfor(i=1;i<=6;i++)\\r\\n\\t\\tul[i]=menu[i].getElementsByTagName(\\\"ul\\\")[0];\\r\\n\\t\\r\\n\\tif(qll_opt['module:erepmenu:design'])\\r\\n\\t{\\r\\n\\t\\r\\n\\t\\t//object.setAttribute('class','new_feature_small');\\r\\n\\t\\t\\t\\r\\n\\t//\\tmenu[2].getElementsByTagName(\\\"a\\\")[0].href = \\\"http://economy.erepublik.com/en/time-management\\\";\\r\\n\\t\\t\\r\\n\\t\\t/*aux = ul[2].removeChild(ul[2].getElementsByTagName(\\\"li\\\")[6]);\\t// adverts\\r\\n\\t\\tul[6].appendChild(aux);\\r\\n\\t\\t\\r\\n\\t\\t*/\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='
                    ' + \\\"Work\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Training grounds\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Newspaper\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Inventory\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Organizations\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + qll_lang[97] + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + qll_lang[69] + '';\\r\\n\\t\\tul[3].appendChild(object);\\r\\n\\t\\t//ul[4].insertBefore(object,ul[4].getElementsByTagName(\\\"li\\\")[3])\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Loyalty program\\\" + '';\\r\\n\\t\\tul[6].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Gold bonus\\\" + '';\\r\\n\\t\\tul[6].appendChild(object);\\r\\n\\t\\t\\r\\n\\t}\\r\\n}\",\n \"function goToMenu() {\\n stopTTS();\\n cStatus = undefined;\\n cStatus = new CurrentStatus();\\n $('#quiz').hide('slow');\\n $('#game').hide('slow');\\n $('#menu').show('slow');\\n}\",\n \"removeDishFromMenu(id) {\\n this.menu = this.menu.filter(dish => dish.id !== id)\\n }\",\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"function dropMenu() {\\r\\n // the menu content\\r\\n document.getElementById(\\\"menu1\\\").innerHTML = \\\"Guess Table\\\";\\r\\n\\r\\n}\",\n \"function menu() {\\n if (currentPlayerPokemon.fainted == true) {\\n return;\\n }\\n rollText(\\\"battle_text\\\", `What will ${currentPlayerPokemon.name} do?`, 25);\\n document.getElementById('buttonsBattle').style['display'] = 'block';\\n button1.className = `buttons`;\\n button2.className = `buttons`;\\n button3.className = `buttons`;\\n button4.className = `buttons`;\\n button1.innerHTML = `FIGHT`;\\n button2.innerHTML = `ITEM`;\\n button3.innerHTML = `POKEMON`;\\n button4.innerHTML = `RUN`;\\n\\n button1.onclick = () => fight(currentPlayerPokemon);\\n button2.onclick = () => item();\\n button3.onclick = () => pokemon(playerParty);\\n button4.onclick = () => run();\\n}\",\n \"function mainMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"introAction\\\",\\n\\t\\tmessage: \\\"Welcome, pick an action: \\\",\\n\\t\\tchoices: [\\\"Create a Basic Card\\\", \\\"Create a Cloze Card\\\", \\\"Review Existing Cards\\\"]\\n\\t}]).then(function(answers){\\n\\t\\tswitch (answers.introAction) {\\n\\t\\t\\tcase \\\"Create a Basic Card\\\":\\n\\t\\t\\t\\tcreateBasicCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Create a Cloze Card\\\":\\n\\t\\t\\t\\tcreateClozeCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Review Existing Cards\\\":\\n\\t\\t\\t\\treviewCards();\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t});\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.66595","0.64337385","0.6374985","0.63151807","0.62984025","0.6261499","0.6255055","0.6168333","0.61503583","0.6132916","0.61064476","0.6048671","0.6040572","0.6017006","0.5998923","0.59902024","0.5983666","0.59650725","0.5962446","0.5915375","0.5912792","0.59121364","0.5911866","0.5911696","0.5905214","0.59035945","0.5899958","0.5891164","0.5882462","0.58595324","0.58547086","0.5854284","0.58526087","0.583259","0.5830709","0.58274823","0.5813961","0.5812124","0.5797904","0.5759864","0.5732339","0.57148737","0.5710819","0.5699959","0.5686173","0.56829816","0.5677685","0.56698877","0.5659554","0.56568444","0.5652748","0.56493646","0.56424826","0.5642481","0.5641755","0.564039","0.56296396","0.5629234","0.5629091","0.56274974","0.5624148","0.5619158","0.5611","0.56060624","0.5605676","0.5599713","0.5596655","0.5595992","0.55835587","0.55754477","0.556761","0.55617565","0.55570567","0.5550096","0.55421996","0.553594","0.5530451","0.5529532","0.55289465","0.5528202","0.5525739","0.5524392","0.55229825","0.55216175","0.5516837","0.5515344","0.5509678","0.5508808","0.5508006","0.5507807","0.550743","0.5506251","0.55015975","0.54994977","0.5493036","0.548052","0.547813","0.54749167","0.5469427","0.5464616"],"string":"[\n \"0.66595\",\n \"0.64337385\",\n \"0.6374985\",\n \"0.63151807\",\n \"0.62984025\",\n \"0.6261499\",\n \"0.6255055\",\n \"0.6168333\",\n \"0.61503583\",\n \"0.6132916\",\n \"0.61064476\",\n \"0.6048671\",\n \"0.6040572\",\n \"0.6017006\",\n \"0.5998923\",\n \"0.59902024\",\n \"0.5983666\",\n \"0.59650725\",\n \"0.5962446\",\n \"0.5915375\",\n \"0.5912792\",\n \"0.59121364\",\n \"0.5911866\",\n \"0.5911696\",\n \"0.5905214\",\n \"0.59035945\",\n \"0.5899958\",\n \"0.5891164\",\n \"0.5882462\",\n \"0.58595324\",\n \"0.58547086\",\n \"0.5854284\",\n \"0.58526087\",\n \"0.583259\",\n \"0.5830709\",\n \"0.58274823\",\n \"0.5813961\",\n \"0.5812124\",\n \"0.5797904\",\n \"0.5759864\",\n \"0.5732339\",\n \"0.57148737\",\n \"0.5710819\",\n \"0.5699959\",\n \"0.5686173\",\n \"0.56829816\",\n \"0.5677685\",\n \"0.56698877\",\n \"0.5659554\",\n \"0.56568444\",\n \"0.5652748\",\n \"0.56493646\",\n \"0.56424826\",\n \"0.5642481\",\n \"0.5641755\",\n \"0.564039\",\n \"0.56296396\",\n \"0.5629234\",\n \"0.5629091\",\n \"0.56274974\",\n \"0.5624148\",\n \"0.5619158\",\n \"0.5611\",\n \"0.56060624\",\n \"0.5605676\",\n \"0.5599713\",\n \"0.5596655\",\n \"0.5595992\",\n \"0.55835587\",\n \"0.55754477\",\n \"0.556761\",\n \"0.55617565\",\n \"0.55570567\",\n \"0.5550096\",\n \"0.55421996\",\n \"0.553594\",\n \"0.5530451\",\n \"0.5529532\",\n \"0.55289465\",\n \"0.5528202\",\n \"0.5525739\",\n \"0.5524392\",\n \"0.55229825\",\n \"0.55216175\",\n \"0.5516837\",\n \"0.5515344\",\n \"0.5509678\",\n \"0.5508808\",\n \"0.5508006\",\n \"0.5507807\",\n \"0.550743\",\n \"0.5506251\",\n \"0.55015975\",\n \"0.54994977\",\n \"0.5493036\",\n \"0.548052\",\n \"0.547813\",\n \"0.54749167\",\n \"0.5469427\",\n \"0.5464616\"\n]"},"document_score":{"kind":"string","value":"0.6014771"},"document_rank":{"kind":"string","value":"14"}}},{"rowIdx":65,"cells":{"query":{"kind":"string","value":"Fastfood restaurant scene start."},"document":{"kind":"string","value":"function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\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 startup() {\n\tsceneTransition(\"start\");\n}","function start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}","function start() {\n for(var i = 0; i < sceneList.length; i++) {\n addScene(sceneList[i]); // sceneList.js is imported in html-file\n }\n setScene(\"start\");\n }","function start(){\n renderGameField();\n resizeGameField();\n spawnSnake();\n spawnFood();\n eatFood();\n renderSnake();\n}","function sceneStart(){\n\t\t\t\tfor (n = 0; n < heroes.length; n++)\n\t\t\t\t\theroes[n].tl.delay(20).fadeIn(35);\n\t\t\t\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\n\t\t\t\tgame.sceneStarted = true;\n\t\t\t\tthreatBar.opacity = 1;\n\t\t\t\tthreatGuage.opacity = 1;\n\t\t\t\tmonsterBox.opacity = 1;\n\t\t\t\tmonsterName.opacity = 1;\n\t\t\t\tpartyBox.opacity = 1;\n\t\t\t\tmuteButton.opacity = 1;\n\t\t\t\tfor (n = 0; n < nameLabels.length; n++){\n\t\t\t\t\tnameLabels[n].opacity = 1;\n\t\t\t\t\thpLabels[n].opacity = 1;\n\t\t\t\t\tmaxhpLabels[n].opacity = 1;\n\t\t\t\t\tmpLabels[n].opacity = 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\t}","_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }","function start()\n{\n clear();\n console.log(\"==============================================\\n\");\n console.log(\" *** Welcome to the Interstellar Pawn Shop *** \\n\");\n console.log(\"==============================================\\n\");\n console.log(\"We carry the following items:\\n\");\n readCatalog();\n}","static start() {\n this.buttonCreate();\n this.buttonHideModal();\n\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\n // Animal.createAnimal('Liutas', 35, 'brown', false);\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\n\n this.load();\n }","function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}","function Start(){\n activeScene.traverse(function(child){\n if(child.awake != undefined){\n child.awake();\n }\n });\n\n activeScene.traverse(function(child){\n if(child.start != undefined){\n child.start();\n }\n });\n activeScene.isReady = true;\n}","function start() {\n restarts++;\n currentScene = scenes[0];\n currentTextIndex = 0;\n\n setMainImage();\n setMainText();\n hideSetup();\n updateStats();\n}","function start(){\n\t\n}","startGame() {\n this.scene.start('MenuScene');\n }","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Galaga()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","function start() {\n\n console.log(\"\\n\\t ------------Welcome to Bamazon Store-------------\");\n showProducts();\n\n\n\n}","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Plague()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","function start() {\n startMove = -kontra.canvas.width / 2 | 0;\n startCount = 0;\n\n audio.currentTime = 0;\n audio.volume = options.volume;\n audio.playbackRate = options.gameSpeed;\n\n ship.points = [];\n ship.y = mid;\n\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\n showTutorialBars = true;\n isTutorial = true;\n tutorialScene.show();\n}","function go() {\n console.log('go...')\n \n const masterT = new TimelineMax();\n \n masterT\n .add(clearStage(), 'scene-clear-stage')\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\n .add(enterTreeStuff(), 'scene-enter-treestuff')\n .add(enterGreet(), 'scene-enter-greet')\n ;\n }","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n }","async start() {\n // Navbar in header\n this.navbar = new Navbar();\n this.navbar.render('header');\n\n // Footer renderin\n this.footer = new Footer();\n this.footer.render('footer');\n\n this.myFavorites = new Favorites();\n\n setTimeout(() => {\n this.router = new Router(this.myFavorites);\n }, 0)\n }","StartGame(player, start){\n this.scene.start('level1');\n }","function start() {\n init();\n run();\n }","function start(){\n\tcreateDucks(amountDucks, startGame);\n}","start() {// [3]\n }","function setup_goToStart(){\n // what happens when we move to 'goToStart' section of a trial\n wp.trialSection = 'goToStart';\n unstageArray(fb_array);\n\n // update objects\n choiceSet.arc.visible = false;\n choiceSet.arc_glow.visible = false;\n startPoint.sp.visible = true;\n startPoint.sp_glow.visible = false;\n\n // update messages\n msgs.goToStart.visible = true;\n msgs.tooSlow.visible = false;\n\n stage.update();\n }","function FXstart (){\n setTimeout(FXdisplayLaunch, 1500);\n FXweatherGeolocation();\n FXdisplayMarsWeather();\n }","function start (p){\n\tresetting=true;\n\tfoodCounter=0;\n\tdeleteAllFood();\n\treset(p);\n}","function start(){\n // First/starting background\n imageMode(CENTER);\n image(gamebackground, width/2, height/2, width, height);\n fill(255);\n text(\"Master of Pie\", width/2 - width/20, height/4);\n text(\"Start\", width/2 - width/75, height/2);\n text(\"(Landscape Orientation Preferred)\", width/2 - width/10, height/4 + height/14);\n // Pizzas array is cleared\n pizzas = [];\n // Creates the ship\n ship = new Spacecraft();\n // Creates pizzas/asteroids at random places offscreen\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\n }\n // Reset variables\n click3 = true;\n reload = 10;\n piecutter = [];\n pizzaorder = 1;\n level = 1;\n}","function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}","function start() {\n\n}","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n this._router.resolve();\n }","function start() {\n //Currently does nothing\n }","function start() {\n getTodosFromLs();\n addTodoEventListeners();\n sidebar();\n updateTodaysTodoList();\n calendar();\n}","function startLevel1(){\n teleMode = false;\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('state0');\n }, this);\n}","function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }","function initScene1() {\n if (currentScene === 1) {\n\n $('#game1').show(\"fast\");\n\n //clique sur une porte\n $('.dungeon0Door').on('click', function (e) {\n console.log(currentScene);\n if (consumeEnergy(10)) {\n if (oD10.roll() >= 8) {\n printConsole('Vous vous echappez du donjon');\n loadScene(2);\n } else {\n printConsole(\"Ce n'est pas la bonne porte ..\");\n $('.dungeon0Door').animate({\n opacity: '0'\n }, 'slow', function () {\n $('.dungeon0Door').animate({\n opacity: '1'\n }, 'fast');\n });\n }\n }\n });\n }\n }","function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }","startScene() {\n console.log('[Game] startScene');\n var that = this;\n\n if (this.scene) {\n console.log('[Game] loading scene');\n this.scene.load().then(() => {\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\n // setTimeout(function() {\n debugger;\n that.scene.start();\n debugger;\n that._runSceneLoop();\n that._renderSceneLoop();\n // }, 0);\n });\n } else {\n console.log('[Game] nothing to start: no scene selected!!');\n }\n }","async function start() {\n await hydrate();\n\n new Search(\".search\");\n\n const keywords = new Keywords(\".keywords\");\n searchStore.subscribe(keywords);\n\n const menuDevices = new Devices(\".menu-devices\");\n deviceStore.subscribe(menuDevices);\n dataStore.subscribe(menuDevices);\n\n const menuIngredients = new Ingredients(\".menu-ingredients\");\n dataStore.subscribe(menuIngredients);\n ingredientStore.subscribe(menuIngredients);\n\n const menuUstensils = new Ustensils(\".menu-ustensils\");\n dataStore.subscribe(menuUstensils);\n ustensilStore.subscribe(menuUstensils);\n\n const recipes = new Recipes(\".recipes\");\n dataStore.subscribe(recipes);\n searchStore.subscribe(recipes);\n}","function start() {\n\n id = realtimeUtils.getParam('id');\n if (id) {\n // Load the document id from the URL\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\n init();\n } else {\n // Create a new document, add it to the URL\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\n window.history.pushState(null, null, '?id=' + createResponse.id);\n id=createResponse.id;\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\n init();\n });\n \n }\n \n \n }","function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}","function begin() {\n\tbackgroundBox = document.getElementById(\"BackgroundBox\");\n\n\tbuildGameView();\n\tbuildMenuView();\n\n\tinitSFX();\n\tinitMusic();\n\n\tENGINE_INT.start();\n\n\tswitchToMenu(new TitleMenu());\n\t//startNewGame();\n}","start() {\n this.currentTaskType = \"teil-mathe\";\n this.v.setup();\n this.loadTask();\n }","doReStart() {\n // Stoppe la musique d'intro\n this.musicIntro.stop();\n // Lance la scene de menus\n this.scene.start('MenuScene');\n }","function start() {\n action(1, 0, 0);\n}","function start () {\n gmCtrl.setObj();\n uiCtrl.setUi();\n }","function startApp() {\n displayProducts();\n}","function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}","function start() {\r\n var questions = [{\r\n type: 'rawlist',\r\n name: 'choice',\r\n message: 'What would you like to do?',\r\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit Store\"]\r\n }];\r\n inquirer.prompt(questions).then(answers => {\r\n mainMenu(answers.choice);\r\n });\r\n}","function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}","function start() { \n initiate_graph_builder();\n initiate_job_info(); \n initiate_aggregate_info();\n initiate_node_info();\n}","function startup() {\n\tsaveSlot('rainyDayZRestart');\n\tfooterVisibility = document.getElementById(\"footer\").style.visibility;\n\tfooterHeight = document.getElementById(\"footer\").style.height;\t\n\tfooterOverflow = document.getElementById(\"footer\").style.overflow;\t\n\twrapper.scrollTop = 0;\n\tupdateMenu();\n\thideStuff();\n\tif(localStorage.getItem('rainyDayZAuto')) {\n\t\tloadSlot('rainyDayZAuto');\n\t}\n\telse{\n\t\tsceneTransition('start');\n\t}\n}","function start() {\n \tkran.init(\"all\");\n \trequestAnimationFrame(gameLoop);\n }","create() {\n\n // add animations (for all scenes)\n this.addAnimations();\n\n // change to the \"Home\" scene and provide the default chord progression / sequence\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\n }","function start(){\r\n\t\t// for now, start() will call _draw(), which draws all the objects on the stage\r\n\t\t// but in the next lesson, we'll add an animation loop that calls _draw()\r\n\t\t_draw(ctx);\r\n\t}","function createStart(){\n // scene components\n startScreen = initScene();\n startText = createSkyBox('libs/Images/startscene.png', 10);\n startScreen.add(startText);\n\n // lights\n \t\tvar light = createPointLight();\n \t\tlight.position.set(0,200,20);\n \t\tstartScreen.add(light);\n\n // camera\n \t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\n \t\tstartCam.position.set(0,50,1);\n \t\tstartCam.lookAt(0,0,0);\n }","function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}","function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}","function requestFish() {\n // all_stopped = 1;\n //addFish++;\n\n view.resize(300,300);\n aquarium.viewport(300,300)\n aquarium.prepare();\n}","function start() {\n console.log(\"Loop\");\n generateArt();\n}","function start() {\n\t\t\tsetTimeout(startUp, 0);\n\t\t}","function startRitual() {\n\tconsole.log(\"** glitter **\");\n\tflash(pump);\n}","start() {\n\t\tthis.emit(\"game_start\");\n\t}","function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","start() {// Your initialization goes here.\n }","function startEncounter(){\n\tthis.scene.start('Battle', {type: 'encounter'})\n}","function start() {\n INFO(\"start\", clock()+\"msecs\")\n loadThemeScript();\n if (window.MathJax)\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);\n beginInteractionSessions(QTI.ROOT);\n setTimeout(initializeCurrentItem, 100);\n setInterval(updateTimeLimits, 100);\n document.body.style.display=\"block\";\n INFO(\"end start\", clock()+\"msecs\");\n }","function gamestart() {\n\t\tshowquestions();\n\t}","function start() {\n\n // Make sure we've got all the DOM elements we need\n setupDOM();\n\n // Updates the presentation to match the current configuration values\n configure();\n\n // Read the initial hash\n readURL();\n\n // Notify listeners that the presentation is ready but use a 1ms\n // timeout to ensure it's not fired synchronously after #initialize()\n setTimeout(function () {\n dispatchEvent('ready', {\n 'indexh': indexh,\n 'indexv': indexv,\n 'currentSlide': currentSlide\n });\n }, 1);\n\n }","function startGame() {\n\tsetup();\n\tmainLoop();\n}","function startScreen() {\n mainContainer.append(startButton)\n }","function start() {\n console.log(\"Welcome to the Employee Tracker\");\n inquirer\n .prompt(menuOptions)\n .then((response) => {\n console.log(response);\n switch (response.mainMenu) {\n case \"View all departments\":\n queries.viewDepartments();\n break;\n\n case \"View all roles\":\n queries.viewRoles();\n break;\n\n case \"View all employees\":\n queries.viewEmployees();\n break;\n\n case \"Add a department\":\n queries.addDepartment();\n break;\n\n case \"Add a role\":\n queries.addRole();\n break;\n\n case \"Add an employee\":\n queries.addEmployee();\n break;\n\n case \"Update an employee role\":\n queries.updateRole();\n break;\n\n case \"Quit\":\n queries.quit();\n break;\n\n default:\n break;\n }\n });\n}","function main(){\n\t//Initialice with first episode\n\tvar sel_episodes = [1]\n\t//collage(); //Create a collage with all the images as initial page of the app\n\tpaintCharacters();\n\tpaintEpisodes();\n\tpaintLocations(sel_episodes);\n}","create() {\n // We have nothing left to do here. Start the next scene.\n \n\n this.input.on('pointerdown', function (pointer) {\n\n this.scene.start('Game');\n }, this);\n\n \n }","create(){\n this.scene.start('MenuGame');\n }","function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Exit\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n viewLowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}","function start() {\n console.log(\"Animation Started\");\n\n let masterTl = new TimelineMax();\n\n //TODO: add childtimelines to master\n masterTl\n .add(clearStage(), \"scene-clear-stage\")\n .add(enterFloorVegetation(), \"scene-floor-vegitation\")\n .add(enterTreeStuff(), \"tree-stuff\");\n }","function run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}","function start() {\n\tconsole.log(\"\\nWELCOME TO THE BAMAZON STORE!\\n\");\n\tinquirer.prompt(\n\t\t{\n\t\t\tname: \"browse\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to browse the available products?\"\n\t\t}\n\t).then(function(answer) {\n\t\tif (answer.browse) {\n\t\t\tdisplayProducts();\n\t\t} else {\n console.log(\"Come back soon, have a nice day!\")\n\t\t\tconnection.end();\n\t\t}\n });\n \n}","function start() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\"\n ],\n message: \"Select an option.\"\n }\n ])\n .then(function (answers) {\n switch (answers.choice) {\n case \"View Products for Sale\":\n productsForSale();\n break;\n case \"View Low Inventory\":\n lowInventory();\n break;\n case \"Add to Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n newProduct();\n break;\n }\n });\n}","function start () {\n\t\t\n\t\t// if has not started planting and plant is valid\n\t\t\n\t\tif ( this.started !== true && this.puzzle instanceof _Puzzle.Instance && this.puzzle.started === true && this.plant instanceof _GridElement.Instance ) {\n\t\t\tconsole.log('start PLANTING!');\n\t\t\t\n\t\t\t// set started\n\t\t\t\n\t\t\tthis.started = true;\n\t\t\t\n\t\t\t// start updating planting\n\t\t\t\n\t\t\tthis.update();\n\t\t\tshared.signals.gameUpdated.add( this.update, this );\n\t\t\t\n\t\t}\n\t\t\n\t}","start () {\n this.stateLoop();\n }","function startMenu() {\n createManager();\n}","initializeScene(){}","start () {\n // Draw the starting point for the view with no elements\n }","start () {\n // Draw the starting point for the view with no elements\n }","function Aside() {\n appStarted = true;\n // all objects added to the stage appear in \"layer order\"\n // add a helloLabel to the stage\n seeMore = new objects.Label(\"Click me to see more of my work\", \"32px\", \"Times New Roman\", \"#000000\", canvasHalfWidth, canvasHalfHeight + 200, true);\n stage.addChild(seeMore);\n // add a clickMeButton to the stage\n treesharksLogo = new objects.Icon(loader, \"treesharksLogo\", canvasHalfWidth, canvasHalfHeight - 100, true);\n stage.addChild(treesharksLogo);\n }","function renderStartPage() {\n addView(startPage());\n}","function Start() {\n console.log(\"%c Game Started!\", \"color: blue; font-size: 20px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = 60; // 60 FPS\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n currentSceneState = scenes.State.NO_SCENE;\n config.Game.SCENE = scenes.State.START;\n }","start(){\r\n if (this.scene.scene\r\n .get(\"levelMap\")\r\n .localStorage.getItem(`${this.scene.key}R`) === null) {\r\n this.intro();\r\n }\r\n }","function startGame() {\r\n if (pressed == 0) {\r\n createRain();\r\n animate();\r\n }\r\n }","function start() {\n fly();\n\n}","function Start() {\n console.log(`%c Start Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = Config.Game.FPS;\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\n Main();\n }","function start() {\r\n\tconst config = validateConfiguration();\r\n\tif(config === false) {\r\n\t\talert(\"Please choose a proper configuration!\");\r\n\t\treturn;\r\n\t}\r\n\ttg = new TaskGenerator(config);\r\n\r\n\tdocument.getElementsByName(\"state:start\").forEach(function(e) {\r\n\t\te.style.display = \"none\";\r\n\t});\r\n\r\n\tdocument.getElementsByName(\"state:task\").forEach(function(e) {\r\n\t\te.style.display = \"block\";\r\n\t});\r\n\tdisplayTask();\r\n}","create(){\n this.add.text(20, 20, \"LoadingGame...\")\n\n this.time.addEvent({\n delay: 3000, // ms\n callback: function(){this.scene.start('MenuScene')},\n //args: [],\n callbackScope: this,\n loop: true \n });\n\n \n }","function start(state) { \n service.goNext(state);\n }","function reactionStart () {\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\n switchButton2(); // Zustand des Schaltknopfs ändern\n enableInput(false); // Eingabefelder deaktivieren\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\n else stopAnimation(); // ... oder stoppen\n reaction(); // Eingegebene Werte übernehmen und rechnen\n paint(); // Neu zeichnen\n }","function startScreen() {\n\tdraw();\n\tif(usuario_id !== -1)\n\t\tstartBtn.draw();\n}","function runStart()/* : void*/\n {\n this.setUp();\n }","function start() {\n //switch to scene 1\n window.inventoryActive = \"\";\n window.inventoryActive2 = \"\";\n window.inventory[1]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[2]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[3]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[4]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[5]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[6]= {id:\"\", inspected:false, desciption:\"\"};\n window.timerTime = null;\n window.inspectResultReceived =0;\n window.activeSlot = \"\";\n window.inspectResult= \"\";\n \n}"],"string":"[\n \"function startup() {\\n\\tsceneTransition(\\\"start\\\");\\n}\",\n \"function start() {\\n // To present a scene, use the following line, replacing 'sample' with\\n // the id of any scene you want to present.\\n\\n SceneManager.getSharedInstance().presentScene('newScene1');\\n}\",\n \"function start() {\\n for(var i = 0; i < sceneList.length; i++) {\\n addScene(sceneList[i]); // sceneList.js is imported in html-file\\n }\\n setScene(\\\"start\\\");\\n }\",\n \"function start(){\\n renderGameField();\\n resizeGameField();\\n spawnSnake();\\n spawnFood();\\n eatFood();\\n renderSnake();\\n}\",\n \"function sceneStart(){\\n\\t\\t\\t\\tfor (n = 0; n < heroes.length; n++)\\n\\t\\t\\t\\t\\theroes[n].tl.delay(20).fadeIn(35);\\n\\t\\t\\t\\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\\n\\t\\t\\t\\tgame.sceneStarted = true;\\n\\t\\t\\t\\tthreatBar.opacity = 1;\\n\\t\\t\\t\\tthreatGuage.opacity = 1;\\n\\t\\t\\t\\tmonsterBox.opacity = 1;\\n\\t\\t\\t\\tmonsterName.opacity = 1;\\n\\t\\t\\t\\tpartyBox.opacity = 1;\\n\\t\\t\\t\\tmuteButton.opacity = 1;\\n\\t\\t\\t\\tfor (n = 0; n < nameLabels.length; n++){\\n\\t\\t\\t\\t\\tnameLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\thpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmaxhpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmpLabels[n].opacity = 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t\\t}\",\n \"_start() {\\n\\n this._menuView = new MenuView(\\n document.querySelector('nav'),\\n this.sketches\\n );\\n\\n for (var key in this.sketches) {\\n this.DEFAULT_SKETCH = key;\\n break;\\n }\\n\\n this._setupScroll();\\n this._setupWindow();\\n this._onHashChange();\\n }\",\n \"function start()\\n{\\n clear();\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\" *** Welcome to the Interstellar Pawn Shop *** \\\\n\\\");\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\"We carry the following items:\\\\n\\\");\\n readCatalog();\\n}\",\n \"static start() {\\n this.buttonCreate();\\n this.buttonHideModal();\\n\\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\\n // Animal.createAnimal('Liutas', 35, 'brown', false);\\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\\n\\n this.load();\\n }\",\n \"function start(action) {\\r\\n\\t\\r\\n\\t\\tswitch (action) {\\r\\n\\t\\t\\tcase 'go look':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: What are you going to look at??\\\", 1000);\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'explore':\\r\\n\\t\\t\\t\\texploreship(gameobj.explore);\\r\\n\\t\\t\\t\\tgameobj.explore++;\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'sit tight':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: Good choice we should probably wait for John to get back.\\\", 1000);\\r\\n\\t\\t\\t\\tgameobj.sittight++;\\r\\n\\t\\t\\tbreak;\\t\\r\\n\\t\\t}\\r\\n}\",\n \"function Start(){\\n activeScene.traverse(function(child){\\n if(child.awake != undefined){\\n child.awake();\\n }\\n });\\n\\n activeScene.traverse(function(child){\\n if(child.start != undefined){\\n child.start();\\n }\\n });\\n activeScene.isReady = true;\\n}\",\n \"function start() {\\n restarts++;\\n currentScene = scenes[0];\\n currentTextIndex = 0;\\n\\n setMainImage();\\n setMainText();\\n hideSetup();\\n updateStats();\\n}\",\n \"function start(){\\n\\t\\n}\",\n \"startGame() {\\n this.scene.start('MenuScene');\\n }\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Galaga()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"function start() {\\n\\n console.log(\\\"\\\\n\\\\t ------------Welcome to Bamazon Store-------------\\\");\\n showProducts();\\n\\n\\n\\n}\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Plague()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"function start() {\\n startMove = -kontra.canvas.width / 2 | 0;\\n startCount = 0;\\n\\n audio.currentTime = 0;\\n audio.volume = options.volume;\\n audio.playbackRate = options.gameSpeed;\\n\\n ship.points = [];\\n ship.y = mid;\\n\\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\\n showTutorialBars = true;\\n isTutorial = true;\\n tutorialScene.show();\\n}\",\n \"function go() {\\n console.log('go...')\\n \\n const masterT = new TimelineMax();\\n \\n masterT\\n .add(clearStage(), 'scene-clear-stage')\\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\\n .add(enterTreeStuff(), 'scene-enter-treestuff')\\n .add(enterGreet(), 'scene-enter-greet')\\n ;\\n }\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n }\",\n \"async start() {\\n // Navbar in header\\n this.navbar = new Navbar();\\n this.navbar.render('header');\\n\\n // Footer renderin\\n this.footer = new Footer();\\n this.footer.render('footer');\\n\\n this.myFavorites = new Favorites();\\n\\n setTimeout(() => {\\n this.router = new Router(this.myFavorites);\\n }, 0)\\n }\",\n \"StartGame(player, start){\\n this.scene.start('level1');\\n }\",\n \"function start() {\\n init();\\n run();\\n }\",\n \"function start(){\\n\\tcreateDucks(amountDucks, startGame);\\n}\",\n \"start() {// [3]\\n }\",\n \"function setup_goToStart(){\\n // what happens when we move to 'goToStart' section of a trial\\n wp.trialSection = 'goToStart';\\n unstageArray(fb_array);\\n\\n // update objects\\n choiceSet.arc.visible = false;\\n choiceSet.arc_glow.visible = false;\\n startPoint.sp.visible = true;\\n startPoint.sp_glow.visible = false;\\n\\n // update messages\\n msgs.goToStart.visible = true;\\n msgs.tooSlow.visible = false;\\n\\n stage.update();\\n }\",\n \"function FXstart (){\\n setTimeout(FXdisplayLaunch, 1500);\\n FXweatherGeolocation();\\n FXdisplayMarsWeather();\\n }\",\n \"function start (p){\\n\\tresetting=true;\\n\\tfoodCounter=0;\\n\\tdeleteAllFood();\\n\\treset(p);\\n}\",\n \"function start(){\\n // First/starting background\\n imageMode(CENTER);\\n image(gamebackground, width/2, height/2, width, height);\\n fill(255);\\n text(\\\"Master of Pie\\\", width/2 - width/20, height/4);\\n text(\\\"Start\\\", width/2 - width/75, height/2);\\n text(\\\"(Landscape Orientation Preferred)\\\", width/2 - width/10, height/4 + height/14);\\n // Pizzas array is cleared\\n pizzas = [];\\n // Creates the ship\\n ship = new Spacecraft();\\n // Creates pizzas/asteroids at random places offscreen\\n for(let i = 0; i < pizzaorder; i++){\\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\\n }\\n // Reset variables\\n click3 = true;\\n reload = 10;\\n piecutter = [];\\n pizzaorder = 1;\\n level = 1;\\n}\",\n \"function start(){\\n\\t\\t //Initialize this Game. \\n newGame(); \\n //Add mouse click event listeners. \\n addListeners();\\n\\t\\t}\",\n \"function start() {\\n\\n}\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n this._router.resolve();\\n }\",\n \"function start() {\\n //Currently does nothing\\n }\",\n \"function start() {\\n getTodosFromLs();\\n addTodoEventListeners();\\n sidebar();\\n updateTodaysTodoList();\\n calendar();\\n}\",\n \"function startLevel1(){\\n teleMode = false;\\n fadeAll();\\n game.time.events.add(500, function() {\\n game.state.start('state0');\\n }, this);\\n}\",\n \"function startGame(){\\n getDictionary();\\n var state = $.deparam.fragment();\\n options.variant = state.variant || options.variant;\\n makeGameBoard();\\n loadState();\\n }\",\n \"function initScene1() {\\n if (currentScene === 1) {\\n\\n $('#game1').show(\\\"fast\\\");\\n\\n //clique sur une porte\\n $('.dungeon0Door').on('click', function (e) {\\n console.log(currentScene);\\n if (consumeEnergy(10)) {\\n if (oD10.roll() >= 8) {\\n printConsole('Vous vous echappez du donjon');\\n loadScene(2);\\n } else {\\n printConsole(\\\"Ce n'est pas la bonne porte ..\\\");\\n $('.dungeon0Door').animate({\\n opacity: '0'\\n }, 'slow', function () {\\n $('.dungeon0Door').animate({\\n opacity: '1'\\n }, 'fast');\\n });\\n }\\n }\\n });\\n }\\n }\",\n \"function App() {\\n var mouse = DreamsArk.module('Mouse');\\n //\\n // /**\\n // * start Loading the basic scene\\n // */\\n DreamsArk.load();\\n //\\n // mouse.click('#start', function () {\\n //\\n // start();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.skipper', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('#skip', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.reseter', function () {\\n //\\n // location.reload();\\n //\\n // return true;\\n //\\n // });\\n }\",\n \"startScene() {\\n console.log('[Game] startScene');\\n var that = this;\\n\\n if (this.scene) {\\n console.log('[Game] loading scene');\\n this.scene.load().then(() => {\\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\\n // setTimeout(function() {\\n debugger;\\n that.scene.start();\\n debugger;\\n that._runSceneLoop();\\n that._renderSceneLoop();\\n // }, 0);\\n });\\n } else {\\n console.log('[Game] nothing to start: no scene selected!!');\\n }\\n }\",\n \"async function start() {\\n await hydrate();\\n\\n new Search(\\\".search\\\");\\n\\n const keywords = new Keywords(\\\".keywords\\\");\\n searchStore.subscribe(keywords);\\n\\n const menuDevices = new Devices(\\\".menu-devices\\\");\\n deviceStore.subscribe(menuDevices);\\n dataStore.subscribe(menuDevices);\\n\\n const menuIngredients = new Ingredients(\\\".menu-ingredients\\\");\\n dataStore.subscribe(menuIngredients);\\n ingredientStore.subscribe(menuIngredients);\\n\\n const menuUstensils = new Ustensils(\\\".menu-ustensils\\\");\\n dataStore.subscribe(menuUstensils);\\n ustensilStore.subscribe(menuUstensils);\\n\\n const recipes = new Recipes(\\\".recipes\\\");\\n dataStore.subscribe(recipes);\\n searchStore.subscribe(recipes);\\n}\",\n \"function start() {\\n\\n id = realtimeUtils.getParam('id');\\n if (id) {\\n // Load the document id from the URL\\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\\n init();\\n } else {\\n // Create a new document, add it to the URL\\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\\n window.history.pushState(null, null, '?id=' + createResponse.id);\\n id=createResponse.id;\\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\\n init();\\n });\\n \\n }\\n \\n \\n }\",\n \"function startGame(){\\n \\t\\tGameJam.sound.play('start');\\n \\t\\tGameJam.sound.play('run');\\n\\t\\t\\n\\t\\t// Put items in the map\\n\\t\\titemsToObstacles(true);\\n\\n\\t\\t// Create the prisoner path\\n\\t\\tGameJam.movePrisoner();\\n\\n\\t\\t// Reset items, we dont want the user to be able to drag and drop them\\n \\t\\tGameJam.items = [];\\n \\t\\t\\n \\t\\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\\n \\t\\t\\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\\n \\t\\t}\\n\\n\\t\\t// Reset prisoner speed\\n\\t\\tGameJam.prisoner[0].sprite.speed = 5;\\n\\n\\t\\t// Reset game time\\n\\t\\tGameJam.tileCounter = 0;\\n\\t\\tGameJam.timer.className = 'show';\\n\\t\\tdocument.getElementById('obstacles').className = 'hide';\\n\\t\\tdocument.getElementById('slider').className = 'hide';\\n\\t\\tdocument.getElementById('start-button-wrapper').className = 'hide';\\n\\n\\t\\t// Game has started\\n\\t\\tGameJam.gameStarted = true;\\n\\n\\t\\tGameJam.gameEnded = false;\\n\\n\\t\\tdocument.getElementById('static-canvas').className = 'started';\\n\\n\\t\\tconsole.log('-- Game started');\\n\\t}\",\n \"function begin() {\\n\\tbackgroundBox = document.getElementById(\\\"BackgroundBox\\\");\\n\\n\\tbuildGameView();\\n\\tbuildMenuView();\\n\\n\\tinitSFX();\\n\\tinitMusic();\\n\\n\\tENGINE_INT.start();\\n\\n\\tswitchToMenu(new TitleMenu());\\n\\t//startNewGame();\\n}\",\n \"start() {\\n this.currentTaskType = \\\"teil-mathe\\\";\\n this.v.setup();\\n this.loadTask();\\n }\",\n \"doReStart() {\\n // Stoppe la musique d'intro\\n this.musicIntro.stop();\\n // Lance la scene de menus\\n this.scene.start('MenuScene');\\n }\",\n \"function start() {\\n action(1, 0, 0);\\n}\",\n \"function start () {\\n gmCtrl.setObj();\\n uiCtrl.setUi();\\n }\",\n \"function startApp() {\\n displayProducts();\\n}\",\n \"function loadStart() {\\n // Prepare the screen and load new content\\n collapseHeader(false);\\n wipeContents();\\n loadHTML('#info-content', 'ajax/info.html');\\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\\n loadScript(\\\"js/flag-events.js\\\");\\n });\\n}\",\n \"function start() {\\r\\n var questions = [{\\r\\n type: 'rawlist',\\r\\n name: 'choice',\\r\\n message: 'What would you like to do?',\\r\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\", \\\"Exit Store\\\"]\\r\\n }];\\r\\n inquirer.prompt(questions).then(answers => {\\r\\n mainMenu(answers.choice);\\r\\n });\\r\\n}\",\n \"function startGame(mapName = 'galaxy'){\\n toggleMenu(currentMenu);\\n if (showStats)\\n $('#statsOutput').show();\\n $('#ammoBarsContainer').show();\\n scene.stopTheme();\\n scene.createBackground(mapName);\\n if (firstTime) {\\n firstTime = false;\\n createGUI(true);\\n render();\\n } else {\\n requestAnimationFrame(render);\\n }\\n}\",\n \"function start() { \\n initiate_graph_builder();\\n initiate_job_info(); \\n initiate_aggregate_info();\\n initiate_node_info();\\n}\",\n \"function startup() {\\n\\tsaveSlot('rainyDayZRestart');\\n\\tfooterVisibility = document.getElementById(\\\"footer\\\").style.visibility;\\n\\tfooterHeight = document.getElementById(\\\"footer\\\").style.height;\\t\\n\\tfooterOverflow = document.getElementById(\\\"footer\\\").style.overflow;\\t\\n\\twrapper.scrollTop = 0;\\n\\tupdateMenu();\\n\\thideStuff();\\n\\tif(localStorage.getItem('rainyDayZAuto')) {\\n\\t\\tloadSlot('rainyDayZAuto');\\n\\t}\\n\\telse{\\n\\t\\tsceneTransition('start');\\n\\t}\\n}\",\n \"function start() {\\n \\tkran.init(\\\"all\\\");\\n \\trequestAnimationFrame(gameLoop);\\n }\",\n \"create() {\\n\\n // add animations (for all scenes)\\n this.addAnimations();\\n\\n // change to the \\\"Home\\\" scene and provide the default chord progression / sequence\\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\\n }\",\n \"function start(){\\r\\n\\t\\t// for now, start() will call _draw(), which draws all the objects on the stage\\r\\n\\t\\t// but in the next lesson, we'll add an animation loop that calls _draw()\\r\\n\\t\\t_draw(ctx);\\r\\n\\t}\",\n \"function createStart(){\\n // scene components\\n startScreen = initScene();\\n startText = createSkyBox('libs/Images/startscene.png', 10);\\n startScreen.add(startText);\\n\\n // lights\\n \\t\\tvar light = createPointLight();\\n \\t\\tlight.position.set(0,200,20);\\n \\t\\tstartScreen.add(light);\\n\\n // camera\\n \\t\\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\\n \\t\\tstartCam.position.set(0,50,1);\\n \\t\\tstartCam.lookAt(0,0,0);\\n }\",\n \"function startGame() {\\n\\t\\tstatus.show();\\n\\t\\tinsertStatusLife();\\n\\t\\tsetLife(100);\\n\\t\\tsetDayPast(1);\\n\\t}\",\n \"function start(){\\n\\tautoCompleteSearch();\\n\\tsubmitButton();\\n\\tsubmitButtonRandom();\\n\\tnewSearch();\\n\\trandomChar();\\n\\thideCarouselNav();\\n}\",\n \"function requestFish() {\\n // all_stopped = 1;\\n //addFish++;\\n\\n view.resize(300,300);\\n aquarium.viewport(300,300)\\n aquarium.prepare();\\n}\",\n \"function start() {\\n console.log(\\\"Loop\\\");\\n generateArt();\\n}\",\n \"function start() {\\n\\t\\t\\tsetTimeout(startUp, 0);\\n\\t\\t}\",\n \"function startRitual() {\\n\\tconsole.log(\\\"** glitter **\\\");\\n\\tflash(pump);\\n}\",\n \"start() {\\n\\t\\tthis.emit(\\\"game_start\\\");\\n\\t}\",\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"start() {// Your initialization goes here.\\n }\",\n \"function startEncounter(){\\n\\tthis.scene.start('Battle', {type: 'encounter'})\\n}\",\n \"function start() {\\n INFO(\\\"start\\\", clock()+\\\"msecs\\\")\\n loadThemeScript();\\n if (window.MathJax)\\n MathJax.Hub.Queue([\\\"Typeset\\\", MathJax.Hub]);\\n beginInteractionSessions(QTI.ROOT);\\n setTimeout(initializeCurrentItem, 100);\\n setInterval(updateTimeLimits, 100);\\n document.body.style.display=\\\"block\\\";\\n INFO(\\\"end start\\\", clock()+\\\"msecs\\\");\\n }\",\n \"function gamestart() {\\n\\t\\tshowquestions();\\n\\t}\",\n \"function start() {\\n\\n // Make sure we've got all the DOM elements we need\\n setupDOM();\\n\\n // Updates the presentation to match the current configuration values\\n configure();\\n\\n // Read the initial hash\\n readURL();\\n\\n // Notify listeners that the presentation is ready but use a 1ms\\n // timeout to ensure it's not fired synchronously after #initialize()\\n setTimeout(function () {\\n dispatchEvent('ready', {\\n 'indexh': indexh,\\n 'indexv': indexv,\\n 'currentSlide': currentSlide\\n });\\n }, 1);\\n\\n }\",\n \"function startGame() {\\n\\tsetup();\\n\\tmainLoop();\\n}\",\n \"function startScreen() {\\n mainContainer.append(startButton)\\n }\",\n \"function start() {\\n console.log(\\\"Welcome to the Employee Tracker\\\");\\n inquirer\\n .prompt(menuOptions)\\n .then((response) => {\\n console.log(response);\\n switch (response.mainMenu) {\\n case \\\"View all departments\\\":\\n queries.viewDepartments();\\n break;\\n\\n case \\\"View all roles\\\":\\n queries.viewRoles();\\n break;\\n\\n case \\\"View all employees\\\":\\n queries.viewEmployees();\\n break;\\n\\n case \\\"Add a department\\\":\\n queries.addDepartment();\\n break;\\n\\n case \\\"Add a role\\\":\\n queries.addRole();\\n break;\\n\\n case \\\"Add an employee\\\":\\n queries.addEmployee();\\n break;\\n\\n case \\\"Update an employee role\\\":\\n queries.updateRole();\\n break;\\n\\n case \\\"Quit\\\":\\n queries.quit();\\n break;\\n\\n default:\\n break;\\n }\\n });\\n}\",\n \"function main(){\\n\\t//Initialice with first episode\\n\\tvar sel_episodes = [1]\\n\\t//collage(); //Create a collage with all the images as initial page of the app\\n\\tpaintCharacters();\\n\\tpaintEpisodes();\\n\\tpaintLocations(sel_episodes);\\n}\",\n \"create() {\\n // We have nothing left to do here. Start the next scene.\\n \\n\\n this.input.on('pointerdown', function (pointer) {\\n\\n this.scene.start('Game');\\n }, this);\\n\\n \\n }\",\n \"create(){\\n this.scene.start('MenuGame');\\n }\",\n \"function start() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Exit\\\"\\n ]\\n })\\n .then(function (answer) {\\n switch (answer.action) {\\n case \\\"View Products for Sale\\\":\\n viewProducts();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n viewLowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"exit\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function start() {\\n console.log(\\\"Animation Started\\\");\\n\\n let masterTl = new TimelineMax();\\n\\n //TODO: add childtimelines to master\\n masterTl\\n .add(clearStage(), \\\"scene-clear-stage\\\")\\n .add(enterFloorVegetation(), \\\"scene-floor-vegitation\\\")\\n .add(enterTreeStuff(), \\\"tree-stuff\\\");\\n }\",\n \"function run() { \\n\\n moveToNewspaper();\\n pickBeeper();\\n returnHome();\\n\\n}\",\n \"function start() {\\n\\tconsole.log(\\\"\\\\nWELCOME TO THE BAMAZON STORE!\\\\n\\\");\\n\\tinquirer.prompt(\\n\\t\\t{\\n\\t\\t\\tname: \\\"browse\\\",\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to browse the available products?\\\"\\n\\t\\t}\\n\\t).then(function(answer) {\\n\\t\\tif (answer.browse) {\\n\\t\\t\\tdisplayProducts();\\n\\t\\t} else {\\n console.log(\\\"Come back soon, have a nice day!\\\")\\n\\t\\t\\tconnection.end();\\n\\t\\t}\\n });\\n \\n}\",\n \"function start() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\"\\n ],\\n message: \\\"Select an option.\\\"\\n }\\n ])\\n .then(function (answers) {\\n switch (answers.choice) {\\n case \\\"View Products for Sale\\\":\\n productsForSale();\\n break;\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n case \\\"Add New Product\\\":\\n newProduct();\\n break;\\n }\\n });\\n}\",\n \"function start () {\\n\\t\\t\\n\\t\\t// if has not started planting and plant is valid\\n\\t\\t\\n\\t\\tif ( this.started !== true && this.puzzle instanceof _Puzzle.Instance && this.puzzle.started === true && this.plant instanceof _GridElement.Instance ) {\\n\\t\\t\\tconsole.log('start PLANTING!');\\n\\t\\t\\t\\n\\t\\t\\t// set started\\n\\t\\t\\t\\n\\t\\t\\tthis.started = true;\\n\\t\\t\\t\\n\\t\\t\\t// start updating planting\\n\\t\\t\\t\\n\\t\\t\\tthis.update();\\n\\t\\t\\tshared.signals.gameUpdated.add( this.update, this );\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t}\",\n \"start () {\\n this.stateLoop();\\n }\",\n \"function startMenu() {\\n createManager();\\n}\",\n \"initializeScene(){}\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"function Aside() {\\n appStarted = true;\\n // all objects added to the stage appear in \\\"layer order\\\"\\n // add a helloLabel to the stage\\n seeMore = new objects.Label(\\\"Click me to see more of my work\\\", \\\"32px\\\", \\\"Times New Roman\\\", \\\"#000000\\\", canvasHalfWidth, canvasHalfHeight + 200, true);\\n stage.addChild(seeMore);\\n // add a clickMeButton to the stage\\n treesharksLogo = new objects.Icon(loader, \\\"treesharksLogo\\\", canvasHalfWidth, canvasHalfHeight - 100, true);\\n stage.addChild(treesharksLogo);\\n }\",\n \"function renderStartPage() {\\n addView(startPage());\\n}\",\n \"function Start() {\\n console.log(\\\"%c Game Started!\\\", \\\"color: blue; font-size: 20px; font-weight: bold;\\\");\\n stage = new createjs.Stage(canvas);\\n createjs.Ticker.framerate = 60; // 60 FPS\\n createjs.Ticker.on('tick', Update);\\n stage.enableMouseOver(20);\\n currentSceneState = scenes.State.NO_SCENE;\\n config.Game.SCENE = scenes.State.START;\\n }\",\n \"start(){\\r\\n if (this.scene.scene\\r\\n .get(\\\"levelMap\\\")\\r\\n .localStorage.getItem(`${this.scene.key}R`) === null) {\\r\\n this.intro();\\r\\n }\\r\\n }\",\n \"function startGame() {\\r\\n if (pressed == 0) {\\r\\n createRain();\\r\\n animate();\\r\\n }\\r\\n }\",\n \"function start() {\\n fly();\\n\\n}\",\n \"function Start() {\\n console.log(`%c Start Function`, \\\"color: grey; font-size: 14px; font-weight: bold;\\\");\\n stage = new createjs.Stage(canvas);\\n createjs.Ticker.framerate = Config.Game.FPS;\\n createjs.Ticker.on('tick', Update);\\n stage.enableMouseOver(20);\\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\\n Main();\\n }\",\n \"function start() {\\r\\n\\tconst config = validateConfiguration();\\r\\n\\tif(config === false) {\\r\\n\\t\\talert(\\\"Please choose a proper configuration!\\\");\\r\\n\\t\\treturn;\\r\\n\\t}\\r\\n\\ttg = new TaskGenerator(config);\\r\\n\\r\\n\\tdocument.getElementsByName(\\\"state:start\\\").forEach(function(e) {\\r\\n\\t\\te.style.display = \\\"none\\\";\\r\\n\\t});\\r\\n\\r\\n\\tdocument.getElementsByName(\\\"state:task\\\").forEach(function(e) {\\r\\n\\t\\te.style.display = \\\"block\\\";\\r\\n\\t});\\r\\n\\tdisplayTask();\\r\\n}\",\n \"create(){\\n this.add.text(20, 20, \\\"LoadingGame...\\\")\\n\\n this.time.addEvent({\\n delay: 3000, // ms\\n callback: function(){this.scene.start('MenuScene')},\\n //args: [],\\n callbackScope: this,\\n loop: true \\n });\\n\\n \\n }\",\n \"function start(state) { \\n service.goNext(state);\\n }\",\n \"function reactionStart () {\\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\\n switchButton2(); // Zustand des Schaltknopfs ändern\\n enableInput(false); // Eingabefelder deaktivieren\\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\\n else stopAnimation(); // ... oder stoppen\\n reaction(); // Eingegebene Werte übernehmen und rechnen\\n paint(); // Neu zeichnen\\n }\",\n \"function startScreen() {\\n\\tdraw();\\n\\tif(usuario_id !== -1)\\n\\t\\tstartBtn.draw();\\n}\",\n \"function runStart()/* : void*/\\n {\\n this.setUp();\\n }\",\n \"function start() {\\n //switch to scene 1\\n window.inventoryActive = \\\"\\\";\\n window.inventoryActive2 = \\\"\\\";\\n window.inventory[1]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[2]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[3]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[4]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[5]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[6]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.timerTime = null;\\n window.inspectResultReceived =0;\\n window.activeSlot = \\\"\\\";\\n window.inspectResult= \\\"\\\";\\n \\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7005796","0.6905421","0.6712243","0.6531578","0.6511532","0.65048075","0.6440274","0.6435362","0.6370753","0.63203603","0.6283713","0.62831676","0.62555844","0.6246311","0.6242093","0.6232279","0.6213741","0.6201732","0.61525476","0.6120415","0.61030513","0.6102915","0.6099659","0.60980535","0.60968626","0.60946804","0.6064788","0.6059272","0.60587984","0.6052239","0.60380757","0.60338104","0.60203964","0.60176796","0.60087675","0.6003453","0.5996396","0.5996006","0.5993157","0.5982755","0.5982082","0.5981742","0.5978043","0.5975088","0.5970169","0.5954277","0.59318703","0.5926054","0.59214985","0.5921152","0.5916003","0.59122425","0.58993447","0.58988607","0.58817333","0.58723485","0.5870934","0.58631575","0.5859006","0.5856763","0.5855876","0.5853492","0.5837363","0.5832727","0.58242106","0.58228964","0.5819396","0.581897","0.58140326","0.5809035","0.58079207","0.58051044","0.58045405","0.579916","0.5794586","0.5788267","0.5780983","0.5780677","0.5772165","0.57690555","0.5768784","0.5763662","0.5759042","0.5755316","0.5753908","0.5753908","0.5753484","0.57457274","0.5740867","0.57379127","0.5736859","0.57314205","0.57307184","0.57289165","0.57266337","0.5725584","0.57202995","0.5720104","0.57172763","0.57156134"],"string":"[\n \"0.7005796\",\n \"0.6905421\",\n \"0.6712243\",\n \"0.6531578\",\n \"0.6511532\",\n \"0.65048075\",\n \"0.6440274\",\n \"0.6435362\",\n \"0.6370753\",\n \"0.63203603\",\n \"0.6283713\",\n \"0.62831676\",\n \"0.62555844\",\n \"0.6246311\",\n \"0.6242093\",\n \"0.6232279\",\n \"0.6213741\",\n \"0.6201732\",\n \"0.61525476\",\n \"0.6120415\",\n \"0.61030513\",\n \"0.6102915\",\n \"0.6099659\",\n \"0.60980535\",\n \"0.60968626\",\n \"0.60946804\",\n \"0.6064788\",\n \"0.6059272\",\n \"0.60587984\",\n \"0.6052239\",\n \"0.60380757\",\n \"0.60338104\",\n \"0.60203964\",\n \"0.60176796\",\n \"0.60087675\",\n \"0.6003453\",\n \"0.5996396\",\n \"0.5996006\",\n \"0.5993157\",\n \"0.5982755\",\n \"0.5982082\",\n \"0.5981742\",\n \"0.5978043\",\n \"0.5975088\",\n \"0.5970169\",\n \"0.5954277\",\n \"0.59318703\",\n \"0.5926054\",\n \"0.59214985\",\n \"0.5921152\",\n \"0.5916003\",\n \"0.59122425\",\n \"0.58993447\",\n \"0.58988607\",\n \"0.58817333\",\n \"0.58723485\",\n \"0.5870934\",\n \"0.58631575\",\n \"0.5859006\",\n \"0.5856763\",\n \"0.5855876\",\n \"0.5853492\",\n \"0.5837363\",\n \"0.5832727\",\n \"0.58242106\",\n \"0.58228964\",\n \"0.5819396\",\n \"0.581897\",\n \"0.58140326\",\n \"0.5809035\",\n \"0.58079207\",\n \"0.58051044\",\n \"0.58045405\",\n \"0.579916\",\n \"0.5794586\",\n \"0.5788267\",\n \"0.5780983\",\n \"0.5780677\",\n \"0.5772165\",\n \"0.57690555\",\n \"0.5768784\",\n \"0.5763662\",\n \"0.5759042\",\n \"0.5755316\",\n \"0.5753908\",\n \"0.5753908\",\n \"0.5753484\",\n \"0.57457274\",\n \"0.5740867\",\n \"0.57379127\",\n \"0.5736859\",\n \"0.57314205\",\n \"0.57307184\",\n \"0.57289165\",\n \"0.57266337\",\n \"0.5725584\",\n \"0.57202995\",\n \"0.5720104\",\n \"0.57172763\",\n \"0.57156134\"\n]"},"document_score":{"kind":"string","value":"0.6223574"},"document_rank":{"kind":"string","value":"16"}}},{"rowIdx":66,"cells":{"query":{"kind":"string","value":"Dish menu for fastfood restaurant scene start."},"document":{"kind":"string","value":"function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\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 initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}","function startMenu() {\n createManager();\n}","function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\n}","function gameMenuStartableDrawer() {\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\n }\n }","function StartMenu() {\n //this.menu = new Menu('start-menu');\n this.shutDownMenu = new Menu('shutdown-menu');\n this.shutDownButton = new MenuButton('options-button', this.shutDownMenu);\n Menu.apply(this, ['start-menu']);\n}","constructor(props) {\n super(props);\n\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\n this.state = {\n selectedDish: null\n }\n console.log('menu constructor is invoke')\n \n }","function display_start_menu() {\n\tstart_layer.show();\n\tstart_layer.moveToTop();\n\t\n\tdisplay_menu(\"start_layer\");\n\tcharacter_layer.moveToTop();\n\tcharacter_layer.show();\n\tinventory_bar_layer.show();\n\t\n\tstage.draw();\n\t\n\tplay_music('start_layer');\n}","start() {\n if (this.showHideStartMenu === true) {\n this.showHideStartMenu = false;\n } else {\n this.showHideStartMenu = true;\n }\n }","function foodMenuItems() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\twaypoint = new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.find('.nectar_food_menu_item').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\t}, i * 150);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\toffset: $foodItemOffsetPos\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}","function onOpen() {\n createMenu();\n}","function showMenu(arg)\r\n\t{\r\n\t\tswitch(arg)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$('#menu').html(\"\");\r\n\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$('#menu').html(\"

                    Sheep's Snake

                    Press A to play!

                    Press B for some help !

                    \");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}","function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }","function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}","function showMenu() {\n // clear the console\n console.log('\\033c');\n // menu selection\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"wish\",\n choices: [\"View Product Sales by Department\", \"Create New Department\", \"Exit\"],\n message: '\\nWhat would you like to do? '\n }\n ]).then( answer => {\n switch (answer.wish){\n case \"View Product Sales by Department\":\n showSale();\n break;\n case \"Create New Department\":\n createDept();\n break;\n case \"Exit\":\n connection.end();\n break;\n default:\n console.log( `\\x1b[1m \\x1b[31m\\nERROR! Invalid Selection\\x1b[0m`);\n }\n })\n}","function start() {\r\n var questions = [{\r\n type: 'rawlist',\r\n name: 'choice',\r\n message: 'What would you like to do?',\r\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit Store\"]\r\n }];\r\n inquirer.prompt(questions).then(answers => {\r\n mainMenu(answers.choice);\r\n });\r\n}","function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}","_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }","function superfishSetup() {\n\t\t$('#navigation').find('.menu').superfish({\n\t\t\tdelay: 200,\n\t\t\tanimation: {opacity:'show', height:'show'},\n\t\t\tspeed: 'fast',\n\t\t\tcssArrows: true,\n\t\t\tautoArrows: true,\n\t\t\tdropShadows: false\n\t\t});\n\t}","function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}","pressedStart()\n\t\t\t{\n\t\t\tif(this.gamestate === 'starting')\n\t\t\t\t{\n\t\t\t\tthis.gamestate = 'choose';\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'choose')\n\t\t\t\t{\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'stats')\n\t\t\t\t{\n\t\t\t\tthis.gamestate = 'bedroom';\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'bedroom')\n\t\t\t\t{\n\t\t\t\tthis.menu.RunFunction(this);\n\t\t\t\t}\n\t\t\t}","function actionOnClick () {\r\n game.state.start(\"nameSelectionMenu\");\r\n}","function menuShow() {\n ui.appbarElement.addClass('open');\n ui.mainMenuContainer.addClass('open');\n ui.darkbgElement.addClass('open');\n}","createMenu()\n {\n currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo');\n\n // The first button that will enable audio\n let firstBtn = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'FirstStart');\n\n firstBtn.setInteractive();\n firstBtn.on('pointerdown',function()\n {\n this.setScale(1.05);\n });\n firstBtn.on('pointerup',function()\n {\n firstBtn.disableInteractive();\n // We play the Button pressed SFX \n sfxManager.playSupahStar();\n firstBtn.destroy();\n });\n firstBtn.on('pointerup', () => this.startMainMenu());\n\n // We set the fonts according to the browser\n if(theGame.device.browser.firefox)\n {\n boldFontName = 'Asap-Bold';\n regularFontName = 'Asap';\n }\n else\n {\n boldFontName = 'Asap-Bold';\n regularFontName = 'Asap';\n }\n }","function startup() {\n\tsceneTransition(\"start\");\n}","function menuhrres() {\r\n\r\n}","function displayMenu() {\n const menu = document.querySelector(\"#menu\");\n let dishes = hard_coded_dishes;\n\n dishes.forEach(dish => {\n // generate template for main ingredient and the name of the dish\n const main = displayDish(\n dish.course,\n dish.name,\n dish.price,\n dish.ingredient\n );\n\n // generate options for each dish\n const options = [];\n\n if (dish.options) {\n dish.options.forEach(option => {\n options.push(displayOption(option.option, option.price));\n });\n }\n\n // add this to the DOM\n menu.insertAdjacentHTML(\"beforeend\", main + options.join(\"\"));\n });\n}","function thememascot_menuzord() {\n $(\"#menuzord\").menuzord({\n align: \"left\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n $(\"#menuzord-right\").menuzord({\n align: \"right\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n }","function main() {\n menu = new states.Menu();\n currentstate = menu;\n}","function runMenu() {\n inquirer.prompt([\n {\n name: 'menu',\n type: 'list',\n choices: [\n 'View Products for Sale',\n 'View Low Inventory',\n 'Add to Inventory',\n 'Add New Product',\n 'Exit'\n ],\n message: chalk.cyan('Select an option:')\n }\n ]).then(function(answers) {\n switch (answers.menu) {\n case 'View Products for Sale':\n getProducts(false);\n break;\n case 'View Low Inventory':\n getProducts(true);\n break;\n case 'Add to Inventory':\n addInventory();\n break;\n case 'Add New Product':\n addProduct();\n break;\n default:\n connection.end();\n }\n });\n}","addDishToMenu(dish) {\n if(this.menu.includes(dish))\n {\n this.removeDishFromMenu(dish.id);\n }\n this.menu.push(dish);\n }","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function toMenu()\n {\n /**\n * Opens a fan of a desk in the pause menu\n */\n function openFan()\n {\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\n desk.toggleFan(4, 35, 10, true);\n for (var counter = 0; counter < desk.cards.length; counter++)\n {\n if (state.isWin)\n {\n desk.cards[counter].turn(true);\n desk.cards[counter].dataset.turned = true;\n }\n else if (desk.cards[counter].dataset.turned == true)\n {\n desk.cards[counter].turn(true);\n }\n }\n state.isWin = false;\n }\n\n /**\n * Shows menu elements\n */\n function showMenu()\n {\n if (state.screen == \"GAME\")\n {\n cards[0].removeEventListener(\"move\", showMenuId);\n DOM.pause.deskContainer.style.opacity = 1;\n DOM.cardsContainer.classList.add(CSS.hidden);\n }\n\n if (state.isWin)\n {\n DOM.pause.deskContainer.style.opacity = 0;\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \"Победа со счётом: \" : \"Потрачено: \") + state.score;\n DOM.pause.options.continue.disabled = true;\n state.score = 0;\n }\n else\n {\n DOM.pause.headline.innerHTML = \"MEMORY GAME\";\n }\n\n DOM.container.classList.remove(CSS.container.game);\n DOM.container.classList.add(CSS.container.pause);\n state.screen = \"MENU\";\n\n toggleHideElements(\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\n animation.duration.hide,\n false,\n openFan.bind(this)\n );\n }\n\n /**\n * Hides a game field\n */\n function hideGameField(follower)\n {\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\n }\n\n /**\n * Moves cards from the field to the desk\n */\n function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }\n\n state.cardsTurnable = false;\n if (state.screen == \"GAME\")\n {\n var showMenuId;\n hideGameField();\n takeCards();\n }\n else\n {\n hideGameField(showMenu.bind(this));\n }\n }","function onOpen() {\n \n SpreadsheetApp.getUi().createMenu('Merchant Center')\n .addItem('Run Now', 'main')\n .addToUi()\n }","function onOpen() { CUSTOM_MENU.add(); }","getMenu() {alert(\"entering grocery.js getMenu()\")\n\t\t// Assemble the menu list (meal nodes)\n\t\tthis.menuCloset.destructBoxes()\n\t\tlet mealNodes = graph.getNodesByID_partial(\"meal\", \"\")\n\t\tfor (let meal of mealNodes) {\n\t\t\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\n\t\t\t\tthis.menuCloset.add(meal)\n\t\t\t}\n\t\t}\n\t\tthis.updateGroceryList()\n\t}","function gotoMenu(){\n x = 200;\n dx = 1;\n y = 200;\n dy = 1;\n fuel = 5000;\n landed = false;\n crashed = false;\n fuelout = false;\n gameTimer = 0;\n canvas_x=0;\t\n gamestart = false;\n levelselect = true;\n bonus = 0;\n score = 0;\n}","start() {\r\n //Below are methods that dont exist YET and to build out our menu; what we think it will look like and then we are going to implement \r\n //those methods this is referred to as the top-down development approach. Where we start from the top then implement those methods.\r\n //this.showMainMenuOptions(method) will return the selection that the user gives us \r\n let selection = this.showMainMenuOptions();\r\n //selection is a variable we're gonna use to get user input of what option out menu has the user selected. We will use 0=exit and do \r\n //something based off of it, so below is a switch. \r\n while (selection != 0) {\r\n switch (selection) {\r\n case \"1\":\r\n //reminder that these are sort of placeholders that will be implemented later according to the top down development approach\r\n this.createAllignmentGroup();\r\n break;\r\n case \"2\":\r\n this.viewAllignmentGroup();\r\n break;\r\n case \"3\":\r\n this.deleteAllignmentGroup();\r\n break;\r\n case \"4\":\r\n this.displayAllignmentGroup();\r\n break;\r\n default:\r\n selection = 0;\r\n }\r\n //outside of our switch here we get the selection like at the beginning to ensure the loop keeps looping as long as we do not select 0 \r\n //or select 1-4\r\n //So this is basically the flow of our application, we are going to prompt/show the menu options the user is going to select something\r\n //we're going to say as long as 0 isnt selected we are going to continue with our determination of what they did select and based on \r\n //what they selected it will show the cases above. \r\n selection = this.showMainMenuOptions();\r\n }\r\n alert(\"Farewell!\");\r\n }","function onOpen() {\n SpreadsheetApp.getUi().createMenu('Equipment requests')\n .addItem('Set up', 'setup_')\n .addItem('Clean up', 'cleanup_')\n .addToUi();\n}","function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}","function menu() {\n this.meal1 = \"Ham and Cheese Sandwich\",\n this.meal2 = \"Roastbeef Sandwich\"\n }","function start() {\n\n inquirer.prompt({\n name: \"menu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Delete Product\",\n \"EXIT\"\n ]\n }).then(function(answer) {\n switch (answer.menu) {\n case \"View Products for Sale\":\n productsForSale();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"Delete Product\":\n deleteProduct();\n break;\n\n case \"EXIT\":\n connection.end();\n break;\n }\n });\n}","function showMenu(fast) {\n\t\t\t\tif ((smallBreakpoint && !opt.everySizes) || opt.everySizes) {\n\t\t\t\t\tmenuOpen = true;\n\t\t\t\t\t$html.addClass('extra-menu-open');\n\t\t\t\t\t$html.removeClass('extra-menu-close');\n\t\t\t\t\tif (fast) {\n\t\t\t\t\t\ttimeline.totalProgress(1);\n\t\t\t\t\t\t$window.trigger('extra:menu:ShowComplete');\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttimeline.play();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thideMenu(true);\n\t\t\t\t}\n\t\t\t}","function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}","function mainMenu() {\n INQUIRER.prompt([{\n name: 'next',\n type: 'list',\n message: 'Welcome',\n choices: [\n 'View All Products',\n `View Low Inventory`,\n 'Add to Inventory',\n 'Add New Product',\n 'Exit'\n ]\n }]).then(function(input) {\n\n switch (input.next) {\n case 'View All Products':\n displayAll();\n break;\n\n case 'View Low Inventory':\n displayLow();\n break;\n\n case 'Add to Inventory':\n addToInventory();\n\n case 'Exit':\n connection.end();\n break;\n\n //add product\n default:\n addNewProduct();\n break;\n }\n });\n}","function StartFishing() {\n\n DebugStart()\n // How far to look for trees from the player\n var range = 16;\n AutoFisherman(range);\n}","expandMenu() {\r\n\t}","function mainMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"introAction\",\n\t\tmessage: \"Welcome, pick an action: \",\n\t\tchoices: [\"Create a Basic Card\", \"Create a Cloze Card\", \"Review Existing Cards\"]\n\t}]).then(function(answers){\n\t\tswitch (answers.introAction) {\n\t\t\tcase \"Create a Basic Card\":\n\t\t\t\tcreateBasicCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Create a Cloze Card\":\n\t\t\t\tcreateClozeCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Review Existing Cards\":\n\t\t\t\treviewCards();\n\t\t\t\tbreak;\n\t\t}\n\t});\n}","function goToMenu() {\n stopTTS();\n cStatus = undefined;\n cStatus = new CurrentStatus();\n $('#quiz').hide('slow');\n $('#game').hide('slow');\n $('#menu').show('slow');\n}","setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }","prepare() { this.createTopMenu(); this.createQuickMenu(); this.showQuickMenu(); }","function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Great Explorations')\n .addItem('Match Girls to Workshops', 'matchGirls')\n .addToUi();\n}","function menu() {\n document.getElementById(\"menuStart\").classList.toggle(\"show\");\n}","function C999_Common_Achievements_MainMenu() {\n C999_Common_Achievements_ResetImage();\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}","function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}","function menu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Supervisor's Menu Options:\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"Exit\"]\n }\n ]).then(function (answers) {\n if (answers.choice === \"View Product Sales By Department\") {\n displaySales();\n }\n else if (answers.choice === \"Create New Department\") {\n createDepartment();\n }\n else {\n connection.end();\n }\n });\n}","function menu() {\n\t\n // Title of Game\n title = new createjs.Text(\"Poker Room\", \"50px Bembo\", \"#FF0000\");\n title.x = width/3.1;\n title.y = height/4;\n\n // Subtitle of Game\n subtitle = new createjs.Text(\"Let's Play Poker\", \"30px Bembo\", \"#FF0000\");\n subtitle.x = width/2.8;\n subtitle.y = height/2.8;\n\n // Creating Buttons for Game\n addToMenu(title);\n addToMenu(subtitle);\n startButton();\n howToPlayButton();\n\n // update to show title and subtitle\n stage.update();\n}","function init() {\n console.log('Welcome to your company employee manager.')\n menu()\n}","startGame() {\n this.scene.start('MenuScene');\n }","function showMenu() {\n rectMode(CENTER);\n fill(colorList[2]);\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[5]);\n text(\"How to Play\", buttonX, buttonY);\n\n fill(colorList[3]);\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[4]);\n text(\"Dancing Block\", buttonX, secondButtonYpos);\n \n}","function start() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"menu\",\n message: \"What would you like to do?\",\n choices: [\"View Products for sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\"\n ]\n }\n\n ])\n .then(function (answers) {\n if (answers.menu === \"View Products for sale\") {\n return viewProducts();\n } else if (answers.menu === \"View Low Inventory\") {\n return lowInventory();\n } else if (answers.menu === \"Add to Inventory\") {\n return addInventory();\n } else if (answers.menu === \"Add New Product\") {\n return addProduct();\n }\n });\n}","function menu(){\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"exit\"\n ]\n }).then(function(answer){\n switch(answer.action){\n case \"View Products for Sale\":\n products();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}","function onOpen() {\n var menu = [\n { name: \"Fill all items list\", functionName: \"fillAllItemsData\" },\n null,\n { name: \"Schedule run task every hour\", functionName: \"configureRun\"},\n { name: \"Remove schedule\", functionName: \"configureStop\"},\n ];\n \n SpreadsheetApp.getActiveSpreadsheet().addMenu(\"➪ Tarkov-Market\", menu);\n}","function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function","function initSuperFish(){\r\n\t\t\r\n\t\t$(\".sf-menu\").superfish({\r\n\t\t\t delay: 50,\r\n\t\t\t autoArrows: true,\r\n\t\t\t animation: {opacity:'show'}\r\n\t\t\t //cssArrows: true\r\n\t\t});\r\n\t\t\r\n\t\t// Replace SuperFish CSS Arrows to Font Awesome Icons\r\n\t\t$('nav > ul.sf-menu > li').each(function(){\r\n\t\t\t$(this).find('.sf-with-ul').append('');\r\n\t\t});\r\n\t}","function init_dash() {\n dropDown();\n}","doReStart() {\n // Stoppe la musique d'intro\n this.musicIntro.stop();\n // Lance la scene de menus\n this.scene.start('MenuScene');\n }","function mainMenu() {\n\n inquirer\n .prompt({\n type: \"list\",\n name: \"task\",\n message: \"Plz, select your entry ?\",\n choices: [\n \"View Employees\",\n \"View Departments\",\n \"View Roles\",\n \"Add Employees\",\n \"Update EmployeeRole\",\n \"Add Role\",\n \"Exit\"]\n })\n .then(function ({ task }) {\n switch (task) {\n case \"View Employees\":\n viewEmployee();\n break;\n case \"View Departments\":\n viewDepartmnt();\n break;\n case \"View Roles\":\n viewRole();\n break;\n case \"Add Employees\":\n addEmployee();\n break;\n case \"Update EmployeeRole\":\n updateEmployeeRole();\n break;\n case \"Add Role\":\n addRole();\n break;\n case \"Exit\":\n connection.end();\n break;\n \n }\n });\n}","function openMenu() {\n g_IsMenuOpen = true;\n}","function start() {\n inquirer.prompt([{\n name: \"entrance\",\n message: \"Would you like to shop with us today?\",\n type: \"list\",\n choices: [\"Yes\", \"No\"]\n }]).then(function(answer) {\n // if yes, proceed to shop menu\n if (answer.entrance === \"Yes\") {\n menu();\n } else {\n // if no, end node cli \n console.log(\"---------------------------------------\");\n console.log(\"No?!?!?! What do you mean no!?!?!?!?!?\");\n console.log(\"---------------------------------------\");\n connection.destroy();\n return;\n }\n });\n}","function runSupervisorMenu() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Please select from menu: \".magenta.italic.bold,\n name: \"menu\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"View All Users\", \"Create User\", \"Exit\"]\n }\n ]).then(function (inquirerResponse) {\n switch (inquirerResponse.menu) {\n case \"View Product Sales By Department\":\n viewDepartmentSales();\n break;\n case \"Create New Department\":\n addDepartment();\n break;\n case \"View All Users\":\n viewAllUsers();\n break;\n case \"Create User\":\n addUser();\n break;\n case \"Exit\":\n process.exit();\n break;\n }\n });\n}","function gameMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n gameMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n gameMenuStartableid.classList.remove('game-menu-startable');\n gameMenuBattlepointer1id.classList.remove('game-menu-battlepointer');\n if (store.getState().activeGameState.isMap1Completed != true) {\n gameMenuStarthereTextid.classList.add('nodisplay');\n }\n }, 600);\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1400);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n\n loadSavedMenuid.classList.remove('load-saved-menu');\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }","function menu() {\n inquirer\n .prompt({\n name: \"menuOptions\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add Inventory\", \"Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer, run appropriate function\n if (answer.menuOptions === \"View Products\") {\n viewProducts();\n }\n else if (answer.menuOptions === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (answer.menuOptions === \"Add Inventory\") {\n addInventory();\n }\n else if (answer.menuOptions === \"Add New Product\") {\n addNewProduct();\n }\n else {\n connection.end();\n }\n });\n}","function Menu() {\n\t\n\tPhaser.State.call(this);\n\t\n}","function menuGame(){\n startScene.visible = true;\n helpScene.visible = false;\n gameOverScene.visible = false;\n gameScene.visible = false;\n}","function showMenu() {\n if(newGame) {\n $('#main').show();\n }\n else {\n $('#end').show();\n }\n}","function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}","startMainMenu()\n {\n // We check if the player is on mobile and open fullscreen\n let os = theGame.device.os;\n if(os.android || os.iOS || os.iPad || os.iPhone || os.windowsPhone)\n {\n openFullScreen();\n }\n \n let gameCredits;\n let goat = currentScene.add.image(-100, topBackgroundYOrigin+35, 'GoatMenu');\n let fondo2 = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo2');\n fondo2.visible = false;\n let logo = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Logo');\n //logo.visible = false;\n \n // Start Btn\n let startBtn = currentScene.add.image(topBackgroundXOrigin-40, topBackgroundYOrigin+125, 'StartBtn');\n let startHigh = currentScene.add.image(topBackgroundXOrigin-40, topBackgroundYOrigin+125, 'StartHigh');\n startBtn.setInteractive();\n startBtn.on('pointerover', ()=> this.onMenuBtnInteracted(startHigh, true));\n startBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(startHigh, true));\n startBtn.on('pointerup', ()=> this.onMenuBtnInteracted(startHigh, false));\n startBtn.on('pointerout', ()=> this.onMenuBtnInteracted(startHigh, false));\n startBtn.on('pointerup', ()=> interacionManager.interactMenu(\"Start\"));\n\n startBtn.visible = false;\n startHigh.visible = false;\n\n // Continue Btn\n let continueBtn = currentScene.add.image(topBackgroundXOrigin-186, topBackgroundYOrigin+128, 'ContinueBtn');\n let continueHigh = currentScene.add.image(topBackgroundXOrigin-186, topBackgroundYOrigin+128, 'ContinueHigh');\n continueBtn.setInteractive();\n continueBtn.on('pointerover', ()=> this.onMenuBtnInteracted(continueHigh, true));\n continueBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(continueHigh, true));\n continueBtn.on('pointerup', ()=> this.onMenuBtnInteracted(continueHigh, false));\n continueBtn.on('pointerout', ()=> this.onMenuBtnInteracted(continueHigh, false));\n continueBtn.on('pointerup', ()=> interacionManager.interactMenu(\"Continue\"));\n\n continueBtn.visible = false;\n continueHigh.visible = false;\n\n // Credits Btn\n let creditsBtn = currentScene.add.image(topBackgroundXOrigin-308, topBackgroundYOrigin+128, 'CreditsBtn');\n let creditsHigh = currentScene.add.image(topBackgroundXOrigin-308, topBackgroundYOrigin+128, 'CreditsHigh');\n creditsBtn.setInteractive();\n creditsBtn.on('pointerover', ()=> this.onMenuBtnInteracted(creditsHigh, true));\n creditsBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(creditsHigh, true));\n creditsBtn.on('pointerup', ()=> this.onMenuBtnInteracted(creditsHigh, false));\n creditsBtn.on('pointerout', ()=> this.onMenuBtnInteracted(creditsHigh, false));\n creditsBtn.on('pointerup', ()=> enableCredits(this.gameCredits, true));\n\n creditsBtn.visible = false;\n creditsHigh.visible = false;\n\n // Mute Btn\n let muteBtn = currentScene.add.image(topBackgroundXOrigin-395, topBackgroundYOrigin+128, 'MenuMuteBtn');\n let muteHigh = currentScene.add.image(topBackgroundXOrigin-395.9, topBackgroundYOrigin+128, 'MenuMuteHigh');\n muteBtn.setInteractive();\n muteBtn.on('pointerover', ()=> this.onMenuBtnInteracted(muteHigh, true));\n muteBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(muteHigh, true));\n muteBtn.on('pointerup', ()=> this.onMenuBtnInteracted(muteHigh, false));\n muteBtn.on('pointerout', ()=> this.onMenuBtnInteracted(muteHigh, false));\n muteBtn.on('pointerup', ()=> interacionManager.interactMenu(\"Mute\"));\n\n muteBtn.visible = false;\n muteHigh.visible = false;\n\n let timeline = currentScene.tweens.createTimeline();\n\n timeline.add(\n {\n targets: goat,\n x: topBackgroundXOrigin + 175,\n duration: 900\n }\n );\n\n timeline.add( \n {\n targets: fondo2,\n onStart: function()\n {\n fondo2.visible = true;\n let timedEvent = currentScene.time.delayedCall(1300, function()\n {\n musicManager.playThemeSong('Main');\n startBtn.visible = true;\n continueBtn.visible = true;\n creditsBtn.visible = true;\n muteBtn.visible = true;\n\n } , currentScene);\n } \n } \n );\n timeline.play(); \n this.gameCredits = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'GameCredits');\n this.gameCredits.setInteractive();\n this.gameCredits.on('pointerdown', ()=> enableCredits(this.gameCredits, false));\n this.gameCredits.visible = false;\n }","function onOpen(e) {\n var menu = SpreadsheetApp.getUi()\n .createMenu('Flights')\n .addItem('Check Flights', 'getFlights'); \n \n menu.addToUi();\n}","function app(){\n mainMenu();\n}","showMenu() {\n this._game = null;\n this.stopRefresh();\n this._view.renderMenu();\n this._view.bindStartGame(this.startGame.bind(this));\n this._view.bindShowScores(this.showScores.bind(this));\n }","function onOpen() {\n var ui = DocumentApp.getUi();\n ui.createMenu('Script menu')\n .addItem('Setup', 'setup')\n .addItem('Create Events First Time', 'createDocForEvents')\n .addToUi();\n}","function preMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'PRE_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n loadSavedMenuGameslotDisplayHandler();\n\n setTimeout(function(){\n preMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n }, 600);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }","function frontPage() {\n console.log(\"Welcome to Reddit! the front page of the internet\");\n fpMenu();\n\n\n}","function playbutton(){\n document.querySelector('#startMenu').style.display = \"none\";\n bg_call();\n }","start() {\n super.start(this.game.menuOptions);\n this.game.display.draw(0, 0, 'a');\n this.game.display.draw(0, 1, 'b');\n this.game.display.draw(0, 2, 'c');\n this.game.display.draw(0, 3, 'd');\n this.game.display.draw(0, 4, 'e');\n this.game.display.draw(0, 5, ['f', '➧']);\n this.game.display.draw(0, 6, 'g');\n this.game.display.draw(0, 7, 'h');\n this.game.display.draw(0, 8, 'i');\n this.game.display.draw(1, 0, 'j');\n this.game.display.draw(1, 1, 'k');\n this.game.display.draw(1, 2, 'l');\n this.game.display.draw(1, 3, 'm');\n this.game.display.draw(1, 4, 'n');\n this.game.display.draw(1, 5, 'o');\n this.game.display.draw(1, 6, 'p');\n this.game.display.draw(1, 7, 'q');\n this.game.display.draw(1, 8, this.game.music.muted ? ['r', '♩'] : 'r');\n this.selected = 0;\n }","function menu() {\n inquirer.prompt([\n {\n name: \"menu\",\n message: \"Menu:\",\n type: \"list\",\n choices: [\"Products for Sale\", \"Low Inventory\", \"Add to Inventory\", \"New Product\", \"Exit\"],\n }]).then(function (answer) {\n\n // depending on the option picked for the chosen call the correct function\n switch (answer.menu) {\n case \"Products for Sale\": {\n showInventory();\n break;\n }\n case \"Low Inventory\": {\n lowerInventory();\n break;\n }\n case \"Add to Inventory\": {\n addInventory();\n \n break;\n }\n case \"New Product\": {\n addNewProduct();\n break;\n }\n case \"Exit\": {\n connection.end();\n break;\n }\n }\n\n });\n}","function menuzordActive () {\n if ($(\"#menuzord\").length) {\n $(\"#menuzord\").menuzord({\n indicatorFirstLevel: ''\n });\n };\n}","function createMainMenu(game) {\n // Fade in transition\n fadeSceneIn(game, 1000, \"Linear\");\n\n // Background\n game.add.image(0, 0, 'menu-bg').setOrigin(0, 0);\n\n // Game version\n var verStyle = { font: \"14px Optima\", fill: \"#fff\" };\n var versionText = game.add.text(2, 626, \"v\" + version(), verStyle).setOrigin(0, 1);\n versionText.setShadow(2, 2, \"#000\", 2);\n versionText.alpha = 0.3;\n\n // Title Text\n var titleStyle = { font: \"100px FrizQuadrata\", fill: \"#000\", stroke: \"#fff\", strokeThickness: 7 };\n var titleText = game.add.text(512, 250, \"Fate/Grand Wars\", titleStyle).setOrigin(0.5, 0.5);\n titleText.setShadow(1, 1, 'rgba(0,0,0,0.9)', 2, true, false);\n\n // Music\n var music = game.sound.add('menu-bgm', { volume: 0.5 } );\n music.loop = true;\n music.play();\n\n\n // Button sprite\n var button = game.add.sprite(512, 400, 'button-medium').setInteractive( useHandCursor() );\n button.on('pointerdown', (pointer) => {\n if (!pointer.rightButtonDown()) {\n button.tint = 0xbbbbbb;\n button.removeInteractive();\n startGame(game, music);\n }\n } );\n button.on('pointerover', function (pointer) { button.tint = 0xbbbbbb; } );\n button.on('pointerout', function (pointer) { button.tint = 0xffffff; } );\n\n // Start Text\n var startStyle = { font: \"35px Optima\", fill: \"#000\" };\n var startText = game.add.text(512, 400, \"START\", startStyle).setOrigin(0.5, 0.5);\n}","function mainMenu() {\n inquirer.prompt({\n type: \"list\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: [\n { name: \"Add something\", value: createMenu },\n { name: \"View something\", value: readMenu },\n { name: \"Change something\", value: updateMenu },\n { name: \"Remove something\", value: deleteMenu },\n { name: \"Quit\", value: quit }\n ]\n }).then(({ action }) => action());\n}","function menuOptions() {}","function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function onOpen() {\n var ui = SpreadsheetApp.getUi();\n // Or DocumentApp or FormApp.\n ui.createMenu('Own scripts')\n .addItem('Search Calendar Events', 'searchCalendarEvents')\n .addSeparator()\n .addSubMenu(ui.createMenu('Development')\n .addItem('First item', 'devMenuItem1')\n .addItem('Second item', 'devMenuItem2')\n )\n .addToUi();\n}","_initMenu() {\n this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;\n this.menu.direction = this.dir;\n this._setMenuElevation();\n this._setIsMenuOpen(true);\n this.menu.focusFirstItem(this._openedBy || 'program');\n }","function mainMenu() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"Add Departments\",\n \"Add Roles\",\n \"Add Employees\",\n \"View Departments\",\n \"View Roles\",\n \"View Employees\",\n \"Update Role\",\n \"Update Manager\"\n // \"View Employees by Manager\"\n ]\n })\n // Case statement for selection of menu item\n .then(function(answer) {\n switch (answer.action) {\n case \"Add Departments\":\n addDepartments();\n break;\n case \"Add Roles\":\n addRoles();\n break;\n case \"Add Employees\":\n addEmployees();\n break;\n case \"View Departments\":\n viewDepartments();\n break;\n\n case \"View Roles\":\n viewRoles();\n break;\n case \"View Employees\":\n viewEmployees();\n break;\n case \"Update Role\":\n updateRole();\n break;\n case \"Update Manager\":\n updateManager();\n break;\n // case \"View Employees by Manager\":\n // viewEmployeesByManager();\n // break;\n }\n });\n}","function initialLoad() {\n $('ul.sf-menu').superfish({\n delay: 500,\n animation: {opacity:'show',height:'show'},\n speed: 'slow',\n autoArrows: true,\n dropShadows: false\n });\n $('.toolTipCls').tooltip();\n ITL.view.datePicker($(\".datepicker\"));\n }","function Scene_GFMenu() {\n this.initialize.apply(this, arguments);\n}","function fecharMenu() {\n\t\t$('div.menu-mobile').stop(true, true).animate({'marginLeft':'-550px'}, 300);\n\t\t$('.fundo-preto-mobile').stop(true, true).removeClass('active').hide();\n\t\t$('#menumobile a.fecharmenu').stop(true, true).removeClass('fadeIn').addClass('animated fadeOut').hide();\n\t\t$('div.menu-mobile ul.primeira').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.um').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.dois').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.tres').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.quatro').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.cinco').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.seis').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.sete').stop(true, true).hide();\n\t\t$('div.menu-mobile > ul.primeira > li').stop(true, true).removeClass('flipInX').addClass('animated flipOutX').hide();\n\t\t$('div.menu-mobile').stop(true, true).removeClass('open');\n\t\t$('span.flaticon-arrow').stop(true, true).removeClass('flaticon-arrow').addClass('flaticon-arrow-down-sign-to-navigate');\n\t\t$('ul.esconder').stop(true, true).removeClass('bounceInLeft').hide();\n\t}","function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}","function walkHome(){\r\n\tbackground(0);\r\n\tfirstOption.hide();\r\n\tsecondOption.hide();\r\n\tuserName.hide();\r\n\r\n\t//change the text for the title\r\n\ttitle.html(\"You have gone home. Good Night.\");\r\n\r\n\t//startOver = createA(\"index.html\", \"Start Over\")\r\n\t//firstOption.mousePressed(startOver);\r\n}"],"string":"[\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"function loadMenu(){\\n\\t\\tpgame.state.start('menu');\\n\\t}\",\n \"function startMenu() {\\n createManager();\\n}\",\n \"function onOpen() {\\n ui.createMenu('Daily Delivery Automation')\\n .addItem('Run', 'confirmStart').addToUi();\\n}\",\n \"function gameMenuStartableDrawer() {\\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\\n }\\n }\",\n \"function StartMenu() {\\n //this.menu = new Menu('start-menu');\\n this.shutDownMenu = new Menu('shutdown-menu');\\n this.shutDownButton = new MenuButton('options-button', this.shutDownMenu);\\n Menu.apply(this, ['start-menu']);\\n}\",\n \"constructor(props) {\\n super(props);\\n\\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\\n this.state = {\\n selectedDish: null\\n }\\n console.log('menu constructor is invoke')\\n \\n }\",\n \"function display_start_menu() {\\n\\tstart_layer.show();\\n\\tstart_layer.moveToTop();\\n\\t\\n\\tdisplay_menu(\\\"start_layer\\\");\\n\\tcharacter_layer.moveToTop();\\n\\tcharacter_layer.show();\\n\\tinventory_bar_layer.show();\\n\\t\\n\\tstage.draw();\\n\\t\\n\\tplay_music('start_layer');\\n}\",\n \"start() {\\n if (this.showHideStartMenu === true) {\\n this.showHideStartMenu = false;\\n } else {\\n this.showHideStartMenu = true;\\n }\\n }\",\n \"function foodMenuItems() {\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\\r\\n\\t\\t\\t\\t\\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tvar $that = $(this),\\r\\n\\t\\t\\t\\t\\t\\twaypoint = new Waypoint({\\r\\n\\t\\t\\t\\t\\t\\t\\telement: $that,\\r\\n\\t\\t\\t\\t\\t\\t\\thandler: function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\treturn;\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$that.find('.nectar_food_menu_item').each(function (i) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tvar $that = $(this);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tsetTimeout(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$that.addClass('animated-in');\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}, i * 150);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t},\\r\\n\\t\\t\\t\\t\\t\\t\\toffset: $foodItemOffsetPos\\r\\n\\t\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t}\",\n \"function onOpen() {\\n createMenu();\\n}\",\n \"function showMenu(arg)\\r\\n\\t{\\r\\n\\t\\tswitch(arg)\\r\\n\\t\\t{\\r\\n\\t\\t\\tcase 0:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"\\\");\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t\\tcase 1:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"

                    Sheep's Snake

                    Press A to play!

                    Press B for some help !

                    \\\");\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function tl_start() {\\n $('#futureman_face, #menu-open').css('display', 'inherit');\\n $('.menu-open').css('visibility', 'inherit');\\n }\",\n \"function fastFoodRestaurantScene() {\\n subTitle.innerText = fastfoodWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fastDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFastRestaurantChoice();\\n}\",\n \"function showMenu() {\\n // clear the console\\n console.log('\\\\033c');\\n // menu selection\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n choices: [\\\"View Product Sales by Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"],\\n message: '\\\\nWhat would you like to do? '\\n }\\n ]).then( answer => {\\n switch (answer.wish){\\n case \\\"View Product Sales by Department\\\":\\n showSale();\\n break;\\n case \\\"Create New Department\\\":\\n createDept();\\n break;\\n case \\\"Exit\\\":\\n connection.end();\\n break;\\n default:\\n console.log( `\\\\x1b[1m \\\\x1b[31m\\\\nERROR! Invalid Selection\\\\x1b[0m`);\\n }\\n })\\n}\",\n \"function start() {\\r\\n var questions = [{\\r\\n type: 'rawlist',\\r\\n name: 'choice',\\r\\n message: 'What would you like to do?',\\r\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\", \\\"Exit Store\\\"]\\r\\n }];\\r\\n inquirer.prompt(questions).then(answers => {\\r\\n mainMenu(answers.choice);\\r\\n });\\r\\n}\",\n \"function menuHandler() {\\n console.log('menuHandler');\\n\\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\\n agent.add(new Suggestion(`Esplorazione delle categorie`));\\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\\n agent.add(new Suggestion(`Suggerimento prodotto`));\\n}\",\n \"_start() {\\n\\n this._menuView = new MenuView(\\n document.querySelector('nav'),\\n this.sketches\\n );\\n\\n for (var key in this.sketches) {\\n this.DEFAULT_SKETCH = key;\\n break;\\n }\\n\\n this._setupScroll();\\n this._setupWindow();\\n this._onHashChange();\\n }\",\n \"function superfishSetup() {\\n\\t\\t$('#navigation').find('.menu').superfish({\\n\\t\\t\\tdelay: 200,\\n\\t\\t\\tanimation: {opacity:'show', height:'show'},\\n\\t\\t\\tspeed: 'fast',\\n\\t\\t\\tcssArrows: true,\\n\\t\\t\\tautoArrows: true,\\n\\t\\t\\tdropShadows: false\\n\\t\\t});\\n\\t}\",\n \"function DfoMenu(/**string*/ menu)\\r\\n{\\r\\n\\tSeS(\\\"G_Menu\\\").DoMenu(menu);\\r\\n\\tDfoWait();\\r\\n}\",\n \"pressedStart()\\n\\t\\t\\t{\\n\\t\\t\\tif(this.gamestate === 'starting')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tthis.gamestate = 'choose';\\n\\t\\t\\t\\t}\\n\\t\\t\\telse if(this.gamestate === 'choose')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t}\\n\\t\\t\\telse if(this.gamestate === 'stats')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tthis.gamestate = 'bedroom';\\n\\t\\t\\t\\t}\\n\\t\\t\\telse if(this.gamestate === 'bedroom')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tthis.menu.RunFunction(this);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function actionOnClick () {\\r\\n game.state.start(\\\"nameSelectionMenu\\\");\\r\\n}\",\n \"function menuShow() {\\n ui.appbarElement.addClass('open');\\n ui.mainMenuContainer.addClass('open');\\n ui.darkbgElement.addClass('open');\\n}\",\n \"createMenu()\\n {\\n currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo');\\n\\n // The first button that will enable audio\\n let firstBtn = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'FirstStart');\\n\\n firstBtn.setInteractive();\\n firstBtn.on('pointerdown',function()\\n {\\n this.setScale(1.05);\\n });\\n firstBtn.on('pointerup',function()\\n {\\n firstBtn.disableInteractive();\\n // We play the Button pressed SFX \\n sfxManager.playSupahStar();\\n firstBtn.destroy();\\n });\\n firstBtn.on('pointerup', () => this.startMainMenu());\\n\\n // We set the fonts according to the browser\\n if(theGame.device.browser.firefox)\\n {\\n boldFontName = 'Asap-Bold';\\n regularFontName = 'Asap';\\n }\\n else\\n {\\n boldFontName = 'Asap-Bold';\\n regularFontName = 'Asap';\\n }\\n }\",\n \"function startup() {\\n\\tsceneTransition(\\\"start\\\");\\n}\",\n \"function menuhrres() {\\r\\n\\r\\n}\",\n \"function displayMenu() {\\n const menu = document.querySelector(\\\"#menu\\\");\\n let dishes = hard_coded_dishes;\\n\\n dishes.forEach(dish => {\\n // generate template for main ingredient and the name of the dish\\n const main = displayDish(\\n dish.course,\\n dish.name,\\n dish.price,\\n dish.ingredient\\n );\\n\\n // generate options for each dish\\n const options = [];\\n\\n if (dish.options) {\\n dish.options.forEach(option => {\\n options.push(displayOption(option.option, option.price));\\n });\\n }\\n\\n // add this to the DOM\\n menu.insertAdjacentHTML(\\\"beforeend\\\", main + options.join(\\\"\\\"));\\n });\\n}\",\n \"function thememascot_menuzord() {\\n $(\\\"#menuzord\\\").menuzord({\\n align: \\\"left\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n $(\\\"#menuzord-right\\\").menuzord({\\n align: \\\"right\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n }\",\n \"function main() {\\n menu = new states.Menu();\\n currentstate = menu;\\n}\",\n \"function runMenu() {\\n inquirer.prompt([\\n {\\n name: 'menu',\\n type: 'list',\\n choices: [\\n 'View Products for Sale',\\n 'View Low Inventory',\\n 'Add to Inventory',\\n 'Add New Product',\\n 'Exit'\\n ],\\n message: chalk.cyan('Select an option:')\\n }\\n ]).then(function(answers) {\\n switch (answers.menu) {\\n case 'View Products for Sale':\\n getProducts(false);\\n break;\\n case 'View Low Inventory':\\n getProducts(true);\\n break;\\n case 'Add to Inventory':\\n addInventory();\\n break;\\n case 'Add New Product':\\n addProduct();\\n break;\\n default:\\n connection.end();\\n }\\n });\\n}\",\n \"addDishToMenu(dish) {\\n if(this.menu.includes(dish))\\n {\\n this.removeDishFromMenu(dish.id);\\n }\\n this.menu.push(dish);\\n }\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function toMenu()\\n {\\n /**\\n * Opens a fan of a desk in the pause menu\\n */\\n function openFan()\\n {\\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\\n desk.toggleFan(4, 35, 10, true);\\n for (var counter = 0; counter < desk.cards.length; counter++)\\n {\\n if (state.isWin)\\n {\\n desk.cards[counter].turn(true);\\n desk.cards[counter].dataset.turned = true;\\n }\\n else if (desk.cards[counter].dataset.turned == true)\\n {\\n desk.cards[counter].turn(true);\\n }\\n }\\n state.isWin = false;\\n }\\n\\n /**\\n * Shows menu elements\\n */\\n function showMenu()\\n {\\n if (state.screen == \\\"GAME\\\")\\n {\\n cards[0].removeEventListener(\\\"move\\\", showMenuId);\\n DOM.pause.deskContainer.style.opacity = 1;\\n DOM.cardsContainer.classList.add(CSS.hidden);\\n }\\n\\n if (state.isWin)\\n {\\n DOM.pause.deskContainer.style.opacity = 0;\\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \\\"Победа со счётом: \\\" : \\\"Потрачено: \\\") + state.score;\\n DOM.pause.options.continue.disabled = true;\\n state.score = 0;\\n }\\n else\\n {\\n DOM.pause.headline.innerHTML = \\\"MEMORY GAME\\\";\\n }\\n\\n DOM.container.classList.remove(CSS.container.game);\\n DOM.container.classList.add(CSS.container.pause);\\n state.screen = \\\"MENU\\\";\\n\\n toggleHideElements(\\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\\n animation.duration.hide,\\n false,\\n openFan.bind(this)\\n );\\n }\\n\\n /**\\n * Hides a game field\\n */\\n function hideGameField(follower)\\n {\\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\\n }\\n\\n /**\\n * Moves cards from the field to the desk\\n */\\n function takeCards()\\n {\\n if (state.turnedCard)\\n {\\n state.turnedCard.turn(true);\\n }\\n\\n showMenuId = cards[0].addEventListener(\\\"move\\\", showMenu);\\n\\n for (var counter = 0; counter < cards.length; counter++)\\n {\\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \\\"PX\\\", height: sizes.desk.height + \\\"PX\\\"}, true);\\n }\\n }\\n\\n state.cardsTurnable = false;\\n if (state.screen == \\\"GAME\\\")\\n {\\n var showMenuId;\\n hideGameField();\\n takeCards();\\n }\\n else\\n {\\n hideGameField(showMenu.bind(this));\\n }\\n }\",\n \"function onOpen() {\\n \\n SpreadsheetApp.getUi().createMenu('Merchant Center')\\n .addItem('Run Now', 'main')\\n .addToUi()\\n }\",\n \"function onOpen() { CUSTOM_MENU.add(); }\",\n \"getMenu() {alert(\\\"entering grocery.js getMenu()\\\")\\n\\t\\t// Assemble the menu list (meal nodes)\\n\\t\\tthis.menuCloset.destructBoxes()\\n\\t\\tlet mealNodes = graph.getNodesByID_partial(\\\"meal\\\", \\\"\\\")\\n\\t\\tfor (let meal of mealNodes) {\\n\\t\\t\\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\\n\\t\\t\\t\\tthis.menuCloset.add(meal)\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tthis.updateGroceryList()\\n\\t}\",\n \"function gotoMenu(){\\n x = 200;\\n dx = 1;\\n y = 200;\\n dy = 1;\\n fuel = 5000;\\n landed = false;\\n crashed = false;\\n fuelout = false;\\n gameTimer = 0;\\n canvas_x=0;\\t\\n gamestart = false;\\n levelselect = true;\\n bonus = 0;\\n score = 0;\\n}\",\n \"start() {\\r\\n //Below are methods that dont exist YET and to build out our menu; what we think it will look like and then we are going to implement \\r\\n //those methods this is referred to as the top-down development approach. Where we start from the top then implement those methods.\\r\\n //this.showMainMenuOptions(method) will return the selection that the user gives us \\r\\n let selection = this.showMainMenuOptions();\\r\\n //selection is a variable we're gonna use to get user input of what option out menu has the user selected. We will use 0=exit and do \\r\\n //something based off of it, so below is a switch. \\r\\n while (selection != 0) {\\r\\n switch (selection) {\\r\\n case \\\"1\\\":\\r\\n //reminder that these are sort of placeholders that will be implemented later according to the top down development approach\\r\\n this.createAllignmentGroup();\\r\\n break;\\r\\n case \\\"2\\\":\\r\\n this.viewAllignmentGroup();\\r\\n break;\\r\\n case \\\"3\\\":\\r\\n this.deleteAllignmentGroup();\\r\\n break;\\r\\n case \\\"4\\\":\\r\\n this.displayAllignmentGroup();\\r\\n break;\\r\\n default:\\r\\n selection = 0;\\r\\n }\\r\\n //outside of our switch here we get the selection like at the beginning to ensure the loop keeps looping as long as we do not select 0 \\r\\n //or select 1-4\\r\\n //So this is basically the flow of our application, we are going to prompt/show the menu options the user is going to select something\\r\\n //we're going to say as long as 0 isnt selected we are going to continue with our determination of what they did select and based on \\r\\n //what they selected it will show the cases above. \\r\\n selection = this.showMainMenuOptions();\\r\\n }\\r\\n alert(\\\"Farewell!\\\");\\r\\n }\",\n \"function onOpen() {\\n SpreadsheetApp.getUi().createMenu('Equipment requests')\\n .addItem('Set up', 'setup_')\\n .addItem('Clean up', 'cleanup_')\\n .addToUi();\\n}\",\n \"function initMenu(){\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"clear\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"properties\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"help\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"rename\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"expand\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"fold\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"---\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"duplicate\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"delete\\\");\\n\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 0, myNodeEnableProperties);\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 1, myNodeEnableHelp);\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 3, myNodeEnableBody);\\t\\t\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 4, myNodeEnableBody);\\t\\t\\n}\",\n \"function menu() {\\n this.meal1 = \\\"Ham and Cheese Sandwich\\\",\\n this.meal2 = \\\"Roastbeef Sandwich\\\"\\n }\",\n \"function start() {\\n\\n inquirer.prompt({\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Delete Product\\\",\\n \\\"EXIT\\\"\\n ]\\n }).then(function(answer) {\\n switch (answer.menu) {\\n case \\\"View Products for Sale\\\":\\n productsForSale();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"Delete Product\\\":\\n deleteProduct();\\n break;\\n\\n case \\\"EXIT\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function showMenu(fast) {\\n\\t\\t\\t\\tif ((smallBreakpoint && !opt.everySizes) || opt.everySizes) {\\n\\t\\t\\t\\t\\tmenuOpen = true;\\n\\t\\t\\t\\t\\t$html.addClass('extra-menu-open');\\n\\t\\t\\t\\t\\t$html.removeClass('extra-menu-close');\\n\\t\\t\\t\\t\\tif (fast) {\\n\\t\\t\\t\\t\\t\\ttimeline.totalProgress(1);\\n\\t\\t\\t\\t\\t\\t$window.trigger('extra:menu:ShowComplete');\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\ttimeline.play();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\thideMenu(true);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function showMainMenu(){\\n addTemplate(\\\"menuTemplate\\\");\\n showMenu();\\n}\",\n \"function mainMenu() {\\n INQUIRER.prompt([{\\n name: 'next',\\n type: 'list',\\n message: 'Welcome',\\n choices: [\\n 'View All Products',\\n `View Low Inventory`,\\n 'Add to Inventory',\\n 'Add New Product',\\n 'Exit'\\n ]\\n }]).then(function(input) {\\n\\n switch (input.next) {\\n case 'View All Products':\\n displayAll();\\n break;\\n\\n case 'View Low Inventory':\\n displayLow();\\n break;\\n\\n case 'Add to Inventory':\\n addToInventory();\\n\\n case 'Exit':\\n connection.end();\\n break;\\n\\n //add product\\n default:\\n addNewProduct();\\n break;\\n }\\n });\\n}\",\n \"function StartFishing() {\\n\\n DebugStart()\\n // How far to look for trees from the player\\n var range = 16;\\n AutoFisherman(range);\\n}\",\n \"expandMenu() {\\r\\n\\t}\",\n \"function mainMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"introAction\\\",\\n\\t\\tmessage: \\\"Welcome, pick an action: \\\",\\n\\t\\tchoices: [\\\"Create a Basic Card\\\", \\\"Create a Cloze Card\\\", \\\"Review Existing Cards\\\"]\\n\\t}]).then(function(answers){\\n\\t\\tswitch (answers.introAction) {\\n\\t\\t\\tcase \\\"Create a Basic Card\\\":\\n\\t\\t\\t\\tcreateBasicCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Create a Cloze Card\\\":\\n\\t\\t\\t\\tcreateClozeCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Review Existing Cards\\\":\\n\\t\\t\\t\\treviewCards();\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t});\\n}\",\n \"function goToMenu() {\\n stopTTS();\\n cStatus = undefined;\\n cStatus = new CurrentStatus();\\n $('#quiz').hide('slow');\\n $('#game').hide('slow');\\n $('#menu').show('slow');\\n}\",\n \"setupMenu () {\\n let dy = 17;\\n // create buttons for the action categories\\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\\n // create buttons for each command\\n for (let key of Object.keys(this.jobCommands)) {\\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\\n dy += button.height + 1;\\n }\\n // set the hit area for the menu\\n this.menu.calculateHitArea();\\n // menu is closed by default\\n this.menu.hideMenu();\\n }\",\n \"prepare() { this.createTopMenu(); this.createQuickMenu(); this.showQuickMenu(); }\",\n \"function onOpen() {\\n SpreadsheetApp.getUi()\\n .createMenu('Great Explorations')\\n .addItem('Match Girls to Workshops', 'matchGirls')\\n .addToUi();\\n}\",\n \"function menu() {\\n document.getElementById(\\\"menuStart\\\").classList.toggle(\\\"show\\\");\\n}\",\n \"function C999_Common_Achievements_MainMenu() {\\n C999_Common_Achievements_ResetImage();\\n\\tSetScene(\\\"C000_Intro\\\", \\\"ChapterSelect\\\");\\n}\",\n \"function start(action) {\\r\\n\\t\\r\\n\\t\\tswitch (action) {\\r\\n\\t\\t\\tcase 'go look':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: What are you going to look at??\\\", 1000);\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'explore':\\r\\n\\t\\t\\t\\texploreship(gameobj.explore);\\r\\n\\t\\t\\t\\tgameobj.explore++;\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'sit tight':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: Good choice we should probably wait for John to get back.\\\", 1000);\\r\\n\\t\\t\\t\\tgameobj.sittight++;\\r\\n\\t\\t\\tbreak;\\t\\r\\n\\t\\t}\\r\\n}\",\n \"function menu() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"Supervisor's Menu Options:\\\",\\n choices: [\\\"View Product Sales By Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"]\\n }\\n ]).then(function (answers) {\\n if (answers.choice === \\\"View Product Sales By Department\\\") {\\n displaySales();\\n }\\n else if (answers.choice === \\\"Create New Department\\\") {\\n createDepartment();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function menu() {\\n\\t\\n // Title of Game\\n title = new createjs.Text(\\\"Poker Room\\\", \\\"50px Bembo\\\", \\\"#FF0000\\\");\\n title.x = width/3.1;\\n title.y = height/4;\\n\\n // Subtitle of Game\\n subtitle = new createjs.Text(\\\"Let's Play Poker\\\", \\\"30px Bembo\\\", \\\"#FF0000\\\");\\n subtitle.x = width/2.8;\\n subtitle.y = height/2.8;\\n\\n // Creating Buttons for Game\\n addToMenu(title);\\n addToMenu(subtitle);\\n startButton();\\n howToPlayButton();\\n\\n // update to show title and subtitle\\n stage.update();\\n}\",\n \"function init() {\\n console.log('Welcome to your company employee manager.')\\n menu()\\n}\",\n \"startGame() {\\n this.scene.start('MenuScene');\\n }\",\n \"function showMenu() {\\n rectMode(CENTER);\\n fill(colorList[2]);\\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[5]);\\n text(\\\"How to Play\\\", buttonX, buttonY);\\n\\n fill(colorList[3]);\\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[4]);\\n text(\\\"Dancing Block\\\", buttonX, secondButtonYpos);\\n \\n}\",\n \"function start() {\\n inquirer\\n .prompt([{\\n type: \\\"list\\\",\\n name: \\\"menu\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products for sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\"\\n ]\\n }\\n\\n ])\\n .then(function (answers) {\\n if (answers.menu === \\\"View Products for sale\\\") {\\n return viewProducts();\\n } else if (answers.menu === \\\"View Low Inventory\\\") {\\n return lowInventory();\\n } else if (answers.menu === \\\"Add to Inventory\\\") {\\n return addInventory();\\n } else if (answers.menu === \\\"Add New Product\\\") {\\n return addProduct();\\n }\\n });\\n}\",\n \"function menu(){\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"exit\\\"\\n ]\\n }).then(function(answer){\\n switch(answer.action){\\n case \\\"View Products for Sale\\\":\\n products();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addToInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"exit\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function onOpen() {\\n var menu = [\\n { name: \\\"Fill all items list\\\", functionName: \\\"fillAllItemsData\\\" },\\n null,\\n { name: \\\"Schedule run task every hour\\\", functionName: \\\"configureRun\\\"},\\n { name: \\\"Remove schedule\\\", functionName: \\\"configureStop\\\"},\\n ];\\n \\n SpreadsheetApp.getActiveSpreadsheet().addMenu(\\\"➪ Tarkov-Market\\\", menu);\\n}\",\n \"function start() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"Purchase Items\\\", \\n \\\"Exit\\\"],\\n }\\n ]).then(function(answer) {\\n\\n // Based on the selection, the user experience will be routed in one of these directions\\n switch (answer.choice) {\\n case \\\"Purchase Items\\\":\\n displayItems();\\n break;\\n case \\\"Exit\\\":\\n exit();\\n break;\\n }\\n });\\n} // End start function\",\n \"function initSuperFish(){\\r\\n\\t\\t\\r\\n\\t\\t$(\\\".sf-menu\\\").superfish({\\r\\n\\t\\t\\t delay: 50,\\r\\n\\t\\t\\t autoArrows: true,\\r\\n\\t\\t\\t animation: {opacity:'show'}\\r\\n\\t\\t\\t //cssArrows: true\\r\\n\\t\\t});\\r\\n\\t\\t\\r\\n\\t\\t// Replace SuperFish CSS Arrows to Font Awesome Icons\\r\\n\\t\\t$('nav > ul.sf-menu > li').each(function(){\\r\\n\\t\\t\\t$(this).find('.sf-with-ul').append('');\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function init_dash() {\\n dropDown();\\n}\",\n \"doReStart() {\\n // Stoppe la musique d'intro\\n this.musicIntro.stop();\\n // Lance la scene de menus\\n this.scene.start('MenuScene');\\n }\",\n \"function mainMenu() {\\n\\n inquirer\\n .prompt({\\n type: \\\"list\\\",\\n name: \\\"task\\\",\\n message: \\\"Plz, select your entry ?\\\",\\n choices: [\\n \\\"View Employees\\\",\\n \\\"View Departments\\\",\\n \\\"View Roles\\\",\\n \\\"Add Employees\\\",\\n \\\"Update EmployeeRole\\\",\\n \\\"Add Role\\\",\\n \\\"Exit\\\"]\\n })\\n .then(function ({ task }) {\\n switch (task) {\\n case \\\"View Employees\\\":\\n viewEmployee();\\n break;\\n case \\\"View Departments\\\":\\n viewDepartmnt();\\n break;\\n case \\\"View Roles\\\":\\n viewRole();\\n break;\\n case \\\"Add Employees\\\":\\n addEmployee();\\n break;\\n case \\\"Update EmployeeRole\\\":\\n updateEmployeeRole();\\n break;\\n case \\\"Add Role\\\":\\n addRole();\\n break;\\n case \\\"Exit\\\":\\n connection.end();\\n break;\\n \\n }\\n });\\n}\",\n \"function openMenu() {\\n g_IsMenuOpen = true;\\n}\",\n \"function start() {\\n inquirer.prompt([{\\n name: \\\"entrance\\\",\\n message: \\\"Would you like to shop with us today?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then(function(answer) {\\n // if yes, proceed to shop menu\\n if (answer.entrance === \\\"Yes\\\") {\\n menu();\\n } else {\\n // if no, end node cli \\n console.log(\\\"---------------------------------------\\\");\\n console.log(\\\"No?!?!?! What do you mean no!?!?!?!?!?\\\");\\n console.log(\\\"---------------------------------------\\\");\\n connection.destroy();\\n return;\\n }\\n });\\n}\",\n \"function runSupervisorMenu() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Please select from menu: \\\".magenta.italic.bold,\\n name: \\\"menu\\\",\\n choices: [\\\"View Product Sales By Department\\\", \\\"Create New Department\\\", \\\"View All Users\\\", \\\"Create User\\\", \\\"Exit\\\"]\\n }\\n ]).then(function (inquirerResponse) {\\n switch (inquirerResponse.menu) {\\n case \\\"View Product Sales By Department\\\":\\n viewDepartmentSales();\\n break;\\n case \\\"Create New Department\\\":\\n addDepartment();\\n break;\\n case \\\"View All Users\\\":\\n viewAllUsers();\\n break;\\n case \\\"Create User\\\":\\n addUser();\\n break;\\n case \\\"Exit\\\":\\n process.exit();\\n break;\\n }\\n });\\n}\",\n \"function gameMenutoMainMenu() {\\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'MAIN_MENU') {\\n mainSfxController(preloaderSfxSource);\\n preloaderStarter();\\n\\n setTimeout(function(){\\n gameMenu.classList.add('pagehide');\\n mainMenu.classList.remove('pagehide');\\n gameMenuStartableid.classList.remove('game-menu-startable');\\n gameMenuBattlepointer1id.classList.remove('game-menu-battlepointer');\\n if (store.getState().activeGameState.isMap1Completed != true) {\\n gameMenuStarthereTextid.classList.add('nodisplay');\\n }\\n }, 600);\\n\\n setTimeout(function(){\\n mainMenuCreditsButtonid.classList.remove('nodisplay');\\n mainMenuStartButtonid.classList.remove('nodisplay');\\n }, 1400);\\n\\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\\n\\n loadSavedMenuid.classList.remove('load-saved-menu');\\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\\n mainMenuStartImageid.classList.add('main-menu-start-image');\\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\\n }\\n }\",\n \"function menu() {\\n inquirer\\n .prompt({\\n name: \\\"menuOptions\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products\\\", \\\"View Low Inventory\\\", \\\"Add Inventory\\\", \\\"Add New Product\\\"]\\n })\\n .then(function(answer) {\\n // based on their answer, run appropriate function\\n if (answer.menuOptions === \\\"View Products\\\") {\\n viewProducts();\\n }\\n else if (answer.menuOptions === \\\"View Low Inventory\\\") {\\n viewLowInventory();\\n }\\n else if (answer.menuOptions === \\\"Add Inventory\\\") {\\n addInventory();\\n }\\n else if (answer.menuOptions === \\\"Add New Product\\\") {\\n addNewProduct();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function Menu() {\\n\\t\\n\\tPhaser.State.call(this);\\n\\t\\n}\",\n \"function menuGame(){\\n startScene.visible = true;\\n helpScene.visible = false;\\n gameOverScene.visible = false;\\n gameScene.visible = false;\\n}\",\n \"function showMenu() {\\n if(newGame) {\\n $('#main').show();\\n }\\n else {\\n $('#end').show();\\n }\\n}\",\n \"function toMenu() {\\n\\tclearScreen();\\n\\tviewPlayScreen();\\n}\",\n \"startMainMenu()\\n {\\n // We check if the player is on mobile and open fullscreen\\n let os = theGame.device.os;\\n if(os.android || os.iOS || os.iPad || os.iPhone || os.windowsPhone)\\n {\\n openFullScreen();\\n }\\n \\n let gameCredits;\\n let goat = currentScene.add.image(-100, topBackgroundYOrigin+35, 'GoatMenu');\\n let fondo2 = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo2');\\n fondo2.visible = false;\\n let logo = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Logo');\\n //logo.visible = false;\\n \\n // Start Btn\\n let startBtn = currentScene.add.image(topBackgroundXOrigin-40, topBackgroundYOrigin+125, 'StartBtn');\\n let startHigh = currentScene.add.image(topBackgroundXOrigin-40, topBackgroundYOrigin+125, 'StartHigh');\\n startBtn.setInteractive();\\n startBtn.on('pointerover', ()=> this.onMenuBtnInteracted(startHigh, true));\\n startBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(startHigh, true));\\n startBtn.on('pointerup', ()=> this.onMenuBtnInteracted(startHigh, false));\\n startBtn.on('pointerout', ()=> this.onMenuBtnInteracted(startHigh, false));\\n startBtn.on('pointerup', ()=> interacionManager.interactMenu(\\\"Start\\\"));\\n\\n startBtn.visible = false;\\n startHigh.visible = false;\\n\\n // Continue Btn\\n let continueBtn = currentScene.add.image(topBackgroundXOrigin-186, topBackgroundYOrigin+128, 'ContinueBtn');\\n let continueHigh = currentScene.add.image(topBackgroundXOrigin-186, topBackgroundYOrigin+128, 'ContinueHigh');\\n continueBtn.setInteractive();\\n continueBtn.on('pointerover', ()=> this.onMenuBtnInteracted(continueHigh, true));\\n continueBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(continueHigh, true));\\n continueBtn.on('pointerup', ()=> this.onMenuBtnInteracted(continueHigh, false));\\n continueBtn.on('pointerout', ()=> this.onMenuBtnInteracted(continueHigh, false));\\n continueBtn.on('pointerup', ()=> interacionManager.interactMenu(\\\"Continue\\\"));\\n\\n continueBtn.visible = false;\\n continueHigh.visible = false;\\n\\n // Credits Btn\\n let creditsBtn = currentScene.add.image(topBackgroundXOrigin-308, topBackgroundYOrigin+128, 'CreditsBtn');\\n let creditsHigh = currentScene.add.image(topBackgroundXOrigin-308, topBackgroundYOrigin+128, 'CreditsHigh');\\n creditsBtn.setInteractive();\\n creditsBtn.on('pointerover', ()=> this.onMenuBtnInteracted(creditsHigh, true));\\n creditsBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(creditsHigh, true));\\n creditsBtn.on('pointerup', ()=> this.onMenuBtnInteracted(creditsHigh, false));\\n creditsBtn.on('pointerout', ()=> this.onMenuBtnInteracted(creditsHigh, false));\\n creditsBtn.on('pointerup', ()=> enableCredits(this.gameCredits, true));\\n\\n creditsBtn.visible = false;\\n creditsHigh.visible = false;\\n\\n // Mute Btn\\n let muteBtn = currentScene.add.image(topBackgroundXOrigin-395, topBackgroundYOrigin+128, 'MenuMuteBtn');\\n let muteHigh = currentScene.add.image(topBackgroundXOrigin-395.9, topBackgroundYOrigin+128, 'MenuMuteHigh');\\n muteBtn.setInteractive();\\n muteBtn.on('pointerover', ()=> this.onMenuBtnInteracted(muteHigh, true));\\n muteBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(muteHigh, true));\\n muteBtn.on('pointerup', ()=> this.onMenuBtnInteracted(muteHigh, false));\\n muteBtn.on('pointerout', ()=> this.onMenuBtnInteracted(muteHigh, false));\\n muteBtn.on('pointerup', ()=> interacionManager.interactMenu(\\\"Mute\\\"));\\n\\n muteBtn.visible = false;\\n muteHigh.visible = false;\\n\\n let timeline = currentScene.tweens.createTimeline();\\n\\n timeline.add(\\n {\\n targets: goat,\\n x: topBackgroundXOrigin + 175,\\n duration: 900\\n }\\n );\\n\\n timeline.add( \\n {\\n targets: fondo2,\\n onStart: function()\\n {\\n fondo2.visible = true;\\n let timedEvent = currentScene.time.delayedCall(1300, function()\\n {\\n musicManager.playThemeSong('Main');\\n startBtn.visible = true;\\n continueBtn.visible = true;\\n creditsBtn.visible = true;\\n muteBtn.visible = true;\\n\\n } , currentScene);\\n } \\n } \\n );\\n timeline.play(); \\n this.gameCredits = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'GameCredits');\\n this.gameCredits.setInteractive();\\n this.gameCredits.on('pointerdown', ()=> enableCredits(this.gameCredits, false));\\n this.gameCredits.visible = false;\\n }\",\n \"function onOpen(e) {\\n var menu = SpreadsheetApp.getUi()\\n .createMenu('Flights')\\n .addItem('Check Flights', 'getFlights'); \\n \\n menu.addToUi();\\n}\",\n \"function app(){\\n mainMenu();\\n}\",\n \"showMenu() {\\n this._game = null;\\n this.stopRefresh();\\n this._view.renderMenu();\\n this._view.bindStartGame(this.startGame.bind(this));\\n this._view.bindShowScores(this.showScores.bind(this));\\n }\",\n \"function onOpen() {\\n var ui = DocumentApp.getUi();\\n ui.createMenu('Script menu')\\n .addItem('Setup', 'setup')\\n .addItem('Create Events First Time', 'createDocForEvents')\\n .addToUi();\\n}\",\n \"function preMenutoMainMenu() {\\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'PRE_MENU' && store.getState().currentPage == 'MAIN_MENU') {\\n mainSfxController(preloaderSfxSource);\\n preloaderStarter();\\n loadSavedMenuGameslotDisplayHandler();\\n\\n setTimeout(function(){\\n preMenu.classList.add('pagehide');\\n mainMenu.classList.remove('pagehide');\\n }, 600);\\n\\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\\n mainMenuStartImageid.classList.add('main-menu-start-image');\\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\\n }\\n }\",\n \"function frontPage() {\\n console.log(\\\"Welcome to Reddit! the front page of the internet\\\");\\n fpMenu();\\n\\n\\n}\",\n \"function playbutton(){\\n document.querySelector('#startMenu').style.display = \\\"none\\\";\\n bg_call();\\n }\",\n \"start() {\\n super.start(this.game.menuOptions);\\n this.game.display.draw(0, 0, 'a');\\n this.game.display.draw(0, 1, 'b');\\n this.game.display.draw(0, 2, 'c');\\n this.game.display.draw(0, 3, 'd');\\n this.game.display.draw(0, 4, 'e');\\n this.game.display.draw(0, 5, ['f', '➧']);\\n this.game.display.draw(0, 6, 'g');\\n this.game.display.draw(0, 7, 'h');\\n this.game.display.draw(0, 8, 'i');\\n this.game.display.draw(1, 0, 'j');\\n this.game.display.draw(1, 1, 'k');\\n this.game.display.draw(1, 2, 'l');\\n this.game.display.draw(1, 3, 'm');\\n this.game.display.draw(1, 4, 'n');\\n this.game.display.draw(1, 5, 'o');\\n this.game.display.draw(1, 6, 'p');\\n this.game.display.draw(1, 7, 'q');\\n this.game.display.draw(1, 8, this.game.music.muted ? ['r', '♩'] : 'r');\\n this.selected = 0;\\n }\",\n \"function menu() {\\n inquirer.prompt([\\n {\\n name: \\\"menu\\\",\\n message: \\\"Menu:\\\",\\n type: \\\"list\\\",\\n choices: [\\\"Products for Sale\\\", \\\"Low Inventory\\\", \\\"Add to Inventory\\\", \\\"New Product\\\", \\\"Exit\\\"],\\n }]).then(function (answer) {\\n\\n // depending on the option picked for the chosen call the correct function\\n switch (answer.menu) {\\n case \\\"Products for Sale\\\": {\\n showInventory();\\n break;\\n }\\n case \\\"Low Inventory\\\": {\\n lowerInventory();\\n break;\\n }\\n case \\\"Add to Inventory\\\": {\\n addInventory();\\n \\n break;\\n }\\n case \\\"New Product\\\": {\\n addNewProduct();\\n break;\\n }\\n case \\\"Exit\\\": {\\n connection.end();\\n break;\\n }\\n }\\n\\n });\\n}\",\n \"function menuzordActive () {\\n if ($(\\\"#menuzord\\\").length) {\\n $(\\\"#menuzord\\\").menuzord({\\n indicatorFirstLevel: ''\\n });\\n };\\n}\",\n \"function createMainMenu(game) {\\n // Fade in transition\\n fadeSceneIn(game, 1000, \\\"Linear\\\");\\n\\n // Background\\n game.add.image(0, 0, 'menu-bg').setOrigin(0, 0);\\n\\n // Game version\\n var verStyle = { font: \\\"14px Optima\\\", fill: \\\"#fff\\\" };\\n var versionText = game.add.text(2, 626, \\\"v\\\" + version(), verStyle).setOrigin(0, 1);\\n versionText.setShadow(2, 2, \\\"#000\\\", 2);\\n versionText.alpha = 0.3;\\n\\n // Title Text\\n var titleStyle = { font: \\\"100px FrizQuadrata\\\", fill: \\\"#000\\\", stroke: \\\"#fff\\\", strokeThickness: 7 };\\n var titleText = game.add.text(512, 250, \\\"Fate/Grand Wars\\\", titleStyle).setOrigin(0.5, 0.5);\\n titleText.setShadow(1, 1, 'rgba(0,0,0,0.9)', 2, true, false);\\n\\n // Music\\n var music = game.sound.add('menu-bgm', { volume: 0.5 } );\\n music.loop = true;\\n music.play();\\n\\n\\n // Button sprite\\n var button = game.add.sprite(512, 400, 'button-medium').setInteractive( useHandCursor() );\\n button.on('pointerdown', (pointer) => {\\n if (!pointer.rightButtonDown()) {\\n button.tint = 0xbbbbbb;\\n button.removeInteractive();\\n startGame(game, music);\\n }\\n } );\\n button.on('pointerover', function (pointer) { button.tint = 0xbbbbbb; } );\\n button.on('pointerout', function (pointer) { button.tint = 0xffffff; } );\\n\\n // Start Text\\n var startStyle = { font: \\\"35px Optima\\\", fill: \\\"#000\\\" };\\n var startText = game.add.text(512, 400, \\\"START\\\", startStyle).setOrigin(0.5, 0.5);\\n}\",\n \"function mainMenu() {\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n { name: \\\"Add something\\\", value: createMenu },\\n { name: \\\"View something\\\", value: readMenu },\\n { name: \\\"Change something\\\", value: updateMenu },\\n { name: \\\"Remove something\\\", value: deleteMenu },\\n { name: \\\"Quit\\\", value: quit }\\n ]\\n }).then(({ action }) => action());\\n}\",\n \"function menuOptions() {}\",\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function onOpen() {\\n var ui = SpreadsheetApp.getUi();\\n // Or DocumentApp or FormApp.\\n ui.createMenu('Own scripts')\\n .addItem('Search Calendar Events', 'searchCalendarEvents')\\n .addSeparator()\\n .addSubMenu(ui.createMenu('Development')\\n .addItem('First item', 'devMenuItem1')\\n .addItem('Second item', 'devMenuItem2')\\n )\\n .addToUi();\\n}\",\n \"_initMenu() {\\n this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;\\n this.menu.direction = this.dir;\\n this._setMenuElevation();\\n this._setIsMenuOpen(true);\\n this.menu.focusFirstItem(this._openedBy || 'program');\\n }\",\n \"function mainMenu() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"Add Departments\\\",\\n \\\"Add Roles\\\",\\n \\\"Add Employees\\\",\\n \\\"View Departments\\\",\\n \\\"View Roles\\\",\\n \\\"View Employees\\\",\\n \\\"Update Role\\\",\\n \\\"Update Manager\\\"\\n // \\\"View Employees by Manager\\\"\\n ]\\n })\\n // Case statement for selection of menu item\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"Add Departments\\\":\\n addDepartments();\\n break;\\n case \\\"Add Roles\\\":\\n addRoles();\\n break;\\n case \\\"Add Employees\\\":\\n addEmployees();\\n break;\\n case \\\"View Departments\\\":\\n viewDepartments();\\n break;\\n\\n case \\\"View Roles\\\":\\n viewRoles();\\n break;\\n case \\\"View Employees\\\":\\n viewEmployees();\\n break;\\n case \\\"Update Role\\\":\\n updateRole();\\n break;\\n case \\\"Update Manager\\\":\\n updateManager();\\n break;\\n // case \\\"View Employees by Manager\\\":\\n // viewEmployeesByManager();\\n // break;\\n }\\n });\\n}\",\n \"function initialLoad() {\\n $('ul.sf-menu').superfish({\\n delay: 500,\\n animation: {opacity:'show',height:'show'},\\n speed: 'slow',\\n autoArrows: true,\\n dropShadows: false\\n });\\n $('.toolTipCls').tooltip();\\n ITL.view.datePicker($(\\\".datepicker\\\"));\\n }\",\n \"function Scene_GFMenu() {\\n this.initialize.apply(this, arguments);\\n}\",\n \"function fecharMenu() {\\n\\t\\t$('div.menu-mobile').stop(true, true).animate({'marginLeft':'-550px'}, 300);\\n\\t\\t$('.fundo-preto-mobile').stop(true, true).removeClass('active').hide();\\n\\t\\t$('#menumobile a.fecharmenu').stop(true, true).removeClass('fadeIn').addClass('animated fadeOut').hide();\\n\\t\\t$('div.menu-mobile ul.primeira').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.um').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.dois').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.tres').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.quatro').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.cinco').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.seis').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.sete').stop(true, true).hide();\\n\\t\\t$('div.menu-mobile > ul.primeira > li').stop(true, true).removeClass('flipInX').addClass('animated flipOutX').hide();\\n\\t\\t$('div.menu-mobile').stop(true, true).removeClass('open');\\n\\t\\t$('span.flaticon-arrow').stop(true, true).removeClass('flaticon-arrow').addClass('flaticon-arrow-down-sign-to-navigate');\\n\\t\\t$('ul.esconder').stop(true, true).removeClass('bounceInLeft').hide();\\n\\t}\",\n \"function fancyRestauratMenu() {\\n subTitle.innerText = fancyRestaurantWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fancyDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFancyRestaurantChoice();\\n}\",\n \"function walkHome(){\\r\\n\\tbackground(0);\\r\\n\\tfirstOption.hide();\\r\\n\\tsecondOption.hide();\\r\\n\\tuserName.hide();\\r\\n\\r\\n\\t//change the text for the title\\r\\n\\ttitle.html(\\\"You have gone home. Good Night.\\\");\\r\\n\\r\\n\\t//startOver = createA(\\\"index.html\\\", \\\"Start Over\\\")\\r\\n\\t//firstOption.mousePressed(startOver);\\r\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.65776086","0.65583575","0.65202","0.6496863","0.6446255","0.6437807","0.6436781","0.64309365","0.6362453","0.6336776","0.6317718","0.6301867","0.6280807","0.6278971","0.6271259","0.62144846","0.6179938","0.6157224","0.6079268","0.6076413","0.6034619","0.6029177","0.59927243","0.5964183","0.59235823","0.59214294","0.5916339","0.5899422","0.5889041","0.58886987","0.58853495","0.5881217","0.5871996","0.5862523","0.58601534","0.5856003","0.5831402","0.58295476","0.58288664","0.5826047","0.5825483","0.58118355","0.5811118","0.58062553","0.58027154","0.5800293","0.5796981","0.57861143","0.5781985","0.5778237","0.5771747","0.5770944","0.57669604","0.57635635","0.57555807","0.57539654","0.57530385","0.5745582","0.57405066","0.57396847","0.5736355","0.5729542","0.5724832","0.5723902","0.57185555","0.57114834","0.57074267","0.57036585","0.57005155","0.5700176","0.56981987","0.56966174","0.56944776","0.56926364","0.5688518","0.56851935","0.56845534","0.5671059","0.56694376","0.56685084","0.5666951","0.5666337","0.5659075","0.56590444","0.56467944","0.56407386","0.56365424","0.5635241","0.5630158","0.5628872","0.562164","0.561832","0.5617711","0.56088185","0.56058514","0.56051934","0.5603087","0.55950725","0.558658","0.5584327"],"string":"[\n \"0.65776086\",\n \"0.65583575\",\n \"0.65202\",\n \"0.6496863\",\n \"0.6446255\",\n \"0.6437807\",\n \"0.6436781\",\n \"0.64309365\",\n \"0.6362453\",\n \"0.6336776\",\n \"0.6317718\",\n \"0.6301867\",\n \"0.6280807\",\n \"0.6278971\",\n \"0.6271259\",\n \"0.62144846\",\n \"0.6179938\",\n \"0.6157224\",\n \"0.6079268\",\n \"0.6076413\",\n \"0.6034619\",\n \"0.6029177\",\n \"0.59927243\",\n \"0.5964183\",\n \"0.59235823\",\n \"0.59214294\",\n \"0.5916339\",\n \"0.5899422\",\n \"0.5889041\",\n \"0.58886987\",\n \"0.58853495\",\n \"0.5881217\",\n \"0.5871996\",\n \"0.5862523\",\n \"0.58601534\",\n \"0.5856003\",\n \"0.5831402\",\n \"0.58295476\",\n \"0.58288664\",\n \"0.5826047\",\n \"0.5825483\",\n \"0.58118355\",\n \"0.5811118\",\n \"0.58062553\",\n \"0.58027154\",\n \"0.5800293\",\n \"0.5796981\",\n \"0.57861143\",\n \"0.5781985\",\n \"0.5778237\",\n \"0.5771747\",\n \"0.5770944\",\n \"0.57669604\",\n \"0.57635635\",\n \"0.57555807\",\n \"0.57539654\",\n \"0.57530385\",\n \"0.5745582\",\n \"0.57405066\",\n \"0.57396847\",\n \"0.5736355\",\n \"0.5729542\",\n \"0.5724832\",\n \"0.5723902\",\n \"0.57185555\",\n \"0.57114834\",\n \"0.57074267\",\n \"0.57036585\",\n \"0.57005155\",\n \"0.5700176\",\n \"0.56981987\",\n \"0.56966174\",\n \"0.56944776\",\n \"0.56926364\",\n \"0.5688518\",\n \"0.56851935\",\n \"0.56845534\",\n \"0.5671059\",\n \"0.56694376\",\n \"0.56685084\",\n \"0.5666951\",\n \"0.5666337\",\n \"0.5659075\",\n \"0.56590444\",\n \"0.56467944\",\n \"0.56407386\",\n \"0.56365424\",\n \"0.5635241\",\n \"0.5630158\",\n \"0.5628872\",\n \"0.562164\",\n \"0.561832\",\n \"0.5617711\",\n \"0.56088185\",\n \"0.56058514\",\n \"0.56051934\",\n \"0.5603087\",\n \"0.55950725\",\n \"0.558658\",\n \"0.5584327\"\n]"},"document_score":{"kind":"string","value":"0.58811235"},"document_rank":{"kind":"string","value":"32"}}},{"rowIdx":67,"cells":{"query":{"kind":"string","value":"Endning scene, when button is clicked the page refreshes to starting point."},"document":{"kind":"string","value":"function restaurantClosing() {\n subTitle.innerText = gameExit;\n firstButton.innerText = \"Play again?\";\n firstButton.classList.remove(\"hidden\");\n\n fancyDiv.classList.add(\"hidden\");\n fastDiv.classList.add(\"hidden\");\n firstButton.onclick = function() {\n location.reload();\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 end(){\n Manager.clearGame();\n changeState(gameConfig.GAME_STATE_START_SCENE);\n}","function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }","endGame(){\n score.addToScore(this.result, 'somejsontoken');\n this.scene.pause();\n const sceneEnd = this.scene.get('end');\n sceneEnd.scene.start();\n //this.scene.add(\"end\", new End(this.result));\n }","function end() {\n gameScene.visible = false;\n gameOverScene.visible = true;\n}","function end() {\n gameScene.visible = false;\n gameOverScene.visible = true;\n}","function endScreen() {\n // set variable for final score\n var finalScore = score + internalScore;\n\n // change reset variable to prevent reset. game is done...\n resetWhere = 6;\n console.log('spelet är slut');\n var gameArea = document.getElementById('gameArea');\n gameArea.innerHTML = '

                    Resultat

                    ';\n gameArea.innerHTML += '

                    Du fick totalt ' + finalScore + ' poäng av 25 möjliga

                    ';\n gameArea.innerHTML += '

                    Hur pass bra resultat fick du?

                    ';\n gameArea.innerHTML += '
                    • Under 8 poäng: Njaaaa....
                    • 8 - 16 poäng: Nu börjar det likna något.
                    • 16 - 22 poäng: Sådär ja!
                    • 22 - 25 poäng: Heter du Einstein i efternamn?
                    ';\n gameArea.innerHTML += '';\n\n document.getElementById('moveOn').addEventListener('click', function() {\n window.location.reload();\n });\n\n }","function endGame() {\n resetMainContainer();\n loadTemplate(\"result\", displayResults);\n}","function lightningEnd(){\n currentScene = \"congrats\"\n }","function end () {\n //the page goes white\n $('body').css({\n backgroundColor: 'white',\n });\n $('#canvas').css({\n visibility: 'hidden',\n });\n\n //the final package downloads\n window.open('https://whogotnibs.github.io/dart450/assignment02/downloads/package03.zip', '_blank');\n\n //the game functions stop running\n end = true;\n\n //the music stops\n Gibber.clear();\n}","function loadEnd() {\n quizPage.style.display = \"none\";\n endPage.style.display = \"block\";\n clearInterval(timeInterval);\n}","function endPage() {\n next.classList.add(\"hide\");\n quizMain.classList.add(\"hide\");\n endSection.classList.remove(\"hide\");\n start.classList.remove(\"hide\");\n start.innerHTML = \"Restart\";\n score.innerHTML = \"You got \" + scoreNum + \" questions correct\";\n clearInterval(timeInterval);\n}","function endQuiz() {\n quizPage.hidden = true;\n finalPage.hidden = false;\n quizTimer.hidden = true;\n}","function handleFinalPage() {\r\n $(`main`).on(`click`, `#restart`, function () {\r\n store.quizStarted = false;\r\n store.questionNumber = 0;\r\n store.score = 0;\r\n render();\r\n });\r\n}","function end() {\n menuScene.visible = false;\n musicPacmanBeginning.stop();\n soundPacmanIntermission.stop();\n// gameSceneLevel2.visible = false;\n gameSceneLevel1.visible = false;\n gameOverScene.visible = true;\n}","function checkForEnd() {\n\t\tsetTimeout(function () {\n\t\t\t$(\"#content\").fadeOut(500, function () {\n\n\t\t\t\twindow.location = \"scene_pig3story.html\";\n\t\t\t});\n\t\t}, 2400);\n\t\tsetTimeout(function () {\n\t\t\t$(\"body\").removeClass(\"blackFade\");\n\t\t}, 1900);\n\t}","function endGame() {\n location.reload();\n}","function endGame() {\n // Réinitialisation de l'affichage du dé\n resetImage(); \n // Position du sélecteur\n selector();\n //Lancement nouvelle partie\n newGame();\n}","end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }","function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}","function showNextScene() {\n // clear screen\n ((sceneCount + sceneIndex) + 0.5) % sceneCount\n}","function endGame() {\n location.href = \"index.html\";\n}","function returnToMain(){\n teleMode = false;\n console.log('reutrn to main');\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('startScreen');\n }, this);\n}","function endGame(){\n // Make the correct scenes visible\n titleScene.visible = false;\n gameScene.visible = false;\n gameOverScene.visible = true;\n // Set the background\n renderer.backgroundColor = GAME_OVER_BACKGROUND_COLOR;\n // Use white audio icons\n audioHelper.whiteIcons();\n // Add the game over message to the end scene\n gameOverMessage = new PIXI.Text(\n \"GAME OVER!\",\n {fontFamily: GAME_FONT, fontSize: 60, fill: 0xEA212E}\n );\n gameOverMessage.position.set(GAME_WIDTH/2-gameOverMessage.width/2, GAME_HEIGHT/2-gameOverMessage.height);\n gameOverScene.addChild(gameOverMessage);\n // Create a score ScoreSubmitter\n scoreSubmitter = new ScoreSubmitter();\n // Bind the end-game keys\n bindEndKeys();\n // Stop the timer and set to end\n gameTimer.stop();\n gameTimer.whiteText();\n scoreKeeper.whiteText();\n gameState = end;\n}","function endOfGame() {\n var reset = document.getElementById(\"newGame\");\n reset.addEventListener(\"click\", function() {\n window.location.reload();\n });\n}","endGame() {\n this.state = \"endOfGame\";\n\n var resetButton = $(\"\");\n\n resetButton.on(\"click\", function() {\n // Empty all game zones of any remaining content\n $(\"#characterSelect\").empty();\n $(\"#opponentSelect\").empty();\n $(\"#battleZone\").empty();\n $(\"#combatLog\").empty();\n\n // Recreate character cards and set game to character selection\n game.setupCharCards();\n game.state = \"charSelect\";\n\n // Remove reset button\n $(this).remove();\n\n });\n\n resetButton.insertAfter($(\"#atkBtn\"));\n }","function finalScore() {\n $('.start-container').html(finalPage());\n $('.restartButton').on('click', function (event) {\n event.preventDefault();\n STORE.score = 0;\n $('.score').html('0 / 7');\n STORE.questionNumber = 0;\n $('.questionNumber').html('0 / 7');\n startPage();\n });\n\n}","function endGame(){\n\tspawnBall();\n\tcenterBall();\n\tspawnPlayerOne();\n\tspawnPlayerTwo();\n\tupdateScore();\n\t$('#menuCanvas').show();\n}","function exitGame(){\n selectModalButton($('#exit'));\n window.location.assign(\"../start.html\");\n }","function scene4() {\n animateBottle(0);\n\n // window.removeEventListener(\"click\", scene3);\n $(\"#btn\").off(\"click\");\n tl = new TimelineLite();\n tl.to($(\"#grass\"), 1, { autoAlpha: 1 })\n .to($(\"#coral\"), 1, {\n autoAlpha: 1,\n delay: 0\n })\n .to($(\"#d-2\"), 1, { autoAlpha: 1 })\n .to($(\"#d-2\"), 1, { autoAlpha: 0 })\n .to($(\"#d-4\"), 1, { autoAlpha: 1 });\n\n localStorage.setItem(\"currentScene\", 4);\n console.log(\"Scene 4 starting\");\n\n $(\"#btn\").on(\"click\", function() {\n tl.to($(\"#d-4\"), 1, { autoAlpha: 0 });\n tl.to($(\"#coral\"), 0.3, { autoAlpha: 0 });\n scene5();\n });\n\n $(\"#read-more\").on(\"click\", function() {\n tl.pause();\n });\n $(\"#back\").on(\"click\", function() {\n tl.play(scene5());\n });\n}","function LoadNextScene()\n{\n\t// This special Unity function loads the scene with the exact name that you send it - as long as the scene is in the project's build settings!\n\t// If you have trouble with this, double check the name, spelling, case and build settings\n\tApplication.LoadLevel(\"End-scene\");\n}","function endScreen() {\n leaderboardScreen.style.display = 'none';\n homeScreen.style.display = 'none';\n endQuiz.style.display = 'flex';\n quizPrompts.style.display = 'none';\n timer.style.visibility = 'hidden';\n\n yourScore()\n}","function backButtonClicked(event) {\n stage.removeChild(game);\n game.removeAllChildren();\n game.removeAllEventListeners();\n currentState = constants.MENU_STATE;\n changeState(currentState);\n }","function finishGame() {\n $('#startGame').removeClass('hidden');\n $('#startButton').addClass('btn-danger');\n $('#answers').addClass('hidden');\n $('#titleDiv').addClass('hidden');\n $('#imageDiv').addClass('hidden');\n $('#answers').addClass('hidden');\n $('#startButton').text('Play again?');\n $('#startButton').attr('onclick', 'location.reload()');\n}","function shutdown () {\n // Volvemos a crear el boton de start y lo llevamos al frente\n startButton = game.add.button(game.width / 2, 300, 'startButton', startClick, this);\n startButton.anchor.setTo(0.5, 0.5);\n // Ponemos imagen Game Over\n this.add.sprite(50, 200, 'gameOver');\n}","function endGame() {\n window.location.href = \"scores.html\"\n\n}","function navigateToScoreOverview(){\n ApplicationEnded=true;\n gotoScoreOverview();\n}","function sceneBack() {\n\t// if can pop scene\n\tif ( App.sceneStack.length > 1 ){\n\t\tvar scene = App.popScene();\n\t\ttransitionScene( App.scene, scene, 1 );\n\t// otherwise quit\n\t} else {\n\t\tquit();\n\t}\n}","function endGame() {\n //hide words\n $(\".fiveWords\").hide();\n //rid of opacity for start game button\n document.getElementById(\"startGameButton\").style.opacity = 1;\n //enable start button\n startButton.disabled = false;\n //make button opaque for end game\n document.getElementById(\"endGameButton\").style.opacity = .4;\n //disable the end button\n endButton.disabled = true;\n //get time score\n userScore = time;\n \n //change value of game over -- alec\n gameOver = true;\n \n //document.getElementById(\"myAnimation1\").innerHTML = userScore.toString();\n \n //stop the timer\n clearInterval(timer);\n \n window.location.replace('https://typegamertype.000webhostapp.com//highscore.php?score=' + userScore);\n}","function endGame() {\n\n partidas++;\n tiempoJugadores();\n\n //Si se termina la segunda ronda va al estado ranking\n if (partidas == 2)\n game.state.start('ranking', true, false, tj1, tj2);\n\n //Si termina la primera ronda, va al estado win\n else\n game.state.start('win', true, false);\n\n}","moveToNextScene()\n {\n\n if(seconds2 < 0)\n {\n this.add.text(240, 345, 'Survived green and red bug\\n Click to meet yellow bug', { fontSize: '18px', fill: '#000000' })\n this.input.on(\"pointerup\", () => {\n this.scene.stop(\"GameScene\");\n this.scene.start('YellowBugScene');\n });\n //reset time\n seconds = 1;\n seconds2 = 1;\n }\n }","function showEnd() {\n console.log(\"showEnd ran\");\n getResult();\n $(\"#topright\").hide();\n $(\"#gamecontents\").hide();\n $(\"#end\").show();\n }","function end_game_flow () {\n\t// console.log(\"end...\");\n\t// block all the event to gems\n\tthis.backgroundView.updateOpts({\n\t\tblockEvents: true\n\t});\n\t// disable scoreboard\n\tthis._scoreboard.updateOpts({\n\t\tvisible: false\n\t});\n\t// show end screen\n\tthis._endheader.updateOpts({\n\t\tvisible: true,\n\t\tcanHandleEvents: true\n\t});\n\tanimate(this._endheader).wait(800).then({y: 0}, 100, animate.easeIn).then({y: 35}, 1000, animate.easeIn);\n\n\t// show score\n\tvar scoreText = new TextView({\n\t\tsuperview: this._endheader,\n\t\tx: 0,\n\t\ty: 35, // endscreen animate end point\n\t\twidth: 350,\n\t\theight: 233,\n\t\tautoSize: true,\n\t\ttext: \"You achieved \" + score.toString(),\n\t\tsize: 38,\n\t\tverticalAlign: 'middle',\n\t\thorizontalAlign: 'center',\n\t\tcanHandleEvents: false\n\t});\n\t// //slight delay before allowing a tap reset\n\tsetTimeout(emit_endgame_event.bind(this), 2000);\n\tconsole.log('end game flow.. \\n');\n}","function endGame() {\n gameStarted = false;\n background('Black');\n fill(255)\n text(\"GAME OVER\", width / 2, height /2);\n cursor();\n \n tryAgainButton = createButton(\"Try Again?\");\n tryAgainButton.position(width / 2 - ((width / 4) / 2), height * 0.7);\n tryAgainButton.size(width /4, height / 8);\n tryAgainButton.mousePressed(tryAgain);\n \n}","function backClicked(event) {\n stage.removeChild(game);\n game.removeAllChildren();\n game.removeAllEventListeners();\n constants.engineSound.stop();\n currentState = constants.MENU_STATE;\n changeState(currentState);\n }","function actionOnClickBack() {\n\t\t\t//alert('Saldras de la carrera');\n\t\t\tgame.state.start('mainMenuState')\n\t\t}","finish(){\n model.stat.timer.stop();\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\n\t\tdocument.getElementById('nextBtn').disabled=true;\n\t\tdocument.getElementById('autoRunBtn').disabled=true;\n }","function handleEndQuiz() {\n $('main').on('click', '.js-end-button', (event) => {\n store.score = 0;\n store.questionNumber = 0;\n store.quizStarted = false;\n renderQuizScreen();\n });\n}","function endQuiz(){\n clearInterval(timerInterval);\n document.querySelector('.endPage').style.display = \"block\";\n document.getElementById('quiz').style.display = \"none\";\n \n }","function finish () {\n $(\".game\").html(\"\");\n $(\"#choices\").html(\"\");\n $(\"#wins\").text(\"Correct: \" + wins);\n $(\"#losses\").text(\"Incorrect: \" + losses);\n restart();\n }","function scene5() {\n animateBottle(0);\n\n // window.removeEventListener(\"click\", scene3);\n $(\"#btn\").off(\"click\");\n tl = new TimelineLite();\n tl.to($(\"#dirt\"), 1, { autoAlpha: 1 })\n .to($(\".help-1\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-1\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-2\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-2\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-3\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-3\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-4\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-4\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-5\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-5\"), 0, { autoAlpha: 0, ease: Bounce.easeOut });\n\n localStorage.setItem(\"currentScene\", 5);\n console.log(\"Scene 5 starting\");\n}","goToScene(){\n this.return = false;\n this.nameArea.text = \"\";\n }","function endGame(){\r\n youWonGif();\r\n document.getElementById(\"canvas\").style.display = \"none\";\r\n document.getElementById(\"level\").style.display = \"none\";\r\n document.getElementById(\"scorePoint\").style.display = \"none\";\r\n document.getElementById(\"scoreCat1\").style.display = \"none\";\r\n document.getElementById(\"endScorePoint\").style.display = \"block\";\r\n document.getElementById(\"startbtn\").style.display = \"none\";\r\n document.getElementById(\"newbtn\").style.display = \"block\";\r\n document.getElementById(\"intro\").style.display = \"none\";\r\n document.getElementById(\"endGame\").style.display = \"block\";\r\n \r\n}","function onNextClick() {\n\n\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('startScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\n}","function handleStartOver() {\n $('body').on('click', '#restart-button', (e) => {\n \n store.view = 'landing';\n store.questionNumber = 0;\n store.score = 0;\n render()\n })\n\n}","function endQuiz() {\n\n // clear page\n clearPage();\n\n // replace start button\n $(\"#start-button\").append(\"\");\n\n // show user how they did\n quizQuestion.append(\"
                    Correct Guesses: \" + correctGuesses + \"
                    \");\n quizQuestion.append(\"
                    Incorrect Guesses: \" + (questions.length - correctGuesses) + \"
                    \");\n\n }","function redoScene() {\n drawBox(guiParams.mode);\n TW.render();\n}","function endWizardPlanes () {\n\t\t\t$('.wizardPlanes-pasos:not(.pasoFinal)').slideUp();\n\t\t\t$('.wizardPlanes-pasos.wizard-pasoFinal').slideDown();\n\t\t\t$('header h3.ta-center').html('El plan más conveniente para ti es');\n\t\t\t$('header h4').remove();\n\t\t\t$('html, body').animate({scrollTop: $('header h3').offset().top}, 500);\n\t\t}","function gameRestartFragment()\n{\n\ttextSize(100);\n\ttext(\"GAMEOVER\", width/2, height/2);\n\ttextAlign(CENTER, CENTER);\n\n\t//resetBtn = createButton('RESET');\n \t//resetBtn.position(width/2 - 70, height/2 + 100);\n \t//resetBtn.mousePressed(mousePressed);\n}","function endGame(){\n $('.card-container').removeClass(\"selected-card\");\n $('.card-container').remove();\n while(model.getCardObjArr().length > 0){\n model.removeFromCardObjArr(0);\n }\n\n while(model.getDisplayedCardArr().length > 0){\n model.removeFromDisplayedCardArr(0)\n }\n\n while(model.getSelectedCardObjArr().length > 0){\n model.removeFromSelectedCardArr(0)\n }\n if(($(\".card-display-container\").find(\".game-over-page\").length) === 0){\n createGameOverPage();\n createWinnerPage();\n } else {\n return;\n }\n }","function endgame() {\n $(\"flee-btn\").classList.add(\"hidden\");\n $(\"endgame\").classList.add(\"hidden\");\n $(\"their-card\").classList.add(\"hidden\");\n $(\"pokedex-view\").classList.remove(\"hidden\");\n qs(\"#my-card .buffs\").classList.add(\"hidden\");\n qs(\"#my-card .health-bar\").style.width = \"100%\";\n qs(\"#my-card .hp\").innerHTML = pokeHP + \"HP\";\n $(\"results-container\").classList.add(\"hidden\");\n $(\"p1-turn-results\").classList.add(\"hidden\");\n $(\"title\").innerHTML = \"Your Pokedex\";\n $(\"start-btn\").classList.remove(\"hidden\");\n }","end() {\n this.endZoomInMode();\n this.endHandMode();\n }","function endGame() {\n // Overlay\n // Show score\n // Show table \n // Give user chance to restart\n // TODO: add high score to renderGUI\n\n uploadScore(score);\n score = 0;\n}","function endGame() {\n var unansewerPoint = questions.length - currentQuestionNumber + skipQuestionPoint;\n $('.btn-group-vertical').empty();\n stop();\n //when time out, show the number of correct guesses, wrong guesses, unansewer and show start over button\n $('#currQuestion').html('You have ' + correctPoint + ' correct scorrect point!
                    You have ' + incorrectPoint + ' incorrect scorrect point!
                    You have ' + unansewerPoint + ' unansewer!
                    ');\n // Start over, do not reload the page, just reset the game\n var restbtn = $('';\\n\\n document.getElementById('moveOn').addEventListener('click', function() {\\n window.location.reload();\\n });\\n\\n }\",\n \"function endGame() {\\n resetMainContainer();\\n loadTemplate(\\\"result\\\", displayResults);\\n}\",\n \"function lightningEnd(){\\n currentScene = \\\"congrats\\\"\\n }\",\n \"function end () {\\n //the page goes white\\n $('body').css({\\n backgroundColor: 'white',\\n });\\n $('#canvas').css({\\n visibility: 'hidden',\\n });\\n\\n //the final package downloads\\n window.open('https://whogotnibs.github.io/dart450/assignment02/downloads/package03.zip', '_blank');\\n\\n //the game functions stop running\\n end = true;\\n\\n //the music stops\\n Gibber.clear();\\n}\",\n \"function loadEnd() {\\n quizPage.style.display = \\\"none\\\";\\n endPage.style.display = \\\"block\\\";\\n clearInterval(timeInterval);\\n}\",\n \"function endPage() {\\n next.classList.add(\\\"hide\\\");\\n quizMain.classList.add(\\\"hide\\\");\\n endSection.classList.remove(\\\"hide\\\");\\n start.classList.remove(\\\"hide\\\");\\n start.innerHTML = \\\"Restart\\\";\\n score.innerHTML = \\\"You got \\\" + scoreNum + \\\" questions correct\\\";\\n clearInterval(timeInterval);\\n}\",\n \"function endQuiz() {\\n quizPage.hidden = true;\\n finalPage.hidden = false;\\n quizTimer.hidden = true;\\n}\",\n \"function handleFinalPage() {\\r\\n $(`main`).on(`click`, `#restart`, function () {\\r\\n store.quizStarted = false;\\r\\n store.questionNumber = 0;\\r\\n store.score = 0;\\r\\n render();\\r\\n });\\r\\n}\",\n \"function end() {\\n menuScene.visible = false;\\n musicPacmanBeginning.stop();\\n soundPacmanIntermission.stop();\\n// gameSceneLevel2.visible = false;\\n gameSceneLevel1.visible = false;\\n gameOverScene.visible = true;\\n}\",\n \"function checkForEnd() {\\n\\t\\tsetTimeout(function () {\\n\\t\\t\\t$(\\\"#content\\\").fadeOut(500, function () {\\n\\n\\t\\t\\t\\twindow.location = \\\"scene_pig3story.html\\\";\\n\\t\\t\\t});\\n\\t\\t}, 2400);\\n\\t\\tsetTimeout(function () {\\n\\t\\t\\t$(\\\"body\\\").removeClass(\\\"blackFade\\\");\\n\\t\\t}, 1900);\\n\\t}\",\n \"function endGame() {\\n location.reload();\\n}\",\n \"function endGame() {\\n // Réinitialisation de l'affichage du dé\\n resetImage(); \\n // Position du sélecteur\\n selector();\\n //Lancement nouvelle partie\\n newGame();\\n}\",\n \"end(){\\n this.request({\\\"component\\\":this.component,\\\"method\\\":\\\"end\\\",\\\"args\\\":[\\\"\\\"]})\\n this.running = false\\n }\",\n \"function endOfGame() {\\n\\tcreatesMensg();\\n\\tstopTime();\\n\\tshowModal();\\n}\",\n \"function showNextScene() {\\n // clear screen\\n ((sceneCount + sceneIndex) + 0.5) % sceneCount\\n}\",\n \"function endGame() {\\n location.href = \\\"index.html\\\";\\n}\",\n \"function returnToMain(){\\n teleMode = false;\\n console.log('reutrn to main');\\n fadeAll();\\n game.time.events.add(500, function() {\\n game.state.start('startScreen');\\n }, this);\\n}\",\n \"function endGame(){\\n // Make the correct scenes visible\\n titleScene.visible = false;\\n gameScene.visible = false;\\n gameOverScene.visible = true;\\n // Set the background\\n renderer.backgroundColor = GAME_OVER_BACKGROUND_COLOR;\\n // Use white audio icons\\n audioHelper.whiteIcons();\\n // Add the game over message to the end scene\\n gameOverMessage = new PIXI.Text(\\n \\\"GAME OVER!\\\",\\n {fontFamily: GAME_FONT, fontSize: 60, fill: 0xEA212E}\\n );\\n gameOverMessage.position.set(GAME_WIDTH/2-gameOverMessage.width/2, GAME_HEIGHT/2-gameOverMessage.height);\\n gameOverScene.addChild(gameOverMessage);\\n // Create a score ScoreSubmitter\\n scoreSubmitter = new ScoreSubmitter();\\n // Bind the end-game keys\\n bindEndKeys();\\n // Stop the timer and set to end\\n gameTimer.stop();\\n gameTimer.whiteText();\\n scoreKeeper.whiteText();\\n gameState = end;\\n}\",\n \"function endOfGame() {\\n var reset = document.getElementById(\\\"newGame\\\");\\n reset.addEventListener(\\\"click\\\", function() {\\n window.location.reload();\\n });\\n}\",\n \"endGame() {\\n this.state = \\\"endOfGame\\\";\\n\\n var resetButton = $(\\\"\\\");\\n\\n resetButton.on(\\\"click\\\", function() {\\n // Empty all game zones of any remaining content\\n $(\\\"#characterSelect\\\").empty();\\n $(\\\"#opponentSelect\\\").empty();\\n $(\\\"#battleZone\\\").empty();\\n $(\\\"#combatLog\\\").empty();\\n\\n // Recreate character cards and set game to character selection\\n game.setupCharCards();\\n game.state = \\\"charSelect\\\";\\n\\n // Remove reset button\\n $(this).remove();\\n\\n });\\n\\n resetButton.insertAfter($(\\\"#atkBtn\\\"));\\n }\",\n \"function finalScore() {\\n $('.start-container').html(finalPage());\\n $('.restartButton').on('click', function (event) {\\n event.preventDefault();\\n STORE.score = 0;\\n $('.score').html('0 / 7');\\n STORE.questionNumber = 0;\\n $('.questionNumber').html('0 / 7');\\n startPage();\\n });\\n\\n}\",\n \"function endGame(){\\n\\tspawnBall();\\n\\tcenterBall();\\n\\tspawnPlayerOne();\\n\\tspawnPlayerTwo();\\n\\tupdateScore();\\n\\t$('#menuCanvas').show();\\n}\",\n \"function exitGame(){\\n selectModalButton($('#exit'));\\n window.location.assign(\\\"../start.html\\\");\\n }\",\n \"function scene4() {\\n animateBottle(0);\\n\\n // window.removeEventListener(\\\"click\\\", scene3);\\n $(\\\"#btn\\\").off(\\\"click\\\");\\n tl = new TimelineLite();\\n tl.to($(\\\"#grass\\\"), 1, { autoAlpha: 1 })\\n .to($(\\\"#coral\\\"), 1, {\\n autoAlpha: 1,\\n delay: 0\\n })\\n .to($(\\\"#d-2\\\"), 1, { autoAlpha: 1 })\\n .to($(\\\"#d-2\\\"), 1, { autoAlpha: 0 })\\n .to($(\\\"#d-4\\\"), 1, { autoAlpha: 1 });\\n\\n localStorage.setItem(\\\"currentScene\\\", 4);\\n console.log(\\\"Scene 4 starting\\\");\\n\\n $(\\\"#btn\\\").on(\\\"click\\\", function() {\\n tl.to($(\\\"#d-4\\\"), 1, { autoAlpha: 0 });\\n tl.to($(\\\"#coral\\\"), 0.3, { autoAlpha: 0 });\\n scene5();\\n });\\n\\n $(\\\"#read-more\\\").on(\\\"click\\\", function() {\\n tl.pause();\\n });\\n $(\\\"#back\\\").on(\\\"click\\\", function() {\\n tl.play(scene5());\\n });\\n}\",\n \"function LoadNextScene()\\n{\\n\\t// This special Unity function loads the scene with the exact name that you send it - as long as the scene is in the project's build settings!\\n\\t// If you have trouble with this, double check the name, spelling, case and build settings\\n\\tApplication.LoadLevel(\\\"End-scene\\\");\\n}\",\n \"function endScreen() {\\n leaderboardScreen.style.display = 'none';\\n homeScreen.style.display = 'none';\\n endQuiz.style.display = 'flex';\\n quizPrompts.style.display = 'none';\\n timer.style.visibility = 'hidden';\\n\\n yourScore()\\n}\",\n \"function backButtonClicked(event) {\\n stage.removeChild(game);\\n game.removeAllChildren();\\n game.removeAllEventListeners();\\n currentState = constants.MENU_STATE;\\n changeState(currentState);\\n }\",\n \"function finishGame() {\\n $('#startGame').removeClass('hidden');\\n $('#startButton').addClass('btn-danger');\\n $('#answers').addClass('hidden');\\n $('#titleDiv').addClass('hidden');\\n $('#imageDiv').addClass('hidden');\\n $('#answers').addClass('hidden');\\n $('#startButton').text('Play again?');\\n $('#startButton').attr('onclick', 'location.reload()');\\n}\",\n \"function shutdown () {\\n // Volvemos a crear el boton de start y lo llevamos al frente\\n startButton = game.add.button(game.width / 2, 300, 'startButton', startClick, this);\\n startButton.anchor.setTo(0.5, 0.5);\\n // Ponemos imagen Game Over\\n this.add.sprite(50, 200, 'gameOver');\\n}\",\n \"function endGame() {\\n window.location.href = \\\"scores.html\\\"\\n\\n}\",\n \"function navigateToScoreOverview(){\\n ApplicationEnded=true;\\n gotoScoreOverview();\\n}\",\n \"function sceneBack() {\\n\\t// if can pop scene\\n\\tif ( App.sceneStack.length > 1 ){\\n\\t\\tvar scene = App.popScene();\\n\\t\\ttransitionScene( App.scene, scene, 1 );\\n\\t// otherwise quit\\n\\t} else {\\n\\t\\tquit();\\n\\t}\\n}\",\n \"function endGame() {\\n //hide words\\n $(\\\".fiveWords\\\").hide();\\n //rid of opacity for start game button\\n document.getElementById(\\\"startGameButton\\\").style.opacity = 1;\\n //enable start button\\n startButton.disabled = false;\\n //make button opaque for end game\\n document.getElementById(\\\"endGameButton\\\").style.opacity = .4;\\n //disable the end button\\n endButton.disabled = true;\\n //get time score\\n userScore = time;\\n \\n //change value of game over -- alec\\n gameOver = true;\\n \\n //document.getElementById(\\\"myAnimation1\\\").innerHTML = userScore.toString();\\n \\n //stop the timer\\n clearInterval(timer);\\n \\n window.location.replace('https://typegamertype.000webhostapp.com//highscore.php?score=' + userScore);\\n}\",\n \"function endGame() {\\n\\n partidas++;\\n tiempoJugadores();\\n\\n //Si se termina la segunda ronda va al estado ranking\\n if (partidas == 2)\\n game.state.start('ranking', true, false, tj1, tj2);\\n\\n //Si termina la primera ronda, va al estado win\\n else\\n game.state.start('win', true, false);\\n\\n}\",\n \"moveToNextScene()\\n {\\n\\n if(seconds2 < 0)\\n {\\n this.add.text(240, 345, 'Survived green and red bug\\\\n Click to meet yellow bug', { fontSize: '18px', fill: '#000000' })\\n this.input.on(\\\"pointerup\\\", () => {\\n this.scene.stop(\\\"GameScene\\\");\\n this.scene.start('YellowBugScene');\\n });\\n //reset time\\n seconds = 1;\\n seconds2 = 1;\\n }\\n }\",\n \"function showEnd() {\\n console.log(\\\"showEnd ran\\\");\\n getResult();\\n $(\\\"#topright\\\").hide();\\n $(\\\"#gamecontents\\\").hide();\\n $(\\\"#end\\\").show();\\n }\",\n \"function end_game_flow () {\\n\\t// console.log(\\\"end...\\\");\\n\\t// block all the event to gems\\n\\tthis.backgroundView.updateOpts({\\n\\t\\tblockEvents: true\\n\\t});\\n\\t// disable scoreboard\\n\\tthis._scoreboard.updateOpts({\\n\\t\\tvisible: false\\n\\t});\\n\\t// show end screen\\n\\tthis._endheader.updateOpts({\\n\\t\\tvisible: true,\\n\\t\\tcanHandleEvents: true\\n\\t});\\n\\tanimate(this._endheader).wait(800).then({y: 0}, 100, animate.easeIn).then({y: 35}, 1000, animate.easeIn);\\n\\n\\t// show score\\n\\tvar scoreText = new TextView({\\n\\t\\tsuperview: this._endheader,\\n\\t\\tx: 0,\\n\\t\\ty: 35, // endscreen animate end point\\n\\t\\twidth: 350,\\n\\t\\theight: 233,\\n\\t\\tautoSize: true,\\n\\t\\ttext: \\\"You achieved \\\" + score.toString(),\\n\\t\\tsize: 38,\\n\\t\\tverticalAlign: 'middle',\\n\\t\\thorizontalAlign: 'center',\\n\\t\\tcanHandleEvents: false\\n\\t});\\n\\t// //slight delay before allowing a tap reset\\n\\tsetTimeout(emit_endgame_event.bind(this), 2000);\\n\\tconsole.log('end game flow.. \\\\n');\\n}\",\n \"function endGame() {\\n gameStarted = false;\\n background('Black');\\n fill(255)\\n text(\\\"GAME OVER\\\", width / 2, height /2);\\n cursor();\\n \\n tryAgainButton = createButton(\\\"Try Again?\\\");\\n tryAgainButton.position(width / 2 - ((width / 4) / 2), height * 0.7);\\n tryAgainButton.size(width /4, height / 8);\\n tryAgainButton.mousePressed(tryAgain);\\n \\n}\",\n \"function backClicked(event) {\\n stage.removeChild(game);\\n game.removeAllChildren();\\n game.removeAllEventListeners();\\n constants.engineSound.stop();\\n currentState = constants.MENU_STATE;\\n changeState(currentState);\\n }\",\n \"function actionOnClickBack() {\\n\\t\\t\\t//alert('Saldras de la carrera');\\n\\t\\t\\tgame.state.start('mainMenuState')\\n\\t\\t}\",\n \"finish(){\\n model.stat.timer.stop();\\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\\n\\t\\tdocument.getElementById('nextBtn').disabled=true;\\n\\t\\tdocument.getElementById('autoRunBtn').disabled=true;\\n }\",\n \"function handleEndQuiz() {\\n $('main').on('click', '.js-end-button', (event) => {\\n store.score = 0;\\n store.questionNumber = 0;\\n store.quizStarted = false;\\n renderQuizScreen();\\n });\\n}\",\n \"function endQuiz(){\\n clearInterval(timerInterval);\\n document.querySelector('.endPage').style.display = \\\"block\\\";\\n document.getElementById('quiz').style.display = \\\"none\\\";\\n \\n }\",\n \"function finish () {\\n $(\\\".game\\\").html(\\\"\\\");\\n $(\\\"#choices\\\").html(\\\"\\\");\\n $(\\\"#wins\\\").text(\\\"Correct: \\\" + wins);\\n $(\\\"#losses\\\").text(\\\"Incorrect: \\\" + losses);\\n restart();\\n }\",\n \"function scene5() {\\n animateBottle(0);\\n\\n // window.removeEventListener(\\\"click\\\", scene3);\\n $(\\\"#btn\\\").off(\\\"click\\\");\\n tl = new TimelineLite();\\n tl.to($(\\\"#dirt\\\"), 1, { autoAlpha: 1 })\\n .to($(\\\".help-1\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-1\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-2\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-2\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-3\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-3\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-4\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-4\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-5\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-5\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut });\\n\\n localStorage.setItem(\\\"currentScene\\\", 5);\\n console.log(\\\"Scene 5 starting\\\");\\n}\",\n \"goToScene(){\\n this.return = false;\\n this.nameArea.text = \\\"\\\";\\n }\",\n \"function endGame(){\\r\\n youWonGif();\\r\\n document.getElementById(\\\"canvas\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"level\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"scorePoint\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"scoreCat1\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"endScorePoint\\\").style.display = \\\"block\\\";\\r\\n document.getElementById(\\\"startbtn\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"newbtn\\\").style.display = \\\"block\\\";\\r\\n document.getElementById(\\\"intro\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"endGame\\\").style.display = \\\"block\\\";\\r\\n \\r\\n}\",\n \"function onNextClick() {\\n\\n\\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('startScreen');\\n\\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeScreen');\\n\\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\\n}\",\n \"function handleStartOver() {\\n $('body').on('click', '#restart-button', (e) => {\\n \\n store.view = 'landing';\\n store.questionNumber = 0;\\n store.score = 0;\\n render()\\n })\\n\\n}\",\n \"function endQuiz() {\\n\\n // clear page\\n clearPage();\\n\\n // replace start button\\n $(\\\"#start-button\\\").append(\\\"\\\");\\n\\n // show user how they did\\n quizQuestion.append(\\\"
                    Correct Guesses: \\\" + correctGuesses + \\\"
                    \\\");\\n quizQuestion.append(\\\"
                    Incorrect Guesses: \\\" + (questions.length - correctGuesses) + \\\"
                    \\\");\\n\\n }\",\n \"function redoScene() {\\n drawBox(guiParams.mode);\\n TW.render();\\n}\",\n \"function endWizardPlanes () {\\n\\t\\t\\t$('.wizardPlanes-pasos:not(.pasoFinal)').slideUp();\\n\\t\\t\\t$('.wizardPlanes-pasos.wizard-pasoFinal').slideDown();\\n\\t\\t\\t$('header h3.ta-center').html('El plan más conveniente para ti es');\\n\\t\\t\\t$('header h4').remove();\\n\\t\\t\\t$('html, body').animate({scrollTop: $('header h3').offset().top}, 500);\\n\\t\\t}\",\n \"function gameRestartFragment()\\n{\\n\\ttextSize(100);\\n\\ttext(\\\"GAMEOVER\\\", width/2, height/2);\\n\\ttextAlign(CENTER, CENTER);\\n\\n\\t//resetBtn = createButton('RESET');\\n \\t//resetBtn.position(width/2 - 70, height/2 + 100);\\n \\t//resetBtn.mousePressed(mousePressed);\\n}\",\n \"function endGame(){\\n $('.card-container').removeClass(\\\"selected-card\\\");\\n $('.card-container').remove();\\n while(model.getCardObjArr().length > 0){\\n model.removeFromCardObjArr(0);\\n }\\n\\n while(model.getDisplayedCardArr().length > 0){\\n model.removeFromDisplayedCardArr(0)\\n }\\n\\n while(model.getSelectedCardObjArr().length > 0){\\n model.removeFromSelectedCardArr(0)\\n }\\n if(($(\\\".card-display-container\\\").find(\\\".game-over-page\\\").length) === 0){\\n createGameOverPage();\\n createWinnerPage();\\n } else {\\n return;\\n }\\n }\",\n \"function endgame() {\\n $(\\\"flee-btn\\\").classList.add(\\\"hidden\\\");\\n $(\\\"endgame\\\").classList.add(\\\"hidden\\\");\\n $(\\\"their-card\\\").classList.add(\\\"hidden\\\");\\n $(\\\"pokedex-view\\\").classList.remove(\\\"hidden\\\");\\n qs(\\\"#my-card .buffs\\\").classList.add(\\\"hidden\\\");\\n qs(\\\"#my-card .health-bar\\\").style.width = \\\"100%\\\";\\n qs(\\\"#my-card .hp\\\").innerHTML = pokeHP + \\\"HP\\\";\\n $(\\\"results-container\\\").classList.add(\\\"hidden\\\");\\n $(\\\"p1-turn-results\\\").classList.add(\\\"hidden\\\");\\n $(\\\"title\\\").innerHTML = \\\"Your Pokedex\\\";\\n $(\\\"start-btn\\\").classList.remove(\\\"hidden\\\");\\n }\",\n \"end() {\\n this.endZoomInMode();\\n this.endHandMode();\\n }\",\n \"function endGame() {\\n // Overlay\\n // Show score\\n // Show table \\n // Give user chance to restart\\n // TODO: add high score to renderGUI\\n\\n uploadScore(score);\\n score = 0;\\n}\",\n \"function endGame() {\\n var unansewerPoint = questions.length - currentQuestionNumber + skipQuestionPoint;\\n $('.btn-group-vertical').empty();\\n stop();\\n //when time out, show the number of correct guesses, wrong guesses, unansewer and show start over button\\n $('#currQuestion').html('You have ' + correctPoint + ' correct scorrect point!
                    You have ' + incorrectPoint + ' incorrect scorrect point!
                    You have ' + unansewerPoint + ' unansewer!
                    ');\\n // Start over, do not reload the page, just reset the game\\n var restbtn = $('`\n\n // Append element to document\n document.getElementById('buttons').appendChild(div);\n })\n return features;\n });\n}","async function getData(){\r\n\r\n //Fetch the data from the geojson file\r\n fetch(\"BEWES_Building_Data.geojson\").then(response => response.json()).then(data => {addToTable(data);});\r\n\r\n }","getFeatures() {\n\t\tfetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.state.prop_ID}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tbody: null,\n\t\t\theaders: {\n\t\t\t\t\"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n\t\t\t}\n\t\t})\n\t\t\t.then(status)\n\t\t\t.then(json)\n\t\t\t.then(dataFromServer => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tfeatures: dataFromServer,\n\t\t\t\t});\n\t\t\t\tconsole.log(dataFromServer, 'features here')\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(error)\n\t\t\t\tmessage.error('Could not get the features. Try Again!', 5);\n\t\t\t});\n\t}","async function loadCoreData() {\n await Promise.all([\n loadExercises(),\n loadCategories(),\n loadSessions(),\n ]);\n}","function load() {\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\n .then(function(result) {\n console.log('load results')\n tree = result[0];\n dbIndex = new Index(result[1]);\n entries = result[2];\n });\n}","load() {\n return Promise.resolve(false /* identified */);\n }","async fetchDvFeatures() {\n await fetch(\n `${this.mapboxLayer.url}/data/ch.sbb.direktverbindungen.public.json?key=${this.mapboxLayer.apiKey}`,\n )\n .then((res) => res.json())\n .then((data) => {\n this.allFeatures = data['geops.direktverbindungen'].map((line) => {\n return new Feature({\n ...line,\n geometry: new LineString([\n [line.bbox[0], line.bbox[1]],\n [line.bbox[2], line.bbox[3]],\n ]),\n });\n });\n this.syncFeatures();\n })\n // eslint-disable-next-line no-console\n .catch((err) => console.error(err));\n }","async function load() { // returns a promise of an array\n const rawData = await fsp.readFile('./restaurant.json');\n const restaurantsArray = (JSON.parse(String(rawData)));\n return restaurantsArray;\n}","async loadLazy () {\n /**\n if(this.load && !this.loadComplete) {\n import('./lazy-element.js').then((LazyElement) => {\n this.loadComplete = true;\n console.log(\"LazyElement loaded\");\n }).catch((reason) => {\n console.log(\"LazyElement failed to load\", reason);\n });\n }\n */\n }","loadLevels() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const level_list = yield Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_2__[\"queryZones\"])({ tags: 'level', limit: 2500 })\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((i) => i.data))\n .toPromise();\n const levels = level_list.map((lvl) => new _level_class__WEBPACK_IMPORTED_MODULE_7__[\"BuildingLevel\"](lvl));\n levels.sort((a, b) => (a.name || '').localeCompare(b.name || ''));\n this.levels_subject.next(levels);\n });\n }","load() {\n return __awaiter(this, undefined, undefined, function* () {\n yield Promise.all([\n this._strings.load(),\n this._pedal.load(),\n this._keybed.load(),\n this._harmonics.load(),\n ]);\n this._loaded = true;\n });\n }","function loadAllRegimes() {\n //also get the available regimens here for later\n return conceptService.get(Bahmni.Common.Constants.arvRegimensConvSet).then(function (result) {\n vm.allRegimes = result.data;\n });\n }","async getFeaturesAtLocation(latLngHeight, providerCoords) {\n const pickPosition = this.scene.globe.ellipsoid.cartographicToCartesian(Cartographic.fromDegrees(latLngHeight.longitude, latLngHeight.latitude, latLngHeight.height));\n const pickPositionCartographic = Ellipsoid.WGS84.cartesianToCartographic(pickPosition);\n const promises = [];\n const imageryLayers = [];\n for (let i = this.scene.imageryLayers.length - 1; i >= 0; i--) {\n const imageryLayer = this.scene.imageryLayers.get(i);\n const imageryProvider = imageryLayer.imageryProvider;\n // @ts-ignore\n const imageryProviderUrl = imageryProvider.url;\n if (imageryProviderUrl && providerCoords[imageryProviderUrl]) {\n var tileCoords = providerCoords[imageryProviderUrl];\n const pickPromise = imageryProvider.pickFeatures(tileCoords.x, tileCoords.y, tileCoords.level, pickPositionCartographic.longitude, pickPositionCartographic.latitude);\n if (pickPromise) {\n promises.push(pickPromise);\n }\n imageryLayers.push(imageryLayer);\n }\n }\n const pickedFeatures = this._buildPickedFeatures(providerCoords, pickPosition, [], promises, imageryLayers, pickPositionCartographic.height, true);\n await pickedFeatures.allFeaturesAvailablePromise;\n return pickedFeatures.features;\n }","async function importFeatureSuggestions(p) {\n if (!confirm(\"Import feature suggestions?\\n(This adds a lot of data.)\")) return\n await loadCompendiumFeatureSuggestions()\n // console.log(\"compendiumFeatureSuggestionsTables\", compendiumFeatureSuggestionsTables)\n const nodeTable = compendiumFeatureSuggestionsTables[\"Node\"]\n importNodeTable(p, nodeTable)\n const viewNodeTable = compendiumFeatureSuggestionsTables[\"ViewNode\"]\n importViewNodeTable(p, viewNodeTable)\n const linkTable = compendiumFeatureSuggestionsTables[\"Link\"]\n importLinkTable(p, linkTable)\n const viewLinkTable = compendiumFeatureSuggestionsTables[\"ViewLink\"]\n importViewLinkTable(p, viewLinkTable)\n}","function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }","function got_features(bbox, features){\n console.log('got features')\n\n sort_features(features)\n\n features.forEach(function(feature){\n console.log(new Date(feature.attributes.acquisitionDate))\n })\n\n var dates = []\n for(var i = 1999; i <= 2013; i++){\n for(var j = 1; j <= 12; j++){\n dates.push(new Date( '' + j + '/01/' + i + ' GMT-0800 (PST)'))\n }\n }\n // dates.push(new Date('1/01/2014 GMT-0800 (PST)'))\n // dates.push(new Date('2/01/2014 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2010 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2011 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2012 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2013 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2014 GMT-0800 (PST)'))\n console.log(dates)\n\n dates.map(function(date){\n date = Number(date)\n console.log('features for date', new Date(date))\n var date_features = features_by_timestamp(date, features)\n date_features.sort(function(a, b){\n return a.attributes.acquisitionDate - b.attributes.acquisitionDate\n })\n var ids = date_features\n .map(function(feature){ return feature.attributes.OBJECTID })\n console.log('\\tfeatures:', date_features.map(function(f){ return JSON.stringify([new Date(f.attributes.acquisitionDate), f.attributes.OBJECTID]) }))\n return {\n // find all the closest ids by date without going over\n ids: ids\n , date: date\n , bbox: bbox\n }\n }).map(function(obj){\n save_image_from_date(obj, 'test-' + obj.date + '.jpg')\n })\n}","async load () {}","function og(){ci()(this,{$featuresCollection:{enumerable:!0,get:this.getFeaturesCollection}})}","async initializeDataLoad() {\n }","loadAgencies() {\n\t\tgetAgencies()\n\t\t\t.then((ans) => {\n\t\t\t\tvar fastAccess = {};\n\t\t\t\tfor(var i = 0; i < ans.length; i++) {\n\t\t\t\t\tlet ag = ans[i];\n\t\t\t\t\tfastAccess[ag.title] = ag.tag;\n\t\t\t\t}\n\n\t\t\t\tthis.setState({\n\t\t\t\t\tagencies: ans,\n\t\t\t\t\tfastAccess: fastAccess,\n\t\t\t\t})\n\t\t\t});\n\t}","function loadSmallTrail(evt) {\n var req = $.ajax({\n url: \"http://localhost:3000/w_pathnondistinct\",\n type: \"GET\",\n });\n req.done(function (resp_json) {\n console.log(JSON.stringify(resp_json));\n var listaFeat = jsonAnswerDataToListElements(resp_json);\n var linjedata = {\n \"type\": \"FeatureCollection\",\n \"features\": listaFeat\n };\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\n });\n}","function getTreeData() {\n\tnew Promise((resolve, reject) => {\n\t\t\tutil.getData(srcPath, resolve, reject, 1, rules)\n\t\t})\n\t\t.then(arr => start(arr))\n\t\t.catch(err => console.error(err))\n}","function initiateFeatures() {\r\n\tfeatures = [];\r\n\tfor (var i = featuresNames.length - 1; i >= 0; i--) {\r\n\t\tlet feature = {\r\n\t\t\tname: featuresNames[i],\r\n\t\t\tHTMLbutton: $(\"#button-feature\" + i)[0],\r\n\t\t\tHTMLelement: $(\"#feature\" + i)[0]};\r\n\t\tfeatures.push(feature);\r\n\t}\r\n}","function readCustomFeatures(options) {\n return getCustomFeatureXmlFilenames(options.paths.featureXmlDir)\n .then(function (filenames) {\n return getCustomFiles(options.paths.featureXmlDir)\n .then(function (files) {\n return {\n files: files,\n customFeatureFilepath: filenames\n };\n });\n });\n}","function get_all_loads(){\n const q = datastore.createQuery(LOADS);\n return datastore.runQuery(q).then( (entities) =>{\n return entities[0].map(fromDatastore);\n });\n}","toDataSourceEntities(options = {}, promiseCallback = () => {}) {\n let dataSource = new cesium.GeoJsonDataSource();\n let promise = dataSource.load(this.json, options);\n\n promise.then(function (dataSource) {\n let entities = dataSource.entities.values;\n for (let i = 0; i < entities.length; i++) {\n promiseCallback(entities[i]);\n }\n });\n }","loadFromFile(path, callback){\n\t\tfs.readFile(path, 'utf8', function(err, data){\n\t\t\tif(err){\n\t\t\t\tconsole.log(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//data is the string returned by fs's readFile function.\n\t\t\tlet newData = JSON.parse(data);\n\n\t\t\tthis.idIterator = newData.idIterator;\n\t\t\tthis.currentFeature = newData.currentFeature;\n\t\t\tthis.geo = newData.geo;\n\t\t\tcallback();\n\t\t}.bind(this))\n\t}","function getFragLocs(uris) {\n if (uris)\n return Promise.all(uris.map(uri => \n\t {console.log(\"GETLOC:\", uri)\n return ( getTurtle(uri)\n .then(store => {\n const fragnode = store.any(rdf.sym(uri), REMIX(\"fragment\"), undefined)\n\t\t console.log(uri, fragnode)\n return Promise.resolve(getNodeURI(fragnode))\n })\n\t .catch(e=>{console.log(e);return Promise.resolve(undefined)})\n\t\t )}\n ))\n else return Promise.resolve([])\n}","async features() {\n const res = await this.sendIgnoringError(\"FEAT\");\n const features = new Map();\n // Not supporting any special features will be reported with a single line.\n if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) {\n // The first and last line wrap the multiline response, ignore them.\n res.message.split(\"\\n\").slice(1, -1).forEach(line => {\n // A typical lines looks like: \" REST STREAM\" or \" MDTM\".\n // Servers might not use an indentation though.\n const entry = line.trim().split(\" \");\n features.set(entry[0], entry[1] || \"\");\n });\n }\n return features;\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 load(indexRootUrl, searchHint) {\n const enumValueIds = searchHint;\n const promises = enumValueIds.map(async (valueId) => {\n const value = this.values[valueId];\n if (value.dataRowIds)\n return Promise.resolve();\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\n dynamicTyping: true,\n header: true\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\n value.dataRowIds = promise;\n return promise;\n });\n await Promise.all(promises);\n }","get feature() { return features.findById(this.get()); }","static loadGenres() {\n // Returns a new promise to the user\n return new Promise((success, fail) => {\n var genres = [] // Stores the Genre objects\n // Reads all of the movie information\n firebase.database().ref(\"items\").once('value').then(function(snapshot) {\n // Explores all of the movies\n for(var i = 0; i < snapshot.val().length; i++) {\n var info = snapshot.val()[i] // Stores the movie info\n var genre = info.genre; // Stores the movie's genre array\n // Explores the genre's\n for(var i2 = 0; i2 < genre.length; i2++) {\n // Checks to see if the given genre is already in the genres array\n if(genres.indexOf(genre[i2]) == -1) {\n genres.push(genre[i2]) // Adds the entry to the genres array\n }\n }\n // Checks if this is the last movie to be evaluated\n if(i+1 == snapshot.val().length) {\n success(genres) // Returns the genre array to the user\n }\n } \n })\n })\n }","async populateSensorList() {\n\n let url = \"http://air.eng.utah.edu/dbapi/api/liveSensors/\"+this.sensorSource;\n if(this.sensorSource == \"airu\"){\n url = \"http://air.eng.utah.edu/dbapi/api/liveSensors/airU\";\n }\n //let url = \"http://air.eng.utah.edu/dbapi/api/sensorsAtTime/airU&2019-01-04T22:00:00Z\"\n let req = fetch(url)\n console.log(\"INSIDE OF POPULATE!!!\",this.sensorList)\n /* Adds each sensor to this.sensorList */\n req.then((response) => {\n return response.text();\n })\n .then((myJSON) => {\n myJSON = JSON.parse(myJSON);\n let sensors = [];\n for (let i = 0; i < myJSON.length; i++) {\n let val = {\n id: myJSON[i].ID,\n lat: myJSON[i].Latitude,\n long: myJSON[i].Longitude\n };\n sensors.push(val)\n }\n\n this.sensorList = sensors;\n });\n }","function n$1(r){return r&&g.fromJSON(r).features.map((r=>r))}","loadState() {\n return Promise.resolve();\n }","async loadData() {\n if (!this.load_data) throw new Error('no load data callback provided');\n\n return await Q.nfcall(this.load_data);\n }","async function loadEndpoints()\n{\n let result = [];\n\n const { db, sessionId } = this.global;\n\n const endpoints = await queryEndpoint.selectAllEndpoints(db, sessionId);\n\n // Selection is one by one since existing API does not seem to provide\n // linkage between cluster and what endpoint it belongs to.\n //\n // TODO: there should be a better way\n for (const endpoint of endpoints) {\n const endpointClusters\n = await queryEndpointType.selectAllClustersDetailsFromEndpointTypes(db, [ { endpointTypeId : endpoint.endpointTypeRef } ]);\n result.push({...endpoint, clusters : endpointClusters.filter(c => c.enabled == 1) });\n }\n\n return result;\n}","async getCockpitRegions() {\n const regions = await this.getRegionNames();\n return Promise.all(regions.map(name => {\n var i = this.getRegionItems(name);\n return i;\n }));\n }","function loadData(data) {\r\n // returns a promise\r\n }","function restcountries(restcountriesurl){\r\n return new Promise((res,rej)=>{\r\n let req= new XMLHttpRequest();\r\n req.open(\"GET\",restcountriesurl,true);\r\n req.addEventListener('load',function(){\r\n if(this.readyState===4 && this.status===200)\r\n res(req.responseText);\r\n else\r\n rej(\"unable to fetch\");\r\n })\r\n req.send();\r\n })\r\n}","async function getVectorLayer() {\n\n let places = await fetch('/lugares/')\n .then(resp => resp.json())\n .then(data => data.features )\n\n let vectorSource = new VectorSource({\n features: places.map(createIcon)\n });\n\n let vectorLayer = new VectorLayer({\n source: vectorSource\n });\n\n return vectorLayer;\n}","function fetchRegions() {\n return (dispatch, getState) => {\n const store = getState();\n const {\n primaryMetricId,\n relatedMetricIds,\n filters,\n currentStart,\n currentEnd\n } = store.primaryMetric;\n\n const metricIds = [primaryMetricId, ...relatedMetricIds].join(',');\n // todo: identify better way for query params\n return fetch(`/data/anomalies/ranges?metricIds=${metricIds}&start=${currentStart}&end=${currentEnd}&filters=${encodeURIComponent(filters)}`)\n .then(res => res.json())\n .then(res => dispatch(loadRegions(res)))\n .catch(() => {\n dispatch(requestFail());\n });\n\n };\n}","async function getRegions() {\n let fetchRegions = await fetch(`${APP_SERVER}/regions`, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${token}`\n }\n });\n\n let allRegions = await fetchRegions.json();\n let regions = allRegions.data;\n \n console.log(regions);\n\n if (regions) {\n return regions;\n } else {\n console.log(\"[ERROR] Regions: NO REGIONS FOUND!, error msg: \" + regions);\n }\n}","async loadGemfile() {\n let gemfilePath = nova.workspace.config.get('rubygems.workspace.gemfileLocation')\n let gemfileHandler = null\n let gemfileLinesArray = []\n\n if (FUNCTIONS.isWorkspace()) {\n // If no Gemfile is set in the workspace preferences, try to open one in the root directory.\n if (gemfilePath == null) {\n try {\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(nova.workspace.path)}/Gemfile`)\n } catch (error) { }\n } else {\n try {\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(gemfilePath)}`)\n } catch (error) {\n console.log(\n 'The \\'Gemfile\\' location set in the workspace preferences could not be found. Please check ' +\n 'the location and try again.')\n }\n }\n }\n\n if (gemfileHandler !== null) {\n gemfileLinesArray = gemfileHandler.readlines()\n gemfileHandler.close()\n\n this._gems = await this._evaluateGemfileLines(gemfileLinesArray)\n }\n\n return this._gems\n }","function loadGCI() {\n return fs.readFileSync('gci.txt','utf8')\n }","async function processHygrodataSeries(rawdata, pointID, marker, sourceElement, markerName, dataObj)\r\n{\r\n return new Promise((resolve, reject) => {\r\n // console.log(\"processHygrodataSeries()\");\r\n\r\n var lines = rawdata.split('\\n');\r\n var data = [];\r\n \r\n for(var line of lines)\r\n {\r\n var fields = line.split(',');\r\n \r\n // console.log(\"Line:\");\r\n // console.log(fields);\r\n \r\n if(fields.length < 2)\r\n {\r\n continue;\r\n }\r\n \r\n data.push(fields);\r\n }\r\n \r\n\r\n var intervals = new Array();\r\n\r\n // skip headers line\r\n for(let i = 1; i < data.length; i++)\r\n {\r\n // console.log(\"Snapshot \" + data[i][0]);\r\n\r\n var startDate = new Date(data[i][1], data[i][2], data[i][3], data[i][4], data[i][5], data[i][6]);\r\n var endInterval = new Date(startDate);\r\n endInterval.setSeconds(startDate.getSeconds() + 3599);\r\n\r\n var interval = new Cesium.TimeInterval(\r\n {\r\n \"start\" : Cesium.JulianDate.fromDate(startDate),\r\n \"stop\" : Cesium.JulianDate.fromDate(endInterval),\r\n \"isStartIncluded\" : true,\r\n \"isStopIncluded\" : false,\r\n // \"isStopIncluded\" : true,//false,\r\n // \"data\" : { \"temperature\" : data[i][7], \"humidity\" : data[i][8] }\r\n \"data\" : //[\r\n { \r\n \"element\" : marker,\r\n \"type\" : \"hygro\",\r\n \"owner\" : markerName,\r\n \"value\" : {\r\n \"temperature\" : data[i][7], \"humidity\" : data[i][8]\r\n }\r\n }\r\n //]\r\n }\r\n );\r\n\r\n // console.log(\"Adding interval\");\r\n intervals.push(interval);\r\n }\r\n\r\n // g_intervalGroups.set(sourceElement.name, new Cesium.TimeIntervalCollection(intervals));\r\n var intervalCollection = new Cesium.TimeIntervalCollection(intervals);\r\n g_intervalGroups.set(markerName, intervalCollection);\r\n\r\n dataObj.data.source = intervalCollection;\r\n\r\n // g_timeIntervals = new Cesium.TimeIntervalCollection(intervals);\r\n g_hygroData.set(pointID, { \"intervals\" : new Cesium.TimeIntervalCollection(intervals), \"marker\" : marker, \"caption\" : marker.label.text });\r\n\r\n resolve();\r\n });\r\n}","function eng_gen() {\n var condition1 = function () {\n len_eng = corpus_eng.length;\n // console.log(len_eng)\n for (i = 0; i < len_eng; i++) {\n var temp = corpus_eng[i].split(\"\\t\");\n eng_ans.push(temp);\n eng_words.add(eng_ans[i][0]);\n }\n }\n $.when($.get(\"features_english.txt\", function (data_eng) { corpus_eng = data_eng.split(\"\\n\") })).then(condition1);\n}","function pollForCoremetricsReady(){\n\n\t\tvar promise = new Promise(function(resolve, reject){\n\n\t\t\tif ( window.cmCreateElementTag && window.cm_ClientID ){\n\t\t\t\treturn resolve( window.cmCreateElementTag );\n\t\t\t}\n\n\t\t\tvar interval = setInterval(function(){\n\n\t\t\t\tif ( window.cmCreateElementTag && window.cm_ClientID ){\n\t\t\t\t\tclearInterval( interval );\n\t\t\t\t\tresolve( window.cmCreateElementTag );\n\t\t\t\t}\n\t\t\t }, 500);\n\n\t\t});\n\n\t\treturn promise;\n\n\t}","fetchData() {\n const url = 'http://data.unhcr.org/api/population/regions.json';\n return fetch(url, {\n method: 'GET',\n })\n .then((resp) => resp.json())\n .then((json) => this.parseRefugeeData(json))\n .catch((error) => Notification.logError(error, 'RefugeeCampMap.fetchData'));\n }","async loadIndex() {\n const indexURL = this.config.indexURL\n return loadIndex(indexURL, this.config, this.genome)\n }","featureTypeIriSelect(iri) {\n this.props.loadingOn();\n Actions.executeQueryForDatasetSource(\n DatasetSourceStore.getSelectedDatasetSource().id,\n \"spatial/get_feature_geometry\",\n {object_type: \"<\"+iri+\">\"}\n );\n this.setState({value : iri,geometries:[]})\n }","async import(uri, options) {\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createDefaultGltfOptions();\n if (options && options.files) {\n for (let fileName in options.files) {\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getExtension(fileName);\n if (fileExtension === 'gltf' || fileExtension === 'glb') {\n return await this.__loadFromArrayBuffer(options.files[fileName], defaultOptions, basePath, options);\n }\n }\n }\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fetchArrayBuffer(uri);\n return await this.__loadFromArrayBuffer(arrayBuffer, defaultOptions, basePath, options);\n }","function trackFeatures(final_track_list) {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/audio-features';\n xhr.open(\"GET\", url + '?ids=' + final_track_list);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }","load(src=[],opts={}){\n\t\t// files loaded\n\t\twindow.trs.loadedScript = window.trs.loadedScript || [] \n\t\treturn new Promise((resolve,reject)=>{\n\t\t\t//options\n\t\t\tlet opt=opts\n\t\t\topt.async=opts.async||false\n\t\t\topt.once=opts.once||false\n\n\t\t\tfor(let file of src){\n\t\t\t\t// script\n\t\t\t\tlet sc=document.createElement('script')\n\t\t\t\tsc.src=file\n\t\t\t\t// attributes\n\t\t\t\tif(opt.async) sc.setAttribute('async','')\n\n\t\t\t\t// mark as loaded by lazy loader func\n\t\t\t\tif(opt.once) {\n\t\t\t\t\tif (window.trs.loadedScript.indexOf(file) == -1 ) {\n\t\t\t\t\t\twindow.trs.loadedScript.push(file)\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// load\n\t\t\t\tif(opt.module) sc.setAttribute('type','module')\n\t\t\t\tsc.setAttribute('lazy-loaded','')\n\t\t\t\tdocument.body.appendChild(sc)\n\t\t\t\tresolve(sc)\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t})\n\t}","fetchArtifacts() {\n const artifactLocation = getSrc(this.props.path, this.props.runUuid);\n this.props\n .getArtifact(artifactLocation)\n .then((rawFeatures) => {\n const parsedFeatures = JSON.parse(rawFeatures);\n this.setState({ features: parsedFeatures, loading: false });\n })\n .catch((error) => {\n this.setState({ error: error, loading: false, features: undefined });\n });\n }","getGroupsOfaPerson() {\n return this.#fetchAdvanced(this.#getGroupsOfPersonURL()).then((responseJSON) => {\n let groupBOs = GroupBO.fromJSON(responseJSON);\n return new Promise(function (resolve) {\n resolve(groupBOs);\n })\n })\n}","async function loadFromFile (file) {\n const deferred = createDeferred()\n\n const fileReader = new window.FileReader()\n\n fileReader.onload = onLoad\n fileReader.onabort = () => {\n deferred.reject(new Error(`file load interrupted: ${file}`))\n }\n fileReader.onerror = () => {\n deferred.reject(new Error(`file load error: ${file}`))\n }\n\n fileReader.readAsText(file)\n\n return deferred.promise\n\n function onLoad (event) {\n const data = event.target && event.target.result\n if (data == null) {\n return deferred.reject(new Error(`no data in file: ${file.name}`))\n }\n\n let profileData\n try {\n profileData = JSON.parse(data)\n } catch (err) {\n return deferred.reject(new Error(`file is not JSON: ${file.name}`))\n }\n\n const profileInfo = ProfileInfo.create(profileData)\n if (profileInfo == null) {\n return deferred.reject(new Error(`file is not a V8 CPU profile: ${file.name}`))\n }\n\n profileInfo.fileName = file.name\n\n Store.set({\n profileInfo,\n pkgIdSelected: null,\n modIdSelected: null,\n fnIdSelected: null\n })\n\n deferred.resolve(profileInfo)\n }\n}","async loadTokensList() {\n return null;\n }","async function readFile(){\n return new Promise((resolve,reject)=>{\n fs.readFile('../dataset/smallDataSet.csv','utf8',(err, data)=>{\n if(err) reject(err);\n resolve(data);\n });\n })\n}","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t return promise;\n\n\t\t\t function promiseThen(_arg) {\n\t\t\t if (typeof _arg == 'function')\n\t\t\t return promise.then(_arg);\n\t\t\t else\n\t\t\t return promise.then(function () {\n\t\t\t var nowLoad = requiredData(_arg);\n\t\t\t if (!nowLoad)\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\n\t\t\t return $ocLL.load(nowLoad);\n\t\t\t });\n\t\t\t }\n\n\t\t\t function requiredData(name) {\n\t\t\t if (jsRequires.modules)\n\t\t\t for (var m in jsRequires.modules)\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n\t\t\t return jsRequires.modules[m];\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\n\t\t\t }\n\t\t\t}]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t return promise;\n\n\t\t\t function promiseThen(_arg) {\n\t\t\t if (typeof _arg == 'function')\n\t\t\t return promise.then(_arg);\n\t\t\t else\n\t\t\t return promise.then(function () {\n\t\t\t var nowLoad = requiredData(_arg);\n\t\t\t if (!nowLoad)\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\n\t\t\t return $ocLL.load(nowLoad);\n\t\t\t });\n\t\t\t }\n\n\t\t\t function requiredData(name) {\n\t\t\t if (jsRequires.modules)\n\t\t\t for (var m in jsRequires.modules)\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n\t\t\t return jsRequires.modules[m];\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\n\t\t\t }\n\t\t\t}]\n };\n }","function pullDatabase(){\n return new Promise((resolve, reject) => {\n try{\n db.collection(\"Classic\").get().then((snapshot) => {\n //characterArray will become filled with the documents from our Firebase database converted into Character classes\n var characterArray = [];\n snapshot.forEach((doc) => {\n //console.log(doc.id, '=>', doc.data());\n var character = doc.data();\n characterArray.push(new Character(character.name, character.realm, character.level, character.race, character.class));\n });\n //returns the array of Character classes\n resolve(characterArray);\n })\n .catch((err) => {\n console.log('Error getting documents', err);\n });\n } catch (e){\n reject(e);\n }\n }) \n}","listenForFeature(featuresRef) {\n featuresRef.on('value', (dataSnapshot) => {\n var tasks = [];\n dataSnapshot.forEach((child) => {\n tasks.push({\n title: child.val().title,\n uri: child.val().uri,\n date: child.val().date,\n type: child.val().type,\n _key: child.key\n });\n });\n\n this.setState({\n dataFeatures:tasks,\n loading: false,\n });\n });\n }","function loadScene(url) {\n let newObjects = [];\n return new Promise((resolve, reject) => {\n new GLTFLoader().load( url, \n function (object) {\n // On Load\n console.log(object);\n object.scene.children.forEach((prop, i) => newObjects[i] = prop); // Add all props from the scene into the objects array.\n //scene.add(object.scene);\n resolve(newObjects);\n },\n function (XMLHttpRequest) {\n // On Progress\n console.log(\"Loading Scene... \", XMLHttpRequest);\n },\n function (err) {\n // On Error\n console.log(err);\n reject(err);\n });\n });\n }","async function getDataset() {\n const [dataset, perfTimes] = await fetchMorpheusJson(\n studyAccession,\n genes,\n cluster,\n annotation.name,\n annotation.type,\n annotation.scope,\n subsample\n )\n logFetchMorpheusDataset(perfTimes, cluster, annotation, genes)\n return dataset\n }","function readIndividualFeatures(egoCenter, callback) {\n console.log(\" - - Reading individual features.\");\n var data = fs.readFileSync(\"../data/\" + egoCenter + \".feat\", 'utf8');\n var featureArray = data.split(\"\\n\");\n for (var feature of featureArray) {\n var spaceIndex = feature.indexOf(\" \");\n if (spaceIndex > 0) {\n individualFeatures[feature.substring(0, spaceIndex)] = feature.substring(spaceIndex + 1, feature.length).split(\" \");\n }\n }\n}","function init(count) {\n var count = count || 1\n var promise = new Promise((resolve, reject) => {\n getLookupData(odsaStore)\n .then((lookups) => {\n getTimeTrackingData(odsaStore, lookups, count)\n .then((vizData) => {\n $('#reload_data').show()\n $('#generate_data').show()\n $('.accordionjs').show()\n initViz(vizData, lookups)\n .then(() => {\n $(\"#tools-accordion\").accordionjs({ activeIndex: false, closeAble: true })\n $(\"#tools-accordion-exs\").accordionjs({ activeIndex: false, closeAble: true })\n initExTools(lookups)\n resolve()\n })\n })\n .catch((err) => {\n console.log(err)\n errDialog(err)\n })\n })\n .catch((err) => {\n console.log(err)\n errDialog(err)\n })\n })\n return promise\n }","function resolvePromises() {\n resolvePromisesFn(autoflow);\n }","function fetchCountries(){\n console.log('IMonData: [Countries] Fetching data..');\n var store = new Store();\n var futures = [];\n var baseUrl = 'https://thenetmonitor.org/v2/countries';\n\n var fut = HTTP.get.future()(baseUrl, { timeout: Settings.timeout*3 });\n futures.push(fut);\n var results = fut.wait();\n store.sync(results.data);\n _.each(results.data.data, function(d){\n store.sync(d.relationships.data_points);\n });\n\n console.log('IMonData: [Countries] Data fetched.');\n Future.wait(futures);\n\n var insert = function(){\n console.log('IMonData: [Countries] Inserting...');\n _.each(store.findAll('countries'), insertCountryData);\n console.log('IMonData: [Countries] Inserted.');\n };\n\n Future.task(insert);\n\n}","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadfloodIncidentlayer(floodincidentdata){\r\nfloodincidentjson = JSON.parse(floodincidentdata);\r\n\r\nvar features = []; \r\nfeatures = floodincidentjson.features; \r\nvar jproperties = floodincidentjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tfloodincarray.push(Object.values(jproperties[i]));\r\n}\r\n\r\n}","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg === 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\r\n var _args = arguments;\r\n return {\r\n deps: ['$ocLazyLoad', '$q',\r\n\t\t\tfunction ($ocLL, $q) {\r\n\t\t\t var promise = $q.when(1);\r\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\r\n\t\t\t promise = promiseThen(_args[i]);\r\n\t\t\t }\r\n\t\t\t return promise;\r\n\r\n\t\t\t function promiseThen(_arg) {\r\n\t\t\t if (typeof _arg == 'function')\r\n\t\t\t return promise.then(_arg);\r\n\t\t\t else\r\n\t\t\t return promise.then(function () {\r\n\t\t\t var nowLoad = requiredData(_arg);\r\n\t\t\t if (!nowLoad)\r\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\r\n\t\t\t return $ocLL.load(nowLoad);\r\n\t\t\t });\r\n\t\t\t }\r\n\r\n\t\t\t function requiredData(name) {\r\n\t\t\t if (jsRequires.modules)\r\n\t\t\t for (var m in jsRequires.modules)\r\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\r\n\t\t\t return jsRequires.modules[m];\r\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\r\n\t\t\t }\r\n\t\t\t}]\r\n };\r\n }","function initFeatureList() {\n var task = $(parameterAnalysisDateId).val();\n if (task) {\n $(featureListId).multiselect({\n dropRight: true,\n buttonWidth: \"100%\",\n enableFiltering: true,\n enableCaseInsensitiveFiltering: true,\n nonSelectedText: \"请选择Feature\",\n filterPlaceholder: \"搜索\",\n nSelectedText: \"项被选中\",\n includeSelectAllOption: true,\n selectAllText: \"全选/取消全选\",\n allSelectedText: \"已选中所有平台类型\",\n maxHeight: 200,\n width: 220\n });\n var url = \"paramQuery/getFeatureList\";\n $.ajax({\n type: \"post\",\n url: url,\n data: { db: task },\n dataType: \"json\",\n success: function(data) {\n var newOptions = [];\n var obj = {};\n $(data).each(function(k, v) {\n v = eval(\"(\" + v + \")\");\n obj = {\n label: v.text,\n value: v.value\n };\n newOptions.push(obj);\n });\n obj = {\n label: \"未知\",\n value: \"unknow\"\n };\n newOptions.push(obj);\n $(featureListId).multiselect(\"dataprovider\", newOptions);\n // $(featureListId).multiselect(\"disable\");\n }\n });\n }\n}"],"string":"[\n \"async readFeatures(chr, start, end) {\\n\\n const index = await this.getIndex()\\n if (index) {\\n return this.loadFeaturesWithIndex(chr, start, end);\\n } else if (this.dataURI) {\\n return this.loadFeaturesFromDataURI();\\n } else {\\n return this.loadFeaturesNoIndex()\\n }\\n\\n }\",\n \"load () {\\n this.fire('dataLoading') // for supporting loading spinners\\n \\n let promise = this.coverage.loadDomain().then(domain => {\\n this.domain = domain\\n \\n ;[this._projX, this._projY] = getHorizontalCRSComponents(domain)\\n return loadProjection(domain)\\n }).then(proj => {\\n this.projection = proj\\n })\\n if (this._loadCoverageSubset) {\\n promise = promise.then(() => this._loadCoverageSubset())\\n } else if (this.parameter) {\\n promise = promise.then(() => this.coverage.loadRange(this.parameter.key)).then(range => {\\n this.range = range\\n })\\n }\\n \\n promise = promise.then(() => {\\n this.fire('dataLoad')\\n }).catch(e => {\\n console.error(e)\\n this.fire('error', {error: e})\\n this.fire('dataLoad')\\n })\\n return promise\\n }\",\n \"function get_features(refseqID) {\\n\\n\\tvar myFeatures;\\t\\n\\tglue.inMode(\\\"reference/\\\"+refseqID, function(){\\n\\t\\tmyFeatures = glue.getTableColumn(glue.command([\\\"list\\\", \\\"feature-location\\\"]), \\\"feature.name\\\");\\n\\t});\\n\\treturn myFeatures;\\n}\",\n \"getFeaturesInRange(contig: string, start: number, stop: number): Q.Promise {\\n start--; // switch to zero-based indices\\n stop--;\\n return this._getSequenceHeader(contig).then(header => {\\n var dnaOffset = header.offset + header.dnaOffsetFromHeader;\\n var offset = Math.floor(dnaOffset + start/4);\\n var byteLength = Math.ceil((stop - start + 1) / 4) + 1;\\n return this.remoteFile.getBytes(offset, byteLength).then(dataView => {\\n return markUnknownDNA(\\n unpackDNA(dataView, start % 4, stop - start + 1), start, header)\\n .join('');\\n });\\n });\\n }\",\n \"getFeaturesByTagExpression() {\\n return getTestCasesFromFilesystem({\\n cwd: '',\\n eventBroadcaster: eventBroadcaster,\\n featurePaths: this.getFeatures(),\\n pickleFilter: new PickleFilter({\\n tagExpression: this.getCucumberCliTags()\\n }),\\n order: 'defined'\\n }).then(function (results) {\\n let features = [];\\n let scenarios = [];\\n _.forEach(results, function (result) {\\n if (argv.parallelFeatures) {\\n features.push(result.uri);\\n } else {\\n let lineNumber = result.pickle.locations[0].line;\\n let uri = result.uri;\\n let scenario = `${uri}:${lineNumber}`;\\n scenarios.push(scenario);\\n }\\n });\\n\\n return {\\n features: _.sortedUniq(features),\\n scenarios: scenarios\\n };\\n });\\n }\",\n \"getFeatures() {\\n let filesGlob = 'e2e/features/**/*.feature';\\n let files = glob.sync(filesGlob);\\n return _.sortedUniq(files);\\n }\",\n \"async function loadData() {\\r\\n\\tlet result = [];\\r\\n\\tlet resp = await fetch('./cats.geojson');\\r\\n\\tlet data = await resp.json();\\r\\n\\tdata.features.forEach(f => {\\r\\n\\t\\tresult.push({\\r\\n\\t\\t\\tlat:f.geometry.coordinates[1],\\r\\n\\t\\t\\tlng:f.geometry.coordinates[0]\\r\\n\\t\\t});\\r\\n\\t});\\r\\n\\treturn result;\\r\\n}\",\n \"function gvpLoadPromise () {\\n if (context.uriAddressableDefsEnabled) {\\n return Promise[\\\"resolve\\\"]();\\n } else {\\n return context.globalValueProviders.loadFromStorage();\\n }\\n }\",\n \"function loadFeature( feature, data ) {\\n // Add a Spinner\\n var bodyNode = can.$('body');\\n var waitingNode = can.$('
                    &nbsp;
                    ');\\n waitingNode.appendTo(bodyNode);\\n\\n // Loads the feature files and templates, feature name is critical to the file name\\n require(['js/features/'+feature+'.min.js'], function( init ){\\n fadeOut(waitingNode, function(){\\n init( data );\\n waitingNode.remove();\\n });\\n }, onInternetDown);\\n \\n currentFeature = feature;\\n\\n return feature;\\n}\",\n \"load ()\\n {\\n let thisObj = this;\\n return new Promise (function (resolve, reject)\\n {\\n //run async mode\\n (async function () { \\n try {\\n\\n\\n \\n //pull the feature service definition'\\n logger.info(\\\"Fetching the feature service definition...\\\")\\n let featureServiceJsonResult = await makeRequest({method: 'POST', timeout: 120000, url: thisObj.featureServiceUrl, params: {f : \\\"json\\\", token: thisObj.token}});\\n thisObj.featureServiceJson = featureServiceJsonResult\\n //check to see if the feature service has a UN\\n if (thisObj.featureServiceJson.controllerDatasetLayers != undefined)\\n { \\n thisObj.layerId = thisObj.featureServiceJson.controllerDatasetLayers.utilityNetworkLayerId;\\n let queryDataElementUrl = thisObj.featureServiceUrl + \\\"/queryDataElements\\\";\\n let layers = \\\"[\\\" + thisObj.layerId + \\\"]\\\"\\n \\n let postJson = {\\n token: thisObj.token,\\n layers: layers,\\n f: \\\"json\\\"\\n }\\n logger.info(\\\"Fetching the utility network data element ...\\\")\\n //pull the data element definition of the utility network now that we have the utility network layer\\n let undataElement = await makeRequest({method: 'POST', url: queryDataElementUrl, params: postJson });\\n \\n //request the un layer defition which has different set of information\\n let unLayerUrl = thisObj.featureServiceUrl + \\\"/\\\" + thisObj.layerId;\\n postJson = {\\n token: thisObj.token,\\n f: \\\"json\\\"\\n }\\n\\n logger.info(\\\"Fetching the utility network layer definition ...\\\")\\n\\n let unLayerDef = await makeRequest({method: 'POST', url: unLayerUrl, params: postJson });\\n \\n thisObj.dataElement = undataElement.layerDataElements[0].dataElement;\\n thisObj.layerDefinition = unLayerDef\\n thisObj.subnetLineLayerId = thisObj.getSubnetLineLayerId(); \\n resolve(thisObj);\\n }\\n else\\n reject(\\\"No Utility Network found in this feature service\\\");\\n\\n }\\n\\n catch(ex){\\n reject(ex)\\n }\\n })();\\n })\\n\\n \\n }\",\n \"async function getData() {\\n request.open('GET',\\n 'https://services1.arcgis.com/0n2NelSAfR7gTkr1/arcgis/rest/services/Business_Licenses/FeatureServer/0/query?where=FID' + ' > ' + lastFID + ' AND FID <= ' + (lastFID + 500) + '&outFields=*&outSR=4326&f=json',\\n true);\\n\\n //comment out the following line to quickly edit ui without making requests\\n request.send();\\n}\",\n \"load() {\\n return this.loading || (this.loading = this.loadFunc().then(support => this.support = support, err => { this.loading = null; throw err; }));\\n }\",\n \"function get_features(res, mysql, context, complete){\\r\\n mysql.pool.query(\\\"SELECT * FROM features\\\", function(error, results, fields){\\r\\n if(error){\\r\\n res.write(JSON.stringify(error));\\r\\n res.end();\\r\\n }\\r\\n context.features = results;\\r\\n complete();\\r\\n });\\r\\n }\",\n \"getGC() {\\n return this.$http.get(PATH + \\\"gc_polygon.topo.json\\\", {cache: true})\\n .then(function(data, status) {\\n return topojson.feature(data.data, data.data.objects['dc_polygon.geo']);\\n });\\n }\",\n \"async function fetchData(data) {\\n let fetchedData = await fetch(data);\\n let json = await fetchedData.json();\\n let features = json.features;\\n return features\\n}\",\n \"async getLoadOperation() {}\",\n \"load() {\\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\\\"__awaiter\\\"])(this, void 0, void 0, function* () { });\\n }\",\n \"$onInit() {\\n\\n \\tPromise.all([\\n \\t\\tthis.loadLocations(),\\n \\t\\tthis.loadCategories(), \\n \\t\\tthis.loadCollections()\\n \\t]).then(() => this.loadFeatures(this.filter))\\n }\",\n \"get features() {\\r\\n return new Features(this);\\r\\n }\",\n \"get features() {\\r\\n return new Features(this);\\r\\n }\",\n \"async loadFeatureList(list) {\\n await import(\\\"./subcomp/facility.js\\\")\\n .then(() => {\\n // API call for get Facilities List\\n list.forEach(\\n (item) =>\\n (this._qs(\\\".features\\\").innerHTML += `\\n \\n `)\\n );\\n })\\n .catch((err) => this.popup(err, \\\"error\\\"));\\n }\",\n \"getContigList(): Q.Promise {\\n return this.header.then(header => header.sequences.map(seq => seq.name));\\n }\",\n \"async function getFeatures() {\\n // Read JSON file\\n return await fetch(base_url + '/content/mapping_metrics_definition.json')\\n .then(response => response.json())\\n .then(data => {\\n let features = data['features'];\\n getButtonType().then(button => {\\n\\n document.getElementById('buttons').innerHTML = '';\\n let div = document.createElement('div');\\n div.className = 'control-area';\\n\\n let buttonType;\\n if (typeof uid !== undefined && uid !== \\\"\\\" && uid != null) {\\n buttonType = button[0];\\n } else {\\n buttonType = button[1];\\n }\\n div.innerHTML = ``\\n\\n // Append element to document\\n document.getElementById('buttons').appendChild(div);\\n })\\n return features;\\n });\\n}\",\n \"async function getData(){\\r\\n\\r\\n //Fetch the data from the geojson file\\r\\n fetch(\\\"BEWES_Building_Data.geojson\\\").then(response => response.json()).then(data => {addToTable(data);});\\r\\n\\r\\n }\",\n \"getFeatures() {\\n\\t\\tfetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.state.prop_ID}`, {\\n\\t\\t\\tmethod: \\\"GET\\\",\\n\\t\\t\\tbody: null,\\n\\t\\t\\theaders: {\\n\\t\\t\\t\\t\\\"Authorization\\\": \\\"Basic \\\" + btoa(this.context.user.username + \\\":\\\" + this.context.user.password)\\n\\t\\t\\t}\\n\\t\\t})\\n\\t\\t\\t.then(status)\\n\\t\\t\\t.then(json)\\n\\t\\t\\t.then(dataFromServer => {\\n\\t\\t\\t\\tthis.setState({\\n\\t\\t\\t\\t\\tfeatures: dataFromServer,\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\tconsole.log(dataFromServer, 'features here')\\n\\t\\t\\t})\\n\\t\\t\\t.catch(error => {\\n\\t\\t\\t\\tconsole.log(error)\\n\\t\\t\\t\\tmessage.error('Could not get the features. Try Again!', 5);\\n\\t\\t\\t});\\n\\t}\",\n \"async function loadCoreData() {\\n await Promise.all([\\n loadExercises(),\\n loadCategories(),\\n loadSessions(),\\n ]);\\n}\",\n \"function load() {\\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\\n .then(function(result) {\\n console.log('load results')\\n tree = result[0];\\n dbIndex = new Index(result[1]);\\n entries = result[2];\\n });\\n}\",\n \"load() {\\n return Promise.resolve(false /* identified */);\\n }\",\n \"async fetchDvFeatures() {\\n await fetch(\\n `${this.mapboxLayer.url}/data/ch.sbb.direktverbindungen.public.json?key=${this.mapboxLayer.apiKey}`,\\n )\\n .then((res) => res.json())\\n .then((data) => {\\n this.allFeatures = data['geops.direktverbindungen'].map((line) => {\\n return new Feature({\\n ...line,\\n geometry: new LineString([\\n [line.bbox[0], line.bbox[1]],\\n [line.bbox[2], line.bbox[3]],\\n ]),\\n });\\n });\\n this.syncFeatures();\\n })\\n // eslint-disable-next-line no-console\\n .catch((err) => console.error(err));\\n }\",\n \"async function load() { // returns a promise of an array\\n const rawData = await fsp.readFile('./restaurant.json');\\n const restaurantsArray = (JSON.parse(String(rawData)));\\n return restaurantsArray;\\n}\",\n \"async loadLazy () {\\n /**\\n if(this.load && !this.loadComplete) {\\n import('./lazy-element.js').then((LazyElement) => {\\n this.loadComplete = true;\\n console.log(\\\"LazyElement loaded\\\");\\n }).catch((reason) => {\\n console.log(\\\"LazyElement failed to load\\\", reason);\\n });\\n }\\n */\\n }\",\n \"loadLevels() {\\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\\\"__awaiter\\\"])(this, void 0, void 0, function* () {\\n const level_list = yield Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_2__[\\\"queryZones\\\"])({ tags: 'level', limit: 2500 })\\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\\\"map\\\"])((i) => i.data))\\n .toPromise();\\n const levels = level_list.map((lvl) => new _level_class__WEBPACK_IMPORTED_MODULE_7__[\\\"BuildingLevel\\\"](lvl));\\n levels.sort((a, b) => (a.name || '').localeCompare(b.name || ''));\\n this.levels_subject.next(levels);\\n });\\n }\",\n \"load() {\\n return __awaiter(this, undefined, undefined, function* () {\\n yield Promise.all([\\n this._strings.load(),\\n this._pedal.load(),\\n this._keybed.load(),\\n this._harmonics.load(),\\n ]);\\n this._loaded = true;\\n });\\n }\",\n \"function loadAllRegimes() {\\n //also get the available regimens here for later\\n return conceptService.get(Bahmni.Common.Constants.arvRegimensConvSet).then(function (result) {\\n vm.allRegimes = result.data;\\n });\\n }\",\n \"async getFeaturesAtLocation(latLngHeight, providerCoords) {\\n const pickPosition = this.scene.globe.ellipsoid.cartographicToCartesian(Cartographic.fromDegrees(latLngHeight.longitude, latLngHeight.latitude, latLngHeight.height));\\n const pickPositionCartographic = Ellipsoid.WGS84.cartesianToCartographic(pickPosition);\\n const promises = [];\\n const imageryLayers = [];\\n for (let i = this.scene.imageryLayers.length - 1; i >= 0; i--) {\\n const imageryLayer = this.scene.imageryLayers.get(i);\\n const imageryProvider = imageryLayer.imageryProvider;\\n // @ts-ignore\\n const imageryProviderUrl = imageryProvider.url;\\n if (imageryProviderUrl && providerCoords[imageryProviderUrl]) {\\n var tileCoords = providerCoords[imageryProviderUrl];\\n const pickPromise = imageryProvider.pickFeatures(tileCoords.x, tileCoords.y, tileCoords.level, pickPositionCartographic.longitude, pickPositionCartographic.latitude);\\n if (pickPromise) {\\n promises.push(pickPromise);\\n }\\n imageryLayers.push(imageryLayer);\\n }\\n }\\n const pickedFeatures = this._buildPickedFeatures(providerCoords, pickPosition, [], promises, imageryLayers, pickPositionCartographic.height, true);\\n await pickedFeatures.allFeaturesAvailablePromise;\\n return pickedFeatures.features;\\n }\",\n \"async function importFeatureSuggestions(p) {\\n if (!confirm(\\\"Import feature suggestions?\\\\n(This adds a lot of data.)\\\")) return\\n await loadCompendiumFeatureSuggestions()\\n // console.log(\\\"compendiumFeatureSuggestionsTables\\\", compendiumFeatureSuggestionsTables)\\n const nodeTable = compendiumFeatureSuggestionsTables[\\\"Node\\\"]\\n importNodeTable(p, nodeTable)\\n const viewNodeTable = compendiumFeatureSuggestionsTables[\\\"ViewNode\\\"]\\n importViewNodeTable(p, viewNodeTable)\\n const linkTable = compendiumFeatureSuggestionsTables[\\\"Link\\\"]\\n importLinkTable(p, linkTable)\\n const viewLinkTable = compendiumFeatureSuggestionsTables[\\\"ViewLink\\\"]\\n importViewLinkTable(p, viewLinkTable)\\n}\",\n \"function fetchGeoData(){\\n $.ajax({\\n dataType: \\\"json\\\",\\n url: \\\"data/map.geojson\\\",\\n success: function(data) {\\n $(data.features).each(function(key, data) {\\n geoDataLocations.push(data);\\n });\\n startMap();\\n },\\n error: function(error){\\n console.log(error);\\n return error;\\n }\\n });\\n }\",\n \"function got_features(bbox, features){\\n console.log('got features')\\n\\n sort_features(features)\\n\\n features.forEach(function(feature){\\n console.log(new Date(feature.attributes.acquisitionDate))\\n })\\n\\n var dates = []\\n for(var i = 1999; i <= 2013; i++){\\n for(var j = 1; j <= 12; j++){\\n dates.push(new Date( '' + j + '/01/' + i + ' GMT-0800 (PST)'))\\n }\\n }\\n // dates.push(new Date('1/01/2014 GMT-0800 (PST)'))\\n // dates.push(new Date('2/01/2014 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2010 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2011 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2012 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2013 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2014 GMT-0800 (PST)'))\\n console.log(dates)\\n\\n dates.map(function(date){\\n date = Number(date)\\n console.log('features for date', new Date(date))\\n var date_features = features_by_timestamp(date, features)\\n date_features.sort(function(a, b){\\n return a.attributes.acquisitionDate - b.attributes.acquisitionDate\\n })\\n var ids = date_features\\n .map(function(feature){ return feature.attributes.OBJECTID })\\n console.log('\\\\tfeatures:', date_features.map(function(f){ return JSON.stringify([new Date(f.attributes.acquisitionDate), f.attributes.OBJECTID]) }))\\n return {\\n // find all the closest ids by date without going over\\n ids: ids\\n , date: date\\n , bbox: bbox\\n }\\n }).map(function(obj){\\n save_image_from_date(obj, 'test-' + obj.date + '.jpg')\\n })\\n}\",\n \"async load () {}\",\n \"function og(){ci()(this,{$featuresCollection:{enumerable:!0,get:this.getFeaturesCollection}})}\",\n \"async initializeDataLoad() {\\n }\",\n \"loadAgencies() {\\n\\t\\tgetAgencies()\\n\\t\\t\\t.then((ans) => {\\n\\t\\t\\t\\tvar fastAccess = {};\\n\\t\\t\\t\\tfor(var i = 0; i < ans.length; i++) {\\n\\t\\t\\t\\t\\tlet ag = ans[i];\\n\\t\\t\\t\\t\\tfastAccess[ag.title] = ag.tag;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tthis.setState({\\n\\t\\t\\t\\t\\tagencies: ans,\\n\\t\\t\\t\\t\\tfastAccess: fastAccess,\\n\\t\\t\\t\\t})\\n\\t\\t\\t});\\n\\t}\",\n \"function loadSmallTrail(evt) {\\n var req = $.ajax({\\n url: \\\"http://localhost:3000/w_pathnondistinct\\\",\\n type: \\\"GET\\\",\\n });\\n req.done(function (resp_json) {\\n console.log(JSON.stringify(resp_json));\\n var listaFeat = jsonAnswerDataToListElements(resp_json);\\n var linjedata = {\\n \\\"type\\\": \\\"FeatureCollection\\\",\\n \\\"features\\\": listaFeat\\n };\\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\\n });\\n}\",\n \"function getTreeData() {\\n\\tnew Promise((resolve, reject) => {\\n\\t\\t\\tutil.getData(srcPath, resolve, reject, 1, rules)\\n\\t\\t})\\n\\t\\t.then(arr => start(arr))\\n\\t\\t.catch(err => console.error(err))\\n}\",\n \"function initiateFeatures() {\\r\\n\\tfeatures = [];\\r\\n\\tfor (var i = featuresNames.length - 1; i >= 0; i--) {\\r\\n\\t\\tlet feature = {\\r\\n\\t\\t\\tname: featuresNames[i],\\r\\n\\t\\t\\tHTMLbutton: $(\\\"#button-feature\\\" + i)[0],\\r\\n\\t\\t\\tHTMLelement: $(\\\"#feature\\\" + i)[0]};\\r\\n\\t\\tfeatures.push(feature);\\r\\n\\t}\\r\\n}\",\n \"function readCustomFeatures(options) {\\n return getCustomFeatureXmlFilenames(options.paths.featureXmlDir)\\n .then(function (filenames) {\\n return getCustomFiles(options.paths.featureXmlDir)\\n .then(function (files) {\\n return {\\n files: files,\\n customFeatureFilepath: filenames\\n };\\n });\\n });\\n}\",\n \"function get_all_loads(){\\n const q = datastore.createQuery(LOADS);\\n return datastore.runQuery(q).then( (entities) =>{\\n return entities[0].map(fromDatastore);\\n });\\n}\",\n \"toDataSourceEntities(options = {}, promiseCallback = () => {}) {\\n let dataSource = new cesium.GeoJsonDataSource();\\n let promise = dataSource.load(this.json, options);\\n\\n promise.then(function (dataSource) {\\n let entities = dataSource.entities.values;\\n for (let i = 0; i < entities.length; i++) {\\n promiseCallback(entities[i]);\\n }\\n });\\n }\",\n \"loadFromFile(path, callback){\\n\\t\\tfs.readFile(path, 'utf8', function(err, data){\\n\\t\\t\\tif(err){\\n\\t\\t\\t\\tconsole.log(err);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\t//data is the string returned by fs's readFile function.\\n\\t\\t\\tlet newData = JSON.parse(data);\\n\\n\\t\\t\\tthis.idIterator = newData.idIterator;\\n\\t\\t\\tthis.currentFeature = newData.currentFeature;\\n\\t\\t\\tthis.geo = newData.geo;\\n\\t\\t\\tcallback();\\n\\t\\t}.bind(this))\\n\\t}\",\n \"function getFragLocs(uris) {\\n if (uris)\\n return Promise.all(uris.map(uri => \\n\\t {console.log(\\\"GETLOC:\\\", uri)\\n return ( getTurtle(uri)\\n .then(store => {\\n const fragnode = store.any(rdf.sym(uri), REMIX(\\\"fragment\\\"), undefined)\\n\\t\\t console.log(uri, fragnode)\\n return Promise.resolve(getNodeURI(fragnode))\\n })\\n\\t .catch(e=>{console.log(e);return Promise.resolve(undefined)})\\n\\t\\t )}\\n ))\\n else return Promise.resolve([])\\n}\",\n \"async features() {\\n const res = await this.sendIgnoringError(\\\"FEAT\\\");\\n const features = new Map();\\n // Not supporting any special features will be reported with a single line.\\n if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) {\\n // The first and last line wrap the multiline response, ignore them.\\n res.message.split(\\\"\\\\n\\\").slice(1, -1).forEach(line => {\\n // A typical lines looks like: \\\" REST STREAM\\\" or \\\" MDTM\\\".\\n // Servers might not use an indentation though.\\n const entry = line.trim().split(\\\" \\\");\\n features.set(entry[0], entry[1] || \\\"\\\");\\n });\\n }\\n return features;\\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 load(indexRootUrl, searchHint) {\\n const enumValueIds = searchHint;\\n const promises = enumValueIds.map(async (valueId) => {\\n const value = this.values[valueId];\\n if (value.dataRowIds)\\n return Promise.resolve();\\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\\n dynamicTyping: true,\\n header: true\\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\\n value.dataRowIds = promise;\\n return promise;\\n });\\n await Promise.all(promises);\\n }\",\n \"get feature() { return features.findById(this.get()); }\",\n \"static loadGenres() {\\n // Returns a new promise to the user\\n return new Promise((success, fail) => {\\n var genres = [] // Stores the Genre objects\\n // Reads all of the movie information\\n firebase.database().ref(\\\"items\\\").once('value').then(function(snapshot) {\\n // Explores all of the movies\\n for(var i = 0; i < snapshot.val().length; i++) {\\n var info = snapshot.val()[i] // Stores the movie info\\n var genre = info.genre; // Stores the movie's genre array\\n // Explores the genre's\\n for(var i2 = 0; i2 < genre.length; i2++) {\\n // Checks to see if the given genre is already in the genres array\\n if(genres.indexOf(genre[i2]) == -1) {\\n genres.push(genre[i2]) // Adds the entry to the genres array\\n }\\n }\\n // Checks if this is the last movie to be evaluated\\n if(i+1 == snapshot.val().length) {\\n success(genres) // Returns the genre array to the user\\n }\\n } \\n })\\n })\\n }\",\n \"async populateSensorList() {\\n\\n let url = \\\"http://air.eng.utah.edu/dbapi/api/liveSensors/\\\"+this.sensorSource;\\n if(this.sensorSource == \\\"airu\\\"){\\n url = \\\"http://air.eng.utah.edu/dbapi/api/liveSensors/airU\\\";\\n }\\n //let url = \\\"http://air.eng.utah.edu/dbapi/api/sensorsAtTime/airU&2019-01-04T22:00:00Z\\\"\\n let req = fetch(url)\\n console.log(\\\"INSIDE OF POPULATE!!!\\\",this.sensorList)\\n /* Adds each sensor to this.sensorList */\\n req.then((response) => {\\n return response.text();\\n })\\n .then((myJSON) => {\\n myJSON = JSON.parse(myJSON);\\n let sensors = [];\\n for (let i = 0; i < myJSON.length; i++) {\\n let val = {\\n id: myJSON[i].ID,\\n lat: myJSON[i].Latitude,\\n long: myJSON[i].Longitude\\n };\\n sensors.push(val)\\n }\\n\\n this.sensorList = sensors;\\n });\\n }\",\n \"function n$1(r){return r&&g.fromJSON(r).features.map((r=>r))}\",\n \"loadState() {\\n return Promise.resolve();\\n }\",\n \"async loadData() {\\n if (!this.load_data) throw new Error('no load data callback provided');\\n\\n return await Q.nfcall(this.load_data);\\n }\",\n \"async function loadEndpoints()\\n{\\n let result = [];\\n\\n const { db, sessionId } = this.global;\\n\\n const endpoints = await queryEndpoint.selectAllEndpoints(db, sessionId);\\n\\n // Selection is one by one since existing API does not seem to provide\\n // linkage between cluster and what endpoint it belongs to.\\n //\\n // TODO: there should be a better way\\n for (const endpoint of endpoints) {\\n const endpointClusters\\n = await queryEndpointType.selectAllClustersDetailsFromEndpointTypes(db, [ { endpointTypeId : endpoint.endpointTypeRef } ]);\\n result.push({...endpoint, clusters : endpointClusters.filter(c => c.enabled == 1) });\\n }\\n\\n return result;\\n}\",\n \"async getCockpitRegions() {\\n const regions = await this.getRegionNames();\\n return Promise.all(regions.map(name => {\\n var i = this.getRegionItems(name);\\n return i;\\n }));\\n }\",\n \"function loadData(data) {\\r\\n // returns a promise\\r\\n }\",\n \"function restcountries(restcountriesurl){\\r\\n return new Promise((res,rej)=>{\\r\\n let req= new XMLHttpRequest();\\r\\n req.open(\\\"GET\\\",restcountriesurl,true);\\r\\n req.addEventListener('load',function(){\\r\\n if(this.readyState===4 && this.status===200)\\r\\n res(req.responseText);\\r\\n else\\r\\n rej(\\\"unable to fetch\\\");\\r\\n })\\r\\n req.send();\\r\\n })\\r\\n}\",\n \"async function getVectorLayer() {\\n\\n let places = await fetch('/lugares/')\\n .then(resp => resp.json())\\n .then(data => data.features )\\n\\n let vectorSource = new VectorSource({\\n features: places.map(createIcon)\\n });\\n\\n let vectorLayer = new VectorLayer({\\n source: vectorSource\\n });\\n\\n return vectorLayer;\\n}\",\n \"function fetchRegions() {\\n return (dispatch, getState) => {\\n const store = getState();\\n const {\\n primaryMetricId,\\n relatedMetricIds,\\n filters,\\n currentStart,\\n currentEnd\\n } = store.primaryMetric;\\n\\n const metricIds = [primaryMetricId, ...relatedMetricIds].join(',');\\n // todo: identify better way for query params\\n return fetch(`/data/anomalies/ranges?metricIds=${metricIds}&start=${currentStart}&end=${currentEnd}&filters=${encodeURIComponent(filters)}`)\\n .then(res => res.json())\\n .then(res => dispatch(loadRegions(res)))\\n .catch(() => {\\n dispatch(requestFail());\\n });\\n\\n };\\n}\",\n \"async function getRegions() {\\n let fetchRegions = await fetch(`${APP_SERVER}/regions`, {\\n method: 'GET',\\n headers: {\\n \\\"Content-Type\\\": \\\"application/json\\\",\\n \\\"Authorization\\\": `Bearer ${token}`\\n }\\n });\\n\\n let allRegions = await fetchRegions.json();\\n let regions = allRegions.data;\\n \\n console.log(regions);\\n\\n if (regions) {\\n return regions;\\n } else {\\n console.log(\\\"[ERROR] Regions: NO REGIONS FOUND!, error msg: \\\" + regions);\\n }\\n}\",\n \"async loadGemfile() {\\n let gemfilePath = nova.workspace.config.get('rubygems.workspace.gemfileLocation')\\n let gemfileHandler = null\\n let gemfileLinesArray = []\\n\\n if (FUNCTIONS.isWorkspace()) {\\n // If no Gemfile is set in the workspace preferences, try to open one in the root directory.\\n if (gemfilePath == null) {\\n try {\\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(nova.workspace.path)}/Gemfile`)\\n } catch (error) { }\\n } else {\\n try {\\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(gemfilePath)}`)\\n } catch (error) {\\n console.log(\\n 'The \\\\'Gemfile\\\\' location set in the workspace preferences could not be found. Please check ' +\\n 'the location and try again.')\\n }\\n }\\n }\\n\\n if (gemfileHandler !== null) {\\n gemfileLinesArray = gemfileHandler.readlines()\\n gemfileHandler.close()\\n\\n this._gems = await this._evaluateGemfileLines(gemfileLinesArray)\\n }\\n\\n return this._gems\\n }\",\n \"function loadGCI() {\\n return fs.readFileSync('gci.txt','utf8')\\n }\",\n \"async function processHygrodataSeries(rawdata, pointID, marker, sourceElement, markerName, dataObj)\\r\\n{\\r\\n return new Promise((resolve, reject) => {\\r\\n // console.log(\\\"processHygrodataSeries()\\\");\\r\\n\\r\\n var lines = rawdata.split('\\\\n');\\r\\n var data = [];\\r\\n \\r\\n for(var line of lines)\\r\\n {\\r\\n var fields = line.split(',');\\r\\n \\r\\n // console.log(\\\"Line:\\\");\\r\\n // console.log(fields);\\r\\n \\r\\n if(fields.length < 2)\\r\\n {\\r\\n continue;\\r\\n }\\r\\n \\r\\n data.push(fields);\\r\\n }\\r\\n \\r\\n\\r\\n var intervals = new Array();\\r\\n\\r\\n // skip headers line\\r\\n for(let i = 1; i < data.length; i++)\\r\\n {\\r\\n // console.log(\\\"Snapshot \\\" + data[i][0]);\\r\\n\\r\\n var startDate = new Date(data[i][1], data[i][2], data[i][3], data[i][4], data[i][5], data[i][6]);\\r\\n var endInterval = new Date(startDate);\\r\\n endInterval.setSeconds(startDate.getSeconds() + 3599);\\r\\n\\r\\n var interval = new Cesium.TimeInterval(\\r\\n {\\r\\n \\\"start\\\" : Cesium.JulianDate.fromDate(startDate),\\r\\n \\\"stop\\\" : Cesium.JulianDate.fromDate(endInterval),\\r\\n \\\"isStartIncluded\\\" : true,\\r\\n \\\"isStopIncluded\\\" : false,\\r\\n // \\\"isStopIncluded\\\" : true,//false,\\r\\n // \\\"data\\\" : { \\\"temperature\\\" : data[i][7], \\\"humidity\\\" : data[i][8] }\\r\\n \\\"data\\\" : //[\\r\\n { \\r\\n \\\"element\\\" : marker,\\r\\n \\\"type\\\" : \\\"hygro\\\",\\r\\n \\\"owner\\\" : markerName,\\r\\n \\\"value\\\" : {\\r\\n \\\"temperature\\\" : data[i][7], \\\"humidity\\\" : data[i][8]\\r\\n }\\r\\n }\\r\\n //]\\r\\n }\\r\\n );\\r\\n\\r\\n // console.log(\\\"Adding interval\\\");\\r\\n intervals.push(interval);\\r\\n }\\r\\n\\r\\n // g_intervalGroups.set(sourceElement.name, new Cesium.TimeIntervalCollection(intervals));\\r\\n var intervalCollection = new Cesium.TimeIntervalCollection(intervals);\\r\\n g_intervalGroups.set(markerName, intervalCollection);\\r\\n\\r\\n dataObj.data.source = intervalCollection;\\r\\n\\r\\n // g_timeIntervals = new Cesium.TimeIntervalCollection(intervals);\\r\\n g_hygroData.set(pointID, { \\\"intervals\\\" : new Cesium.TimeIntervalCollection(intervals), \\\"marker\\\" : marker, \\\"caption\\\" : marker.label.text });\\r\\n\\r\\n resolve();\\r\\n });\\r\\n}\",\n \"function eng_gen() {\\n var condition1 = function () {\\n len_eng = corpus_eng.length;\\n // console.log(len_eng)\\n for (i = 0; i < len_eng; i++) {\\n var temp = corpus_eng[i].split(\\\"\\\\t\\\");\\n eng_ans.push(temp);\\n eng_words.add(eng_ans[i][0]);\\n }\\n }\\n $.when($.get(\\\"features_english.txt\\\", function (data_eng) { corpus_eng = data_eng.split(\\\"\\\\n\\\") })).then(condition1);\\n}\",\n \"function pollForCoremetricsReady(){\\n\\n\\t\\tvar promise = new Promise(function(resolve, reject){\\n\\n\\t\\t\\tif ( window.cmCreateElementTag && window.cm_ClientID ){\\n\\t\\t\\t\\treturn resolve( window.cmCreateElementTag );\\n\\t\\t\\t}\\n\\n\\t\\t\\tvar interval = setInterval(function(){\\n\\n\\t\\t\\t\\tif ( window.cmCreateElementTag && window.cm_ClientID ){\\n\\t\\t\\t\\t\\tclearInterval( interval );\\n\\t\\t\\t\\t\\tresolve( window.cmCreateElementTag );\\n\\t\\t\\t\\t}\\n\\t\\t\\t }, 500);\\n\\n\\t\\t});\\n\\n\\t\\treturn promise;\\n\\n\\t}\",\n \"fetchData() {\\n const url = 'http://data.unhcr.org/api/population/regions.json';\\n return fetch(url, {\\n method: 'GET',\\n })\\n .then((resp) => resp.json())\\n .then((json) => this.parseRefugeeData(json))\\n .catch((error) => Notification.logError(error, 'RefugeeCampMap.fetchData'));\\n }\",\n \"async loadIndex() {\\n const indexURL = this.config.indexURL\\n return loadIndex(indexURL, this.config, this.genome)\\n }\",\n \"featureTypeIriSelect(iri) {\\n this.props.loadingOn();\\n Actions.executeQueryForDatasetSource(\\n DatasetSourceStore.getSelectedDatasetSource().id,\\n \\\"spatial/get_feature_geometry\\\",\\n {object_type: \\\"<\\\"+iri+\\\">\\\"}\\n );\\n this.setState({value : iri,geometries:[]})\\n }\",\n \"async import(uri, options) {\\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\\\"default\\\"].createDefaultGltfOptions();\\n if (options && options.files) {\\n for (let fileName in options.files) {\\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\\\"default\\\"].getExtension(fileName);\\n if (fileExtension === 'gltf' || fileExtension === 'glb') {\\n return await this.__loadFromArrayBuffer(options.files[fileName], defaultOptions, basePath, options);\\n }\\n }\\n }\\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\\\"default\\\"].fetchArrayBuffer(uri);\\n return await this.__loadFromArrayBuffer(arrayBuffer, defaultOptions, basePath, options);\\n }\",\n \"function trackFeatures(final_track_list) {\\n return new Promise(function(resolve, reject) {\\n let xhr = new XMLHttpRequest();\\n let url = 'https://api.spotify.com/v1/audio-features';\\n xhr.open(\\\"GET\\\", url + '?ids=' + final_track_list);\\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\\n xhr.onload = () => resolve(xhr.responseText);\\n xhr.onerror = () => reject(xhr.statusText);\\n xhr.send();\\n });\\n }\",\n \"load(src=[],opts={}){\\n\\t\\t// files loaded\\n\\t\\twindow.trs.loadedScript = window.trs.loadedScript || [] \\n\\t\\treturn new Promise((resolve,reject)=>{\\n\\t\\t\\t//options\\n\\t\\t\\tlet opt=opts\\n\\t\\t\\topt.async=opts.async||false\\n\\t\\t\\topt.once=opts.once||false\\n\\n\\t\\t\\tfor(let file of src){\\n\\t\\t\\t\\t// script\\n\\t\\t\\t\\tlet sc=document.createElement('script')\\n\\t\\t\\t\\tsc.src=file\\n\\t\\t\\t\\t// attributes\\n\\t\\t\\t\\tif(opt.async) sc.setAttribute('async','')\\n\\n\\t\\t\\t\\t// mark as loaded by lazy loader func\\n\\t\\t\\t\\tif(opt.once) {\\n\\t\\t\\t\\t\\tif (window.trs.loadedScript.indexOf(file) == -1 ) {\\n\\t\\t\\t\\t\\t\\twindow.trs.loadedScript.push(file)\\n\\t\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\t\\treturn 0;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t// load\\n\\t\\t\\t\\tif(opt.module) sc.setAttribute('type','module')\\n\\t\\t\\t\\tsc.setAttribute('lazy-loaded','')\\n\\t\\t\\t\\tdocument.body.appendChild(sc)\\n\\t\\t\\t\\tresolve(sc)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t})\\n\\t}\",\n \"fetchArtifacts() {\\n const artifactLocation = getSrc(this.props.path, this.props.runUuid);\\n this.props\\n .getArtifact(artifactLocation)\\n .then((rawFeatures) => {\\n const parsedFeatures = JSON.parse(rawFeatures);\\n this.setState({ features: parsedFeatures, loading: false });\\n })\\n .catch((error) => {\\n this.setState({ error: error, loading: false, features: undefined });\\n });\\n }\",\n \"getGroupsOfaPerson() {\\n return this.#fetchAdvanced(this.#getGroupsOfPersonURL()).then((responseJSON) => {\\n let groupBOs = GroupBO.fromJSON(responseJSON);\\n return new Promise(function (resolve) {\\n resolve(groupBOs);\\n })\\n })\\n}\",\n \"async function loadFromFile (file) {\\n const deferred = createDeferred()\\n\\n const fileReader = new window.FileReader()\\n\\n fileReader.onload = onLoad\\n fileReader.onabort = () => {\\n deferred.reject(new Error(`file load interrupted: ${file}`))\\n }\\n fileReader.onerror = () => {\\n deferred.reject(new Error(`file load error: ${file}`))\\n }\\n\\n fileReader.readAsText(file)\\n\\n return deferred.promise\\n\\n function onLoad (event) {\\n const data = event.target && event.target.result\\n if (data == null) {\\n return deferred.reject(new Error(`no data in file: ${file.name}`))\\n }\\n\\n let profileData\\n try {\\n profileData = JSON.parse(data)\\n } catch (err) {\\n return deferred.reject(new Error(`file is not JSON: ${file.name}`))\\n }\\n\\n const profileInfo = ProfileInfo.create(profileData)\\n if (profileInfo == null) {\\n return deferred.reject(new Error(`file is not a V8 CPU profile: ${file.name}`))\\n }\\n\\n profileInfo.fileName = file.name\\n\\n Store.set({\\n profileInfo,\\n pkgIdSelected: null,\\n modIdSelected: null,\\n fnIdSelected: null\\n })\\n\\n deferred.resolve(profileInfo)\\n }\\n}\",\n \"async loadTokensList() {\\n return null;\\n }\",\n \"async function readFile(){\\n return new Promise((resolve,reject)=>{\\n fs.readFile('../dataset/smallDataSet.csv','utf8',(err, data)=>{\\n if(err) reject(err);\\n resolve(data);\\n });\\n })\\n}\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n\\t\\t\\tfunction ($ocLL, $q) {\\n\\t\\t\\t var promise = $q.when(1);\\n\\t\\t\\t for (var i = 0, len = _args.length; i < len; i++) {\\n\\t\\t\\t promise = promiseThen(_args[i]);\\n\\t\\t\\t }\\n\\t\\t\\t return promise;\\n\\n\\t\\t\\t function promiseThen(_arg) {\\n\\t\\t\\t if (typeof _arg == 'function')\\n\\t\\t\\t return promise.then(_arg);\\n\\t\\t\\t else\\n\\t\\t\\t return promise.then(function () {\\n\\t\\t\\t var nowLoad = requiredData(_arg);\\n\\t\\t\\t if (!nowLoad)\\n\\t\\t\\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n\\t\\t\\t return $ocLL.load(nowLoad);\\n\\t\\t\\t });\\n\\t\\t\\t }\\n\\n\\t\\t\\t function requiredData(name) {\\n\\t\\t\\t if (jsRequires.modules)\\n\\t\\t\\t for (var m in jsRequires.modules)\\n\\t\\t\\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n\\t\\t\\t return jsRequires.modules[m];\\n\\t\\t\\t return jsRequires.scripts && jsRequires.scripts[name];\\n\\t\\t\\t }\\n\\t\\t\\t}]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n\\t\\t\\tfunction ($ocLL, $q) {\\n\\t\\t\\t var promise = $q.when(1);\\n\\t\\t\\t for (var i = 0, len = _args.length; i < len; i++) {\\n\\t\\t\\t promise = promiseThen(_args[i]);\\n\\t\\t\\t }\\n\\t\\t\\t return promise;\\n\\n\\t\\t\\t function promiseThen(_arg) {\\n\\t\\t\\t if (typeof _arg == 'function')\\n\\t\\t\\t return promise.then(_arg);\\n\\t\\t\\t else\\n\\t\\t\\t return promise.then(function () {\\n\\t\\t\\t var nowLoad = requiredData(_arg);\\n\\t\\t\\t if (!nowLoad)\\n\\t\\t\\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n\\t\\t\\t return $ocLL.load(nowLoad);\\n\\t\\t\\t });\\n\\t\\t\\t }\\n\\n\\t\\t\\t function requiredData(name) {\\n\\t\\t\\t if (jsRequires.modules)\\n\\t\\t\\t for (var m in jsRequires.modules)\\n\\t\\t\\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n\\t\\t\\t return jsRequires.modules[m];\\n\\t\\t\\t return jsRequires.scripts && jsRequires.scripts[name];\\n\\t\\t\\t }\\n\\t\\t\\t}]\\n };\\n }\",\n \"function pullDatabase(){\\n return new Promise((resolve, reject) => {\\n try{\\n db.collection(\\\"Classic\\\").get().then((snapshot) => {\\n //characterArray will become filled with the documents from our Firebase database converted into Character classes\\n var characterArray = [];\\n snapshot.forEach((doc) => {\\n //console.log(doc.id, '=>', doc.data());\\n var character = doc.data();\\n characterArray.push(new Character(character.name, character.realm, character.level, character.race, character.class));\\n });\\n //returns the array of Character classes\\n resolve(characterArray);\\n })\\n .catch((err) => {\\n console.log('Error getting documents', err);\\n });\\n } catch (e){\\n reject(e);\\n }\\n }) \\n}\",\n \"listenForFeature(featuresRef) {\\n featuresRef.on('value', (dataSnapshot) => {\\n var tasks = [];\\n dataSnapshot.forEach((child) => {\\n tasks.push({\\n title: child.val().title,\\n uri: child.val().uri,\\n date: child.val().date,\\n type: child.val().type,\\n _key: child.key\\n });\\n });\\n\\n this.setState({\\n dataFeatures:tasks,\\n loading: false,\\n });\\n });\\n }\",\n \"function loadScene(url) {\\n let newObjects = [];\\n return new Promise((resolve, reject) => {\\n new GLTFLoader().load( url, \\n function (object) {\\n // On Load\\n console.log(object);\\n object.scene.children.forEach((prop, i) => newObjects[i] = prop); // Add all props from the scene into the objects array.\\n //scene.add(object.scene);\\n resolve(newObjects);\\n },\\n function (XMLHttpRequest) {\\n // On Progress\\n console.log(\\\"Loading Scene... \\\", XMLHttpRequest);\\n },\\n function (err) {\\n // On Error\\n console.log(err);\\n reject(err);\\n });\\n });\\n }\",\n \"async function getDataset() {\\n const [dataset, perfTimes] = await fetchMorpheusJson(\\n studyAccession,\\n genes,\\n cluster,\\n annotation.name,\\n annotation.type,\\n annotation.scope,\\n subsample\\n )\\n logFetchMorpheusDataset(perfTimes, cluster, annotation, genes)\\n return dataset\\n }\",\n \"function readIndividualFeatures(egoCenter, callback) {\\n console.log(\\\" - - Reading individual features.\\\");\\n var data = fs.readFileSync(\\\"../data/\\\" + egoCenter + \\\".feat\\\", 'utf8');\\n var featureArray = data.split(\\\"\\\\n\\\");\\n for (var feature of featureArray) {\\n var spaceIndex = feature.indexOf(\\\" \\\");\\n if (spaceIndex > 0) {\\n individualFeatures[feature.substring(0, spaceIndex)] = feature.substring(spaceIndex + 1, feature.length).split(\\\" \\\");\\n }\\n }\\n}\",\n \"function init(count) {\\n var count = count || 1\\n var promise = new Promise((resolve, reject) => {\\n getLookupData(odsaStore)\\n .then((lookups) => {\\n getTimeTrackingData(odsaStore, lookups, count)\\n .then((vizData) => {\\n $('#reload_data').show()\\n $('#generate_data').show()\\n $('.accordionjs').show()\\n initViz(vizData, lookups)\\n .then(() => {\\n $(\\\"#tools-accordion\\\").accordionjs({ activeIndex: false, closeAble: true })\\n $(\\\"#tools-accordion-exs\\\").accordionjs({ activeIndex: false, closeAble: true })\\n initExTools(lookups)\\n resolve()\\n })\\n })\\n .catch((err) => {\\n console.log(err)\\n errDialog(err)\\n })\\n })\\n .catch((err) => {\\n console.log(err)\\n errDialog(err)\\n })\\n })\\n return promise\\n }\",\n \"function resolvePromises() {\\n resolvePromisesFn(autoflow);\\n }\",\n \"function fetchCountries(){\\n console.log('IMonData: [Countries] Fetching data..');\\n var store = new Store();\\n var futures = [];\\n var baseUrl = 'https://thenetmonitor.org/v2/countries';\\n\\n var fut = HTTP.get.future()(baseUrl, { timeout: Settings.timeout*3 });\\n futures.push(fut);\\n var results = fut.wait();\\n store.sync(results.data);\\n _.each(results.data.data, function(d){\\n store.sync(d.relationships.data_points);\\n });\\n\\n console.log('IMonData: [Countries] Data fetched.');\\n Future.wait(futures);\\n\\n var insert = function(){\\n console.log('IMonData: [Countries] Inserting...');\\n _.each(store.findAll('countries'), insertCountryData);\\n console.log('IMonData: [Countries] Inserted.');\\n };\\n\\n Future.task(insert);\\n\\n}\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadfloodIncidentlayer(floodincidentdata){\\r\\nfloodincidentjson = JSON.parse(floodincidentdata);\\r\\n\\r\\nvar features = []; \\r\\nfeatures = floodincidentjson.features; \\r\\nvar jproperties = floodincidentjson.features.map(function (el) { return el.properties; });\\r\\nvar i;\\r\\nfor (i = 0; i < jproperties.length; i++) { \\r\\n\\tfloodincarray.push(Object.values(jproperties[i]));\\r\\n}\\r\\n\\r\\n}\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg === 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\r\\n var _args = arguments;\\r\\n return {\\r\\n deps: ['$ocLazyLoad', '$q',\\r\\n\\t\\t\\tfunction ($ocLL, $q) {\\r\\n\\t\\t\\t var promise = $q.when(1);\\r\\n\\t\\t\\t for (var i = 0, len = _args.length; i < len; i++) {\\r\\n\\t\\t\\t promise = promiseThen(_args[i]);\\r\\n\\t\\t\\t }\\r\\n\\t\\t\\t return promise;\\r\\n\\r\\n\\t\\t\\t function promiseThen(_arg) {\\r\\n\\t\\t\\t if (typeof _arg == 'function')\\r\\n\\t\\t\\t return promise.then(_arg);\\r\\n\\t\\t\\t else\\r\\n\\t\\t\\t return promise.then(function () {\\r\\n\\t\\t\\t var nowLoad = requiredData(_arg);\\r\\n\\t\\t\\t if (!nowLoad)\\r\\n\\t\\t\\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\\r\\n\\t\\t\\t return $ocLL.load(nowLoad);\\r\\n\\t\\t\\t });\\r\\n\\t\\t\\t }\\r\\n\\r\\n\\t\\t\\t function requiredData(name) {\\r\\n\\t\\t\\t if (jsRequires.modules)\\r\\n\\t\\t\\t for (var m in jsRequires.modules)\\r\\n\\t\\t\\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\r\\n\\t\\t\\t return jsRequires.modules[m];\\r\\n\\t\\t\\t return jsRequires.scripts && jsRequires.scripts[name];\\r\\n\\t\\t\\t }\\r\\n\\t\\t\\t}]\\r\\n };\\r\\n }\",\n \"function initFeatureList() {\\n var task = $(parameterAnalysisDateId).val();\\n if (task) {\\n $(featureListId).multiselect({\\n dropRight: true,\\n buttonWidth: \\\"100%\\\",\\n enableFiltering: true,\\n enableCaseInsensitiveFiltering: true,\\n nonSelectedText: \\\"请选择Feature\\\",\\n filterPlaceholder: \\\"搜索\\\",\\n nSelectedText: \\\"项被选中\\\",\\n includeSelectAllOption: true,\\n selectAllText: \\\"全选/取消全选\\\",\\n allSelectedText: \\\"已选中所有平台类型\\\",\\n maxHeight: 200,\\n width: 220\\n });\\n var url = \\\"paramQuery/getFeatureList\\\";\\n $.ajax({\\n type: \\\"post\\\",\\n url: url,\\n data: { db: task },\\n dataType: \\\"json\\\",\\n success: function(data) {\\n var newOptions = [];\\n var obj = {};\\n $(data).each(function(k, v) {\\n v = eval(\\\"(\\\" + v + \\\")\\\");\\n obj = {\\n label: v.text,\\n value: v.value\\n };\\n newOptions.push(obj);\\n });\\n obj = {\\n label: \\\"未知\\\",\\n value: \\\"unknow\\\"\\n };\\n newOptions.push(obj);\\n $(featureListId).multiselect(\\\"dataprovider\\\", newOptions);\\n // $(featureListId).multiselect(\\\"disable\\\");\\n }\\n });\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6543959","0.61009336","0.590788","0.5869675","0.5767293","0.5726963","0.571669","0.5531802","0.54262996","0.5398379","0.53473455","0.52430815","0.5231676","0.5218503","0.5158587","0.5131139","0.5100868","0.5091692","0.50904274","0.50904274","0.5066121","0.5030894","0.50205815","0.50121015","0.4995787","0.49709815","0.4954698","0.4903145","0.4888073","0.4870576","0.48394224","0.48369497","0.47862184","0.47640306","0.47605303","0.47550443","0.47379023","0.4725368","0.47064677","0.4700897","0.4699966","0.4689712","0.4684454","0.46830428","0.46706071","0.46680006","0.4654902","0.46513668","0.4646964","0.4645155","0.46227476","0.46191597","0.45884728","0.45834622","0.45825723","0.45802325","0.45789054","0.45763195","0.45749685","0.45742044","0.45735636","0.45717853","0.4564178","0.45568419","0.45554277","0.45536968","0.45415452","0.45397845","0.4538857","0.453596","0.45329422","0.45301467","0.45219454","0.4506677","0.45028457","0.44986036","0.44982794","0.44976354","0.44851112","0.4478376","0.44738004","0.44733146","0.44722688","0.44722688","0.44712955","0.44680148","0.44593385","0.44573885","0.44570327","0.4456358","0.4450548","0.44487303","0.44476095","0.44476095","0.44476095","0.44476095","0.4447106","0.44455063","0.4443717","0.4435947"],"string":"[\n \"0.6543959\",\n \"0.61009336\",\n \"0.590788\",\n \"0.5869675\",\n \"0.5767293\",\n \"0.5726963\",\n \"0.571669\",\n \"0.5531802\",\n \"0.54262996\",\n \"0.5398379\",\n \"0.53473455\",\n \"0.52430815\",\n \"0.5231676\",\n \"0.5218503\",\n \"0.5158587\",\n \"0.5131139\",\n \"0.5100868\",\n \"0.5091692\",\n \"0.50904274\",\n \"0.50904274\",\n \"0.5066121\",\n \"0.5030894\",\n \"0.50205815\",\n \"0.50121015\",\n \"0.4995787\",\n \"0.49709815\",\n \"0.4954698\",\n \"0.4903145\",\n \"0.4888073\",\n \"0.4870576\",\n \"0.48394224\",\n \"0.48369497\",\n \"0.47862184\",\n \"0.47640306\",\n \"0.47605303\",\n \"0.47550443\",\n \"0.47379023\",\n \"0.4725368\",\n \"0.47064677\",\n \"0.4700897\",\n \"0.4699966\",\n \"0.4689712\",\n \"0.4684454\",\n \"0.46830428\",\n \"0.46706071\",\n \"0.46680006\",\n \"0.4654902\",\n \"0.46513668\",\n \"0.4646964\",\n \"0.4645155\",\n \"0.46227476\",\n \"0.46191597\",\n \"0.45884728\",\n \"0.45834622\",\n \"0.45825723\",\n \"0.45802325\",\n \"0.45789054\",\n \"0.45763195\",\n \"0.45749685\",\n \"0.45742044\",\n \"0.45735636\",\n \"0.45717853\",\n \"0.4564178\",\n \"0.45568419\",\n \"0.45554277\",\n \"0.45536968\",\n \"0.45415452\",\n \"0.45397845\",\n \"0.4538857\",\n \"0.453596\",\n \"0.45329422\",\n \"0.45301467\",\n \"0.45219454\",\n \"0.4506677\",\n \"0.45028457\",\n \"0.44986036\",\n \"0.44982794\",\n \"0.44976354\",\n \"0.44851112\",\n \"0.4478376\",\n \"0.44738004\",\n \"0.44733146\",\n \"0.44722688\",\n \"0.44722688\",\n \"0.44712955\",\n \"0.44680148\",\n \"0.44593385\",\n \"0.44573885\",\n \"0.44570327\",\n \"0.4456358\",\n \"0.4450548\",\n \"0.44487303\",\n \"0.44476095\",\n \"0.44476095\",\n \"0.44476095\",\n \"0.44476095\",\n \"0.4447106\",\n \"0.44455063\",\n \"0.4443717\",\n \"0.4435947\"\n]"},"document_score":{"kind":"string","value":"0.6294286"},"document_rank":{"kind":"string","value":"1"}}},{"rowIdx":74,"cells":{"query":{"kind":"string","value":"Return a Promise for the async loaded index"},"document":{"kind":"string","value":"async loadIndex() {\n const indexURL = this.config.indexURL\n return loadIndex(indexURL, this.config, this.genome)\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 getCurentIndex() {\n\n this.check()\n return await this.storage.loadIndex()\n }","async loadIndex() {\n const indexURL = this.config.indexURL;\n let indexFilename;\n if (isFilePath(indexURL)) {\n indexFilename = indexURL.name;\n } else {\n const uriParts = parseUri(indexURL);\n indexFilename = uriParts.file;\n }\n const isTabix = indexFilename.endsWith(\".tbi\") || this.filename.endsWith('.gz') || this.filename.endsWith('.bgz')\n let index;\n if (isTabix) {\n index = await loadBamIndex(indexURL, this.config, true, this.genome);\n } else {\n index = await loadTribbleIndex(indexURL, this.config, this.genome);\n }\n return index;\n }","async function getIndexes() {\n return await fetch('https://api.coingecko.com/api/v3/indexes').then(res => res.json());\n }","static loadProjectIndex(projectId) {\n return Promise( (resolve, reject) => {\n const url = ProjectIndex.APIUrlForProject(projectId);\n fetch(url).then( (response) => {\n if (response.status !== 200) reject(response.status);\n try {\n const json = response.json();\n const index = new ProjectIndex(\"/\", json.project);\n resolve(index);\n } catch (error) {\n reject(error);\n }\n })\n }\n\n static APIUrlForProject(projectId) {\n return `/API/getProjectIndex/${projectId}`;\n }","function load() {\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\n .then(function(result) {\n console.log('load results')\n tree = result[0];\n dbIndex = new Index(result[1]);\n entries = result[2];\n });\n}","async function loadData() {\n // Get the health of the connection\n let health = await connection.checkConnection();\n\n // Check the status of the connection\n if (health.statusCode === 200) {\n // Delete index\n await connection.deleteIndex().catch((err) => {\n console.log(err);\n });\n // Create Index\n await connection.createIndex().catch((err) => {\n console.log(err);\n });\n // If index exists\n if (await connection.indexExists()) {\n const parents = await rest.getRequest(rest.FlaskUrl + \"/N\");\n // If parents has the property containing the files\n if (parents.hasOwnProperty(\"data\")) {\n //Retrieve the parent list\n let parrentArray = parents.data;\n\n // Get amount of parents\n NumberOfParents = parrentArray.length;\n console.log(\"Number of parents to upload: \" + NumberOfParents);\n // Each function call to upload a JSON object to the index\n // delayed by 50ms\n parrentArray.forEach(delayedFunctionLoop(uploadParentToES, 50));\n }\n }\n } else {\n console.log(\"The connection failed\");\n }\n}","function getIndexId() {\n return new Promise((resolve, reject) => {\n fs.readFile(INDEX_FILE, (err, data) => {\n if (err || data === undefined) {\n reject(err);\n } else {\n const json = JSON.parse(data);\n resolve(json.id);\n }\n });\n });\n}","prepareIndiceForUpdate(indexData) {\n return Promise.resolve();\n }","getActIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this._handleApiCall(`${this.gameBaseUrlPath}/act`, 'Error fetching the act index.');\n });\n }","async fetchExistingRecords () {\n const client = getAlgoliaClient()\n\n // return an empty array if the index does not exist yet\n const { items: indices } = await client.listIndices()\n\n if (!indices.find(index => index.name === this.name)) {\n console.log(`index '${this.name}' does not exist!`)\n return []\n }\n\n const index = client.initIndex(this.name)\n let records = []\n\n await index.browseObjects({\n batch: batch => (records = records.concat(batch))\n })\n\n return records\n }","async do(headers = {}) {\n\t\tlet res = await this.c.get(\"/v2/assets/\" + this.index, {}, headers);\n\t\treturn res.body;\n\t}","function index() {\n\n return resource.fetch()\n .then(function(data){ return data; });\n }","getByIndex(storeName, indexName, key) {\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.get(key);\n request.onsuccess = (event) => {\n resolve(event.target.result);\n };\n })\n .catch((reason) => reject(reason));\n }));\n }","async init() {\n var that = this;\n\n var promise = new Promise(function(resolve, reject) {\n\n var req = indexedDB.open(that.db_name, that.version);\n\n req.onupgradeneeded = function(event) {\n that.database = event.target.result;\n //run callback method in createTable to add a new object table\n that.upgrade();\n };\n\n req.onsuccess = function (event) {\n that.database = event.target.result;\n resolve();\n };\n\n req.onerror = function (error) {\n if (req.error.name === \"VersionError\") {\n //we can never be sure what version of the database the client is on\n //therefore in the event that we request an older version of the db than the client is on, we will need to update the js version request on runtime\n that.version++;\n\n //we need to initiate a steady increment of promise connections that either resolve or reject\n that.init()\n .then(function() {\n //bubble the result\n resolve();\n })\n .catch(function() {\n //bubble the result: DOESNT WORK?\n reject();\n });\n } else {\n console.error(error);\n }\n };\n });\n return promise;\n }","async function getIndex() {\n const contents = fs.readdirSync(`./${ipfs.host}/`);\n iLog('Trying to load indices from local files ...');\n for (i in contents) {\n if (contents[i][0] === 'i' && !fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\n const indexFile = fs.readFileSync(`./${ipfs.host}/${contents[i]}`);\n const indexDump = JSON.parse(indexFile);\n global.indices[contents[i].substr(5,contents[i].length-10)] = elasticlunr.Index.load(indexDump);\n }\n }\n try {\n await fs.statSync(`./${ipfs.host}/hostedFiles.json`);\n global.ipfsearch.hostedFiles = JSON.parse(await fs.readFileSync(`./${ipfs.host}/hostedFiles.json`));\n } catch (e) { }\n if (Object.keys(global.indices).length === 0) {\n // file does not exist, create fresh index\n iLog('No local indices exist, generating new index files ...');\n const contents = fs.readdirSync(`./${ipfs.host}/`);\n for (i in contents) {\n if (fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\n global.indices[contents[i]] = createIndex();\n await readFilesIntoObjects(contents[i], `./${ipfs.host}/${contents[i]}`);\n // save the index\n await saveIndex(global.indices[contents[i]], `./${ipfs.host}/index${contents[i]}.json`);\n }\n }\n }\n}","function readIndexJson() {\n return new Promise((resolve, reject) => {\n fs.readFile(INDEX_FILE, (err, data) => {\n if (err) reject(err);\n const json = JSON.parse(data);\n const promises = [];\n Object.keys(json).forEach((lang) => {\n if (LANG_SUPPORTED.includes(lang)) {\n promises.push(getJson(json[lang].raw.DestinyStatDefinition, `${STAT_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].raw.DestinyClassDefinition, `${CLASS_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].items.Mod, `${MOD_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].raw.DestinyInventoryBucketDefinition, `${BUCKET_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].items.Armor, `${ARMOR_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].items.Weapon, `${WEAPON_DIR}/${lang}.json`));\n }\n });\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch((pErr) => {\n console.log(pErr);\n reject(pErr);\n });\n });\n });\n}","function loadIndex() {\n\tvar indexRequest = new XMLHttpRequest();\n\tindexRequest.open(\"GET\", \"https://mustang-index.azurewebsites.net/index.json\");\n\tindexRequest.onload = function() {\n\t\tconsole.log(\"Index JSON file:\" + indexRequest.responseText);\n\t\tcontactIndex = JSON.parse(indexRequest.responseText);\n\t\tcontactURLArray.length = 0;\n\t\tfor(i = 0; i < contactIndex.length; i++) {\n\t\t\tcontactURLArray.push(contactIndex[i].ContactURL);\n\t\t}\n\t\tconsole.log(\"ContactURLArray: \" + JSON.stringify(contactURLArray));\n\t\trenderIndex(contactIndex);\n\t\tshowSnackbar(\"Index loaded\");\n\t}\n\tindexRequest.send();\n}","async load(indexRootUrl, searchHint) {\n const enumValueIds = searchHint;\n const promises = enumValueIds.map(async (valueId) => {\n const value = this.values[valueId];\n if (value.dataRowIds)\n return Promise.resolve();\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\n dynamicTyping: true,\n header: true\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\n value.dataRowIds = promise;\n return promise;\n });\n await Promise.all(promises);\n }","async createIndexJson(url) {\n \treturn this.rs.readFolder(url).then(folder => {\n \t\tvar promises = [];\n \t\tthis.index = {};\n \t\tif (folder.files.length == 0) {\n \t\t\tpromises.push(this.index)\n \t\t} else {\n\t\t\t\tlet i\n\t\t\t\t\tfor ( i = 0; i < folder.files.length ; i ++) {\n\t\t\t\t\t\tlet file = folder.files[i].name.split(\".\");\n\t\t\t\t\t\tif (file.pop() == \"ttl\") {\n\t\t\t\t\t\t\tvar title = file.join(\".\")\n\t\t\t\t\t\t\tpromises.push(\n\t\t\t\t\t\t\tthis.rs.rdf.query(url+title+\".ttl\")\n\t\t\t\t\t\t\t.then(queryRes => {\n\t\t\t\t\t\t\t\tthis.jsonTiddler(queryRes)\n\t\t\t\t\t\t\t\tdelete this.tiddlerJson[\"text\"]\n\t\t\t\t\t\t\t\tthis.index[this.tiddlerJson[\"title\"]] = this.tiddlerJson;\n\t\t\t\t\t\t\t},err => {alert(\"title \"+err)})\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}\n\t\t\t\treturn Promise.all(promises).then( success => {\n\t\t\t\t\treturn this.index\n\t\t\t},err => {alert(\"Are some .ttl files not tiddlers ??? \\n\"+err)})\n \t})\n }","function load(index) {\n return loadInternal(index, viewData);\n}","indexPage(req) {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }","prepareIndiceForInstall(indexData) {\n return Promise.resolve();\n }","getCachedDataByIndex(storename, index, key) {\n return this.cache.then((db) => {\n return db.transaction(storename).objectStore(storename).index(index).getAll(key);\n });\n }","_updateIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n //creates index file if it doesn't already exist\n let inCouch = yield this._isInCouch(\"index\", \"index\");\n if (!inCouch) {\n yield this.couchdb.createDatabase(\"index\");\n yield this.couchdb.createDocument(\"index\", {}, \"index\");\n }\n let data = yield readFile(path.join(this.localRepoPath, \"/EventIndex.json\"), \"utf8\");\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\"'));\n let events = json[\"Events\"];\n events.sort(function (a, b) {\n return Date.parse(b.StartDate) - Date.parse(a.StartDate);\n });\n let couchDocument = yield this.couchdb.getDocument(\"index\", \"index\");\n yield this.couchdb.createDocument(\"index\", { Events: events, \"_rev\": couchDocument.data[\"_rev\"] }, \"index\");\n });\n }","async getLoadOperation() {}","function loadIndex() {\n var idxFile = this.indexURL;\n\n if (this.filename.endsWith(\".gz\")) {\n if (!idxFile) idxFile = this.url + \".tbi\";\n return igv.loadBamIndex(idxFile, this.config, true);\n } else {\n if (!idxFile) idxFile = this.url + \".idx\";\n return igv.loadTribbleIndex(idxFile, this.config);\n }\n }","loadIndexPage () {\n return Promise.resolve(Request.httpGet(this.SiteUrl + this.DefaultPrefix, this.CharSet).then(res => {\n let $ = cheerio.load(res.text);\n let Navis = $('#sliderNav > li');\n let Uid = new Date().getTime();\n Navis.each((i, elem) => {\n let _this = $(elem);\n let _ChildNodes = _this.find('> ul >li');\n let _SiteUrl = _this.find('>a').attr('href');\n if (_SiteUrl === './') {\n _SiteUrl = '../ssxx/'\n }\n\n let _SiteReg = /^javascript:/ig;\n this.ListNavis.push({\n Uid: `${Uid}${i}`,\n Section: _this.find('> a >span:first-child').text(),\n SiteUrl: _SiteReg.test(_SiteUrl) ? '' : _SiteUrl,\n HasChild: _ChildNodes && _ChildNodes.length > 0,\n ChildNodes: _ChildNodes && _ChildNodes.toArray().map((item, index) => {\n let _node = $(item).find('a');\n let _group = _node.text();\n let _uid = this.GroupDefine.has(_group) && this.GroupDefine.get(_group) || this.GroupDefine.set(_group, `${new Date().getTime()}${i}`).get(_group);\n return {\n Uid: _uid,\n Group: _node.text(),\n SiteUrl: _node.attr('href')\n };\n })\n });\n });\n\n /*保存首页数据*/\n Request.saveJsonToFile(this.ListNavis, 'index.json', this.Group, [...this.GroupDefine]);\n }).catch(err => {\n console.error(err);\n }));\n }","fetchIndex(){\n return this.http.fetch('data/index.json?t=' + new Date().getTime())\n .then(response=>{\n //convert text to json\n return response.json()\n })\n .then(json=>{\n let infos = json;\n return infos;\n });\n }","function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new index_es(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n index_es.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n }).catch(function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}","function page(index) {\n var item = internal.loader.info(index),\n res;\n if (item) {\n res = {\n index: item.index,\n data: item.cached,\n loading: item.queued || item.loading || item.waiting,\n cancel: item.cancel\n };\n } else {\n res = null;\n }\n return res;\n }","getAddressIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_address_index\");\n });\n }","async beginIndexRequest() {\n const keyString = this.idsToIndex.shift();\n const provider = this;\n\n this.pendingRequests += 1;\n const identifier = await this.openmct.objects.parseKeyString(keyString);\n const domainObject = await this.openmct.objects.get(identifier.key);\n delete provider.pendingIndex[keyString];\n try {\n if (domainObject) {\n await provider.index(identifier, domainObject);\n }\n } catch (error) {\n console.warn('Failed to index domain object ' + keyString, error);\n }\n\n setTimeout(function () {\n provider.pendingRequests -= 1;\n provider.keepIndexing();\n }, 0);\n }","indexCountry() {\n return new Promise(function (resolve, reject) {\n logger.info('indexCountry() Initiated')\n let sql = sqlObj.dashboardStatus.indexCountry;\n dbInstance.doRead(sql)\n .then(result => {\n logger.info('indexCountry() Exited Successfully')\n resolve(result);\n })\n .catch(err => {\n logger.error('indexCountry() Error')\n reject(err);\n })\n })\n }","async getBlockByIndex() {\r\n this.server.route({\r\n method: 'GET',\r\n path: '/api/block/{index}',\r\n handler: async (request, h) => {\r\n let block = await this.blockChain.getBlock(request.params.index);\r\n if(!block){\r\n throw Boom.notFound(\"Block not found.\");\r\n }else{\r\n return block;\r\n }\r\n }\r\n });\r\n }","function load(index) {\n return loadInternal(getLView(), index);\n}","function load(index) {\n return loadInternal(getLView(), index);\n}","async load () {}","function asyncGet() {\n return new Promise(function (success, fail) {\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", rootURL + \"list\", true);\n xhr.onload = () => {\n if (xhr.status === 200)\n success(JSON.parse(xhr.responseText));\n else fail(alert(xhr.statusText));\n };\n xhr.onerror = () => fail(alert(xhr.statusText));\n xhr.send();\n });\n}","async index () {\n const transactions = await Transaction.all();\n return transactions;\n }","async index () {\n const abastecimento = await Abastecimento.all();\n\n return abastecimento;\n }","initDB(tables) {\n let self = this;\n return new Promise(function (resolve, reject) {\n let req = self.indexDbApi.open(self.dbName, self.dbV);\n let db;\n let tableNames = Object.keys(tables);\n let tableIndexes = Object.values(tables);\n\n req.onerror = function (e) {\n console.log('DB init Error');\n reject(e);\n };\n req.onsuccess = function (e) {\n db = e.target.result;\n console.log('DB init Success');\n setTimeout(function () {\n resolve(db);\n }, 100);\n };\n req.onupgradeneeded = function (e) {\n db = e.target.result;\n let store;\n for (let i = 0; i < tableNames.length; i++) {\n if (!db.objectStoreNames.contains(tableNames[i])) {\n store = db.createObjectStore(tableNames[i], {keyPath: self.keyPath, autoIncrement: false});\n console.log('TABLE ' + tableNames[i] + ' created Success');\n }\n for (let j = 0; j < tableIndexes[i].length; j++) {\n store.createIndex(tableIndexes[i][j][0], tableIndexes[i][j][0], {unique: tableIndexes[i][j][1]});\n }\n }\n console.log(\"onupgradeneeded\");\n };\n });\n\n }","function syncIt() {\n return getIndexedDB()\n .then(sendToServer)\n .catch(function(err) {\n return err;\n })\n}","_nextLoadHandler(handlers, index=0) {\n return utils.promise.result(this._executeLoadHandler(handlers[index]))\n .then(() => ++index === handlers.length ? Promise.resolve() : this._nextLoadHandler(handlers, index));\n }","function syncDatabaseIndexDB() {\n\n //initialises the indexedDB database\n initDatabase();\n\n fetch('/index/events')\n .then(response => {\n return response.json();\n })\n .then(events => {\n clearEvent();\n addEvents(events);\n })\n .catch(err => {\n\n });\n fetch('/index/stories')\n .then(response => {\n return response.json();\n })\n .then(stories => {\n clearStory();\n addStories(stories)\n //console.log(events);\n })\n .catch(err => {\n\n });\n}","function getIndex(){\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", '/getIndex', true);\n xhr.onreadystatechange= function() {\n if (this.readyState!==4) return; // not ready yet\n if (this.status===200) { // HTTP 200 OK\n index =this.response;\n getRetrieve();\n } else {\n alert(\"not working!\");\n }\n };\n xhr.send(null);\n}","checkIndex(indexName) {\n return this.indexExists(indexName)\n .then(found => found ? Promise.resolve() : Promise.reject(new errors.InternalServerError('Index not created.')));\n }","function dbIndexQuery(index, indexName){\n var tx = dbRequest.result.transaction('task')\n var store = tx.objectStore('task');\n const statusIndex= store.index(index);\n const getStatus=statusIndex.getAll(indexName);\n\n getStatus.onsuccess=(e)=>{\n\n let web= e.target.result\n let webKey=getStatus.key\n web.map((pend)=>{\n createLi(pend.time,pend.task,pend.status,activityDisplay)\n console.log(web)\n\n })\n }\n }","getPairsIndex() {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n return yield this.getRestData('/pairs');\n });\n }","function testFunc(index) {\n return new Promise(function (resolve) {\n setTimeout(() => resolve(index), Math.random() * 11);\n });\n}","indexExists(indexName) {\n return new Promise((resolve, reject) => {\n this.client.indices.exists({index: indexName}, (err, found) => {\n if (err) reject(err);\n resolve(found);\n });\n });\n }","function DISABLEDsetup_database_objects_table_async(indexedDbName, objectStoreName, keyId_json_path,table_id, node, table_conf, header_conf,column_conf) {\n\n\t/*\n\t * indexedDbName\n\t * objectStore\n\t * \n\t * \n\t */\n\ttry {\n\t return new Promise(\n\t\t function (resolve, reject) {\n\n\t\n//var table_conf = JSON.parse(JSON.stringify(t));\n//var header_conf = JSON.parse(JSON.stringify(h));\n//var column_conf = JSON.parse(JSON.stringify(c));\n\n\nconsole.debug(\"# setup_database_objects_table\" );\n //console.debug(\"objectStore: \" + objectStoreName);\n//console.debug(\"indexedDbName: \" + indexedDbName);\n // console.debug(\"node: \" + JSON.stringify(node));\n\t\n //console.debug(\"table_conf: \" + JSON.stringify(table_conf));\n //console.debug(\"header_conf: \" + JSON.stringify(header_conf));\n //console.debug(\"column_conf: \" + JSON.stringify(column_conf));\n\n \n // ##########\n // list all objects in db\n // ##########\n\n\n // var table_obj = createTable(table_conf, key);\n\n var div_table_obj = document.createElement(\"div\");\n div_table_obj.setAttribute(\"class\", \"tableContainer\");\n var table_obj = document.createElement(\"table\");\n\n table_obj.setAttribute(\"class\", \"scrollTable\");\n table_obj.setAttribute(\"width\", \"100%\");\n table_obj.setAttribute(\"id\", table_id);\n table_obj.setAttribute(\"indexedDbName\", indexedDbName);\n table_obj.setAttribute(\"objectStoreName\", objectStoreName);\n \n\n div_table_obj.appendChild(table_obj);\n\n var thead = document.createElement(\"thead\");\n thead.setAttribute(\"class\", \"fixedHeader\");\n thead.appendChild(writeTableHeaderRow(header_conf));\n\n table_obj.appendChild(thead);\n\n node.appendChild(table_obj);\n\n var tbody = document.createElement(\"tbody\");\n tbody.setAttribute(\"class\", \"scrollContent\");\n \n node.appendChild(tbody);\n\n var dbRequest = indexedDB.open(indexedDbName);\n dbRequest.onerror = function (event) {\n reject(Error(\"Error text\"));\n };\n\n dbRequest.onupgradeneeded = function (event) {\n // Objectstore does not exist. Nothing to load\n event.target.transaction.abort();\n reject(Error('Not found'));\n };\n\n \n dbRequest.onsuccess = function (event) {\n var database = event.target.result;\n var transaction = database.transaction(objectStoreName, 'readonly');\n var objectStore = transaction.objectStore(objectStoreName);\n\n if ('getAll' in objectStore) {\n // IDBObjectStore.getAll() will return the full set of items\n // in our store.\n objectStore.getAll().onsuccess = function (event) {\n const res = event.target.result;\n // console.debug(res);\n for (const url of res) {\n\n const tr = writeTableRow(url, column_conf, keyId_json_path);\n\n // create add row to table\n\n tbody.appendChild(tr);\n\n }\n\n };\n // add a line where information on a new key can be added to\n // the database.\n // document.querySelector(\"button.onAddDecryptionKey\").onclick\n // = this.onAddDecryptionKey;\n\n } else {\n // Fallback to the traditional cursor approach if getAll\n // isn't supported.\n \n var timestamps = [];\n objectStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n console.debug(cursor.value);\n // timestamps.push(cursor.value);\n cursor.continue();\n } else {\n // logTimestamps(timestamps);\n }\n };\n\n \n }\n\n };\n table_obj.appendChild(tbody);\n node.appendChild(table_obj);\n resolve (div_table_obj);\n\n \n});\n} catch (e) {\n console.debug(e)\n}\n\n\n}","static LoadFromMemoryAsync() {}","async loadData() {\n if (!this.load_data) throw new Error('no load data callback provided');\n\n return await Q.nfcall(this.load_data);\n }","getFullList() {\n return new Promise((resolve) => {\n // get first page to refresh total page count\n this.getPageData(1).then((firstPage) => {\n const pages = { 1: firstPage };\n // save totalPages as a constant to avoid race condition with pages added during this\n // process\n const { totalPages } = this;\n\n if (totalPages <= 1) {\n resolve(firstPage);\n } else {\n // now fetch all the missing pages\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\n this.getPageData(pageNum).then((newPage) => {\n pages[pageNum] = newPage;\n // look if all pages were collected\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1)\n .filter((i) => !(i in pages));\n if (missingPages.length === 0) {\n // collect all the so-far loaded pages in order (sorted keys)\n // and flatten them into 1 array\n resolve([].concat(...Object.keys(pages).sort().map((key) => pages[key])));\n }\n });\n });\n }\n });\n });\n }","static LoadFromFileAsync() {}","function load(index){return loadInternal(getLView(),index);}","load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }","getFullList() {\n return new Promise((resolve) => {\n // get first page to refresh total page count\n this.getPageData(1).then((firstPage) => {\n const pages = { 1: firstPage };\n // save totalPages as a constant to avoid race condition with pages added during this\n // process\n const { totalPages } = this;\n\n if (totalPages === 1) {\n resolve(firstPage);\n }\n\n // now fetch all the missing pages\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\n this.getPageData(pageNum).then((newPage) => {\n pages[pageNum] = newPage;\n // look if all pages were collected\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1).filter(\n i => !(i in pages),\n );\n // eslint-disable-next-line no-console\n console.log('missingPages', missingPages);\n if (missingPages.length === 0) {\n // collect all the so-far loaded pages in order (sorted keys)\n // and flatten them into 1 array\n resolve([].concat(...Object.keys(pages).sort().map(key => pages[key])));\n }\n });\n });\n });\n });\n }","async loadSearch() {\n let fs = this;\n return fetchJSONFile(fs.index, function(data) {\n //data = data.filter(function(page) {\n // return page.lang == document.documentElement.lang;\n //})\n fs.fuse = new Fuse(data, fs.fuseConfig);\n fs.isInit = true;\n console.log(\"hugo-fuse-search: Fuse.js was succesfuly instantiated.\");\n }, function(status, statusText) {\n console.log(\"hugo-fuse-search: retrieval of index file was unsuccesful (\\\"\" + fs.index + \"\\\": \" + status + \" - \" + statusText + \")\")\n });\n }","function gvpLoadPromise () {\n if (context.uriAddressableDefsEnabled) {\n return Promise[\"resolve\"]();\n } else {\n return context.globalValueProviders.loadFromStorage();\n }\n }","async function index(req, res) {}","async index () {\n const status = await VisitaStatus.all();\n return status;\n }","resolveWhenListIsPopulated(fn, orderedList, index, ctx) {\n\t\tconst _promise = new Promise(function(resolve) {\n\t\t\tconst _resolve = resolve;\n\t\t\tfn(orderedList, index, ctx, _resolve);\n\t\t});\n\t\treturn _promise;\n\t}","loadState() {\n return Promise.resolve();\n }","async index({ request, response, view }) {\n return await Bebida.all();\n }","function LoadPaneDataAsync(pane_index, callback) {\n if (pane_index < 0 && pane_index > pane_count - 1) return;\n if (paneStatuses[\"p\" + pane_index]) return;\n\n $.ajax({\n url: options.url,\n data: { pn: pane_index + 1, cid: options.currSort },\n dataType: \"json\",\n error: function (jqXHR, textStatus, errorThrown) { },\n //complete: function (jqXHR, textStatus) { loading = false; },\n success: function (data, status) {\n if (data.code > 0) {\n paneDatas[\"_\" + pane_index] = data.dataItem;\n _loadPaneDataHandler(pane_index, data.dataItem);\n callback && callback();\n }\n }\n });\n }","getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: (request, h) => {\n return new Promise ((resolve,reject) => {\n const blockIndex = request.params.index ?\n encodeURIComponent(request.params.index) : -1;\n if (isNaN(blockIndex)) { \n reject(Boom.badRequest());\n } else {\n this.blockChain.getBlockHeight().then((chainHeight)=>{\n if (blockIndex <=chainHeight && blockIndex >-1)\n {\n this.blockChain.getBlock(blockIndex).then ((block)=>{\n resolve(block);\n });\n } else {\n reject(Boom.badRequest());\n }\n });\n }\n });\n }\n });\n }","async fetchQueue( endpoint ){\n\t\treturn await axios.get( endpoint )\n\t}","async index () {\n const properties = Property.all() \n return properties\n }","function _getIndexedDB(callback) {\n var transaction = _newIDBTransaction();\n var objStore = transaction.objectStore('offlineItems');\n var keyRange = IDBKeyRange.lowerBound(0);\n var cursorRequest = objStore.index('byDate').openCursor(keyRange);\n var returnableItems = [];\n transaction.oncomplete = function(e) { callback(returnableItems); };\n cursorRequest.onsuccess = function(e) {\n var result = e.target.result;\n if (!!result == false) { return; }\n returnableItems.push(result.value);\n result.continue();\n };\n cursorRequest.onerror = function() { console.error(\"error\"); };\n }","load() {\n return Promise.resolve(false /* identified */);\n }","list() {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readonly');\n const store = transaction.objectStore(STORE_NAME);\n const request = store.index('store').getAll(IDBKeyRange.only(this.name));\n return waitForRequest(request);\n }).then(files => {\n const result = {};\n files.forEach(file => {\n result[file.fileID] = file.data;\n });\n return result;\n });\n }","getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: (request, h) => {\n return new Promise ((resolve,reject) => {\n const blockIndex = request.params.index ?\n encodeURIComponent(request.params.index) : -1;\n if (isNaN(blockIndex)) { \n reject(Boom.badRequest());\n } else {\n this.blockChain.getBlockHeight().then((chainHeight)=>{\n if (blockIndex <=chainHeight && blockIndex >-1)\n {\n this.blockChain.getBlock(blockIndex).then ((newBlock)=>{\n resolve(JSON.stringify(newBlock));\n });\n } else {\n reject(Boom.badRequest());\n }\n });\n }\n });\n }\n });\n }","function loadIndexes() {\n // Get search indexes.\n dataService.fetch('get', '/api/admin/indexes').then(\n function (data) {\n $scope.activeIndexes = data;\n // Get mappings configuration.\n dataService.fetch('get', '/api/admin/mappings').then(\n function (mappings) {\n // Reset the scopes variables for mappings.\n $scope.activeMappings = {};\n $scope.inActiveMappings = {};\n\n // Filter out active indexes.\n for (var index in mappings) {\n if (!$scope.activeIndexes.hasOwnProperty(index)) {\n $scope.inActiveMappings[index] = mappings[index];\n }\n else {\n $scope.activeMappings[index] = mappings[index];\n }\n }\n },\n function (reason) {\n $scope.message = reason.message;\n $scope.messageClass = 'alert-danger';\n }\n );\n },\n function (reason) {\n $scope.message = reason.message;\n $scope.messageClass = 'alert-danger';\n }\n );\n }","function reference(index) {\n return loadInternal(index, contextViewData);\n}","async getBlock(index) {\r\n // return Block as a JSON object\r\n return JSON.parse(await getDBData(index))\r\n }","function createNewPromise(callback, id, index) {\n return new Promise((resolve, reject) => {\n callback(resolve, reject, id, index);\n });\n}","static getFromIndexedDB(name, version, objStore, callback){\n\t\tDBHelper.openIndexedDB(name, version).then(function(db) {\n\t\t\tlet tx = db.transaction(objStore);\n\t\t\tlet store = tx.objectStore(objStore);\n\n\t\t\treturn store.getAll().then((response) => {\n\t\t\t\tif(response.length) {\n\t\t\t\t\tcallback(null, response);\n\t\t\t\t} else {\n\t\t\t\t\tcallback('There is no records in IndexedDB', null);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}","function ɵɵload(index) {\n return loadInternal(getLView(), index);\n}","fetch() {\r\n return new Promise((resolve, reject) => {\r\n const t = time.measure.start()\r\n this.docClient.scan({ TableName: this.table }, (err, data) => {\r\n time.measure.end(t, `Fetch (scan) from table ${this.table}`)\r\n if (err) {\r\n reject(err)\r\n } else {\r\n resolve(data.Items)\r\n }\r\n })\r\n })\r\n }","getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: async (request, h) => {\n let blockIndex = parseInt(request.params.index);\n const result = await this.blockchain.getBlock(blockIndex);\n return result.statusCode !== undefined ? result : await this.blockchain.addDecodedStoryToReturnObj(JSON.stringify(result).toString());\n }\n });\n }","getInitialIndexes() {\n this.setState({\n initialLoading: true,\n initialLoadText: 'índices...',\n loadError: false\n });\n this.subscribe(\n TimeseriesService.list({template_category: 'emac-index', max_events: 1}),\n data => {\n this.setState(state => ({\n indexes: data,\n tableData: generateTableData(Object.values(state.targets), data, state.tickets, availability),\n initialLoading: false,\n lastUpdate: moment().format(config.DATETIME_FORMAT)\n }));\n this.setDataUpdate();\n },\n (err) => this.setState({loadError: true, initialLoading: false})\n );\n }","async index () {\n return await Operator.all()\n }","function loadFromIndex(storeName, indexName, innerFunction, callback) {\n var cursor = db.transaction([storeName], 'readonly').objectStore(storeName).index(indexName).openCursor();\n \n cursor.onsuccess = function(event) {\n var result = this.result;\n if (result) {\n innerFunction(result);\n result.continue();\n }\n else {\n callback();\n }\n };\n \n }","loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }","loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }","async index () {\n const deposito = await Deposito.all();\n return deposito;\n }","loadPage(rawPath) {\n const pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\"findPath\"])(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = _objectSpread(_objectSpread({}, pageResources), {}, {\n staticQueryResults\n });\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }","async function initIndex() {\n await initThemes()\n fetchAlbumsImgur()\n M.updateTextFields();\n}","async index () {\n const atividade = await AtividadeDoDia.all();\n return atividade;\n }","async function run () {\n const escenicArticles = await getEscenicArticles(client, elascticsearchSourceIndexParams).catch(console.log)\n const transformedArticles = transformEscenicArticle(escenicArticles)\n transformedArticles\n .map(article => createUrlNavIdMapping(article))\n // await bulkIndex(transformedArticles)\n}","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","getAllByIndex(storeName, indexName, keyRange) {\n const data = [];\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(keyRange);\n request.onsuccess = (event) => {\n const cursor = event.target.result;\n if (cursor) {\n data.push(cursor.value);\n cursor.continue();\n }\n else {\n resolve(data);\n }\n };\n })\n .catch((reason) => reject(reason));\n }));\n }","function index_esm_async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result) || {};\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","constructor(core, baseURL = \"/ext/index/X/tx\") {\n super(core, baseURL);\n /**\n * Get last accepted tx, vtx or block\n *\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getLastAccepted = (encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getLastAccepted\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get container by index\n *\n * @param index\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getContainerByIndex = (index = \"0\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n index,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getContainerByIndex\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get contrainer by ID\n *\n * @param containerID\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getContainerByID = (containerID = \"0\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n containerID,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getContainerByID\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get container range\n *\n * @param startIndex\n * @param numToFetch\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getContainerRange = (startIndex = 0, numToFetch = 100, encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n startIndex,\n numToFetch,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getContainerRange\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get index by containerID\n *\n * @param containerID\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getIndex = (containerID = \"\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n containerID,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getIndex\", params);\n return response.data.result.index;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Check if container is accepted\n *\n * @param containerID\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.isAccepted = (containerID = \"\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n containerID,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.isAccepted\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n }","function load_model(index){\n if(index >= self.models.length){\n loaded.resolve();\n }else{\n var model = self.models[index];\n self.pos_widget.loading_message(_t('Loading')+' '+(model.label || model.model || ''), progress);\n var fields = typeof model.fields === 'function' ? model.fields(self,tmp) : model.fields;\n var domain = typeof model.domain === 'function' ? model.domain(self,tmp) : model.domain;\n var context = typeof model.context === 'function' ? model.context(self,tmp) : model.context;\n var ids = typeof model.ids === 'function' ? model.ids(self,tmp) : model.ids;\n progress += progress_step;\n\n if( model.model ){\n if (model.ids) {\n var records = new instance.web.Model(model.model).call('read',[ids,fields],context);\n } else {\n var records = new instance.web.Model(model.model).query(fields).filter(domain).context(context).all()\n }\n records.then(function(result){\n try{ // catching exceptions in model.loaded(...)\n\n result_filtered = []\n if(model.model == \"product.product\")\n {\n for(var i = 0; i < result.length; i++)\n {\n //Filtrando los productos que tengan stock >0, que no tengan una compañia\n //o que tengan una compañia asignada y coincida con la que tiene configurada el\n //punto de venta\n if(result[i].stock_qty > 0 && (result[i].company_id == false || (result[i].company_id != false && result[i].company_id[0] == self.config.company_id[0])))\n {\n result_filtered.push(result[i]);\n }\n }\n result = result_filtered;\n }\n\n $.when(model.loaded(self,result,tmp))\n .then(function(){ load_model(index + 1); },\n function(err){ loaded.reject(err); });\n }catch(err){\n loaded.reject(err);\n }\n },function(err){\n loaded.reject(err);\n });\n }else if( model.loaded ){\n try{ // catching exceptions in model.loaded(...)\n $.when(model.loaded(self,tmp))\n .then( function(){ load_model(index +1); },\n function(err){ loaded.reject(err); });\n }catch(err){\n loaded.reject(err);\n }\n }else{\n load_model(index + 1);\n }\n }\n }"],"string":"[\n \"async getCurentIndex() {\\n\\n this.check()\\n return await this.storage.loadIndex()\\n }\",\n \"async loadIndex() {\\n const indexURL = this.config.indexURL;\\n let indexFilename;\\n if (isFilePath(indexURL)) {\\n indexFilename = indexURL.name;\\n } else {\\n const uriParts = parseUri(indexURL);\\n indexFilename = uriParts.file;\\n }\\n const isTabix = indexFilename.endsWith(\\\".tbi\\\") || this.filename.endsWith('.gz') || this.filename.endsWith('.bgz')\\n let index;\\n if (isTabix) {\\n index = await loadBamIndex(indexURL, this.config, true, this.genome);\\n } else {\\n index = await loadTribbleIndex(indexURL, this.config, this.genome);\\n }\\n return index;\\n }\",\n \"async function getIndexes() {\\n return await fetch('https://api.coingecko.com/api/v3/indexes').then(res => res.json());\\n }\",\n \"static loadProjectIndex(projectId) {\\n return Promise( (resolve, reject) => {\\n const url = ProjectIndex.APIUrlForProject(projectId);\\n fetch(url).then( (response) => {\\n if (response.status !== 200) reject(response.status);\\n try {\\n const json = response.json();\\n const index = new ProjectIndex(\\\"/\\\", json.project);\\n resolve(index);\\n } catch (error) {\\n reject(error);\\n }\\n })\\n }\\n\\n static APIUrlForProject(projectId) {\\n return `/API/getProjectIndex/${projectId}`;\\n }\",\n \"function load() {\\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\\n .then(function(result) {\\n console.log('load results')\\n tree = result[0];\\n dbIndex = new Index(result[1]);\\n entries = result[2];\\n });\\n}\",\n \"async function loadData() {\\n // Get the health of the connection\\n let health = await connection.checkConnection();\\n\\n // Check the status of the connection\\n if (health.statusCode === 200) {\\n // Delete index\\n await connection.deleteIndex().catch((err) => {\\n console.log(err);\\n });\\n // Create Index\\n await connection.createIndex().catch((err) => {\\n console.log(err);\\n });\\n // If index exists\\n if (await connection.indexExists()) {\\n const parents = await rest.getRequest(rest.FlaskUrl + \\\"/N\\\");\\n // If parents has the property containing the files\\n if (parents.hasOwnProperty(\\\"data\\\")) {\\n //Retrieve the parent list\\n let parrentArray = parents.data;\\n\\n // Get amount of parents\\n NumberOfParents = parrentArray.length;\\n console.log(\\\"Number of parents to upload: \\\" + NumberOfParents);\\n // Each function call to upload a JSON object to the index\\n // delayed by 50ms\\n parrentArray.forEach(delayedFunctionLoop(uploadParentToES, 50));\\n }\\n }\\n } else {\\n console.log(\\\"The connection failed\\\");\\n }\\n}\",\n \"function getIndexId() {\\n return new Promise((resolve, reject) => {\\n fs.readFile(INDEX_FILE, (err, data) => {\\n if (err || data === undefined) {\\n reject(err);\\n } else {\\n const json = JSON.parse(data);\\n resolve(json.id);\\n }\\n });\\n });\\n}\",\n \"prepareIndiceForUpdate(indexData) {\\n return Promise.resolve();\\n }\",\n \"getActIndex() {\\n return __awaiter(this, void 0, void 0, function* () {\\n return yield this._handleApiCall(`${this.gameBaseUrlPath}/act`, 'Error fetching the act index.');\\n });\\n }\",\n \"async fetchExistingRecords () {\\n const client = getAlgoliaClient()\\n\\n // return an empty array if the index does not exist yet\\n const { items: indices } = await client.listIndices()\\n\\n if (!indices.find(index => index.name === this.name)) {\\n console.log(`index '${this.name}' does not exist!`)\\n return []\\n }\\n\\n const index = client.initIndex(this.name)\\n let records = []\\n\\n await index.browseObjects({\\n batch: batch => (records = records.concat(batch))\\n })\\n\\n return records\\n }\",\n \"async do(headers = {}) {\\n\\t\\tlet res = await this.c.get(\\\"/v2/assets/\\\" + this.index, {}, headers);\\n\\t\\treturn res.body;\\n\\t}\",\n \"function index() {\\n\\n return resource.fetch()\\n .then(function(data){ return data; });\\n }\",\n \"getByIndex(storeName, indexName, key) {\\n return from(new Promise((resolve, reject) => {\\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\\n .then((db) => {\\n validateBeforeTransaction(db, storeName, reject);\\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\\n const objectStore = transaction.objectStore(storeName);\\n const index = objectStore.index(indexName);\\n const request = index.get(key);\\n request.onsuccess = (event) => {\\n resolve(event.target.result);\\n };\\n })\\n .catch((reason) => reject(reason));\\n }));\\n }\",\n \"async init() {\\n var that = this;\\n\\n var promise = new Promise(function(resolve, reject) {\\n\\n var req = indexedDB.open(that.db_name, that.version);\\n\\n req.onupgradeneeded = function(event) {\\n that.database = event.target.result;\\n //run callback method in createTable to add a new object table\\n that.upgrade();\\n };\\n\\n req.onsuccess = function (event) {\\n that.database = event.target.result;\\n resolve();\\n };\\n\\n req.onerror = function (error) {\\n if (req.error.name === \\\"VersionError\\\") {\\n //we can never be sure what version of the database the client is on\\n //therefore in the event that we request an older version of the db than the client is on, we will need to update the js version request on runtime\\n that.version++;\\n\\n //we need to initiate a steady increment of promise connections that either resolve or reject\\n that.init()\\n .then(function() {\\n //bubble the result\\n resolve();\\n })\\n .catch(function() {\\n //bubble the result: DOESNT WORK?\\n reject();\\n });\\n } else {\\n console.error(error);\\n }\\n };\\n });\\n return promise;\\n }\",\n \"async function getIndex() {\\n const contents = fs.readdirSync(`./${ipfs.host}/`);\\n iLog('Trying to load indices from local files ...');\\n for (i in contents) {\\n if (contents[i][0] === 'i' && !fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\\n const indexFile = fs.readFileSync(`./${ipfs.host}/${contents[i]}`);\\n const indexDump = JSON.parse(indexFile);\\n global.indices[contents[i].substr(5,contents[i].length-10)] = elasticlunr.Index.load(indexDump);\\n }\\n }\\n try {\\n await fs.statSync(`./${ipfs.host}/hostedFiles.json`);\\n global.ipfsearch.hostedFiles = JSON.parse(await fs.readFileSync(`./${ipfs.host}/hostedFiles.json`));\\n } catch (e) { }\\n if (Object.keys(global.indices).length === 0) {\\n // file does not exist, create fresh index\\n iLog('No local indices exist, generating new index files ...');\\n const contents = fs.readdirSync(`./${ipfs.host}/`);\\n for (i in contents) {\\n if (fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\\n global.indices[contents[i]] = createIndex();\\n await readFilesIntoObjects(contents[i], `./${ipfs.host}/${contents[i]}`);\\n // save the index\\n await saveIndex(global.indices[contents[i]], `./${ipfs.host}/index${contents[i]}.json`);\\n }\\n }\\n }\\n}\",\n \"function readIndexJson() {\\n return new Promise((resolve, reject) => {\\n fs.readFile(INDEX_FILE, (err, data) => {\\n if (err) reject(err);\\n const json = JSON.parse(data);\\n const promises = [];\\n Object.keys(json).forEach((lang) => {\\n if (LANG_SUPPORTED.includes(lang)) {\\n promises.push(getJson(json[lang].raw.DestinyStatDefinition, `${STAT_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].raw.DestinyClassDefinition, `${CLASS_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].items.Mod, `${MOD_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].raw.DestinyInventoryBucketDefinition, `${BUCKET_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].items.Armor, `${ARMOR_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].items.Weapon, `${WEAPON_DIR}/${lang}.json`));\\n }\\n });\\n Promise.all(promises)\\n .then(() => {\\n resolve();\\n })\\n .catch((pErr) => {\\n console.log(pErr);\\n reject(pErr);\\n });\\n });\\n });\\n}\",\n \"function loadIndex() {\\n\\tvar indexRequest = new XMLHttpRequest();\\n\\tindexRequest.open(\\\"GET\\\", \\\"https://mustang-index.azurewebsites.net/index.json\\\");\\n\\tindexRequest.onload = function() {\\n\\t\\tconsole.log(\\\"Index JSON file:\\\" + indexRequest.responseText);\\n\\t\\tcontactIndex = JSON.parse(indexRequest.responseText);\\n\\t\\tcontactURLArray.length = 0;\\n\\t\\tfor(i = 0; i < contactIndex.length; i++) {\\n\\t\\t\\tcontactURLArray.push(contactIndex[i].ContactURL);\\n\\t\\t}\\n\\t\\tconsole.log(\\\"ContactURLArray: \\\" + JSON.stringify(contactURLArray));\\n\\t\\trenderIndex(contactIndex);\\n\\t\\tshowSnackbar(\\\"Index loaded\\\");\\n\\t}\\n\\tindexRequest.send();\\n}\",\n \"async load(indexRootUrl, searchHint) {\\n const enumValueIds = searchHint;\\n const promises = enumValueIds.map(async (valueId) => {\\n const value = this.values[valueId];\\n if (value.dataRowIds)\\n return Promise.resolve();\\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\\n dynamicTyping: true,\\n header: true\\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\\n value.dataRowIds = promise;\\n return promise;\\n });\\n await Promise.all(promises);\\n }\",\n \"async createIndexJson(url) {\\n \\treturn this.rs.readFolder(url).then(folder => {\\n \\t\\tvar promises = [];\\n \\t\\tthis.index = {};\\n \\t\\tif (folder.files.length == 0) {\\n \\t\\t\\tpromises.push(this.index)\\n \\t\\t} else {\\n\\t\\t\\t\\tlet i\\n\\t\\t\\t\\t\\tfor ( i = 0; i < folder.files.length ; i ++) {\\n\\t\\t\\t\\t\\t\\tlet file = folder.files[i].name.split(\\\".\\\");\\n\\t\\t\\t\\t\\t\\tif (file.pop() == \\\"ttl\\\") {\\n\\t\\t\\t\\t\\t\\t\\tvar title = file.join(\\\".\\\")\\n\\t\\t\\t\\t\\t\\t\\tpromises.push(\\n\\t\\t\\t\\t\\t\\t\\tthis.rs.rdf.query(url+title+\\\".ttl\\\")\\n\\t\\t\\t\\t\\t\\t\\t.then(queryRes => {\\n\\t\\t\\t\\t\\t\\t\\t\\tthis.jsonTiddler(queryRes)\\n\\t\\t\\t\\t\\t\\t\\t\\tdelete this.tiddlerJson[\\\"text\\\"]\\n\\t\\t\\t\\t\\t\\t\\t\\tthis.index[this.tiddlerJson[\\\"title\\\"]] = this.tiddlerJson;\\n\\t\\t\\t\\t\\t\\t\\t},err => {alert(\\\"title \\\"+err)})\\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}\\n\\t\\t\\t\\treturn Promise.all(promises).then( success => {\\n\\t\\t\\t\\t\\treturn this.index\\n\\t\\t\\t},err => {alert(\\\"Are some .ttl files not tiddlers ??? \\\\n\\\"+err)})\\n \\t})\\n }\",\n \"function load(index) {\\n return loadInternal(index, viewData);\\n}\",\n \"indexPage(req) {\\n return __awaiter(this, void 0, void 0, function* () {\\n });\\n }\",\n \"prepareIndiceForInstall(indexData) {\\n return Promise.resolve();\\n }\",\n \"getCachedDataByIndex(storename, index, key) {\\n return this.cache.then((db) => {\\n return db.transaction(storename).objectStore(storename).index(index).getAll(key);\\n });\\n }\",\n \"_updateIndex() {\\n return __awaiter(this, void 0, void 0, function* () {\\n //creates index file if it doesn't already exist\\n let inCouch = yield this._isInCouch(\\\"index\\\", \\\"index\\\");\\n if (!inCouch) {\\n yield this.couchdb.createDatabase(\\\"index\\\");\\n yield this.couchdb.createDocument(\\\"index\\\", {}, \\\"index\\\");\\n }\\n let data = yield readFile(path.join(this.localRepoPath, \\\"/EventIndex.json\\\"), \\\"utf8\\\");\\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\\\\\\\"'));\\n let events = json[\\\"Events\\\"];\\n events.sort(function (a, b) {\\n return Date.parse(b.StartDate) - Date.parse(a.StartDate);\\n });\\n let couchDocument = yield this.couchdb.getDocument(\\\"index\\\", \\\"index\\\");\\n yield this.couchdb.createDocument(\\\"index\\\", { Events: events, \\\"_rev\\\": couchDocument.data[\\\"_rev\\\"] }, \\\"index\\\");\\n });\\n }\",\n \"async getLoadOperation() {}\",\n \"function loadIndex() {\\n var idxFile = this.indexURL;\\n\\n if (this.filename.endsWith(\\\".gz\\\")) {\\n if (!idxFile) idxFile = this.url + \\\".tbi\\\";\\n return igv.loadBamIndex(idxFile, this.config, true);\\n } else {\\n if (!idxFile) idxFile = this.url + \\\".idx\\\";\\n return igv.loadTribbleIndex(idxFile, this.config);\\n }\\n }\",\n \"loadIndexPage () {\\n return Promise.resolve(Request.httpGet(this.SiteUrl + this.DefaultPrefix, this.CharSet).then(res => {\\n let $ = cheerio.load(res.text);\\n let Navis = $('#sliderNav > li');\\n let Uid = new Date().getTime();\\n Navis.each((i, elem) => {\\n let _this = $(elem);\\n let _ChildNodes = _this.find('> ul >li');\\n let _SiteUrl = _this.find('>a').attr('href');\\n if (_SiteUrl === './') {\\n _SiteUrl = '../ssxx/'\\n }\\n\\n let _SiteReg = /^javascript:/ig;\\n this.ListNavis.push({\\n Uid: `${Uid}${i}`,\\n Section: _this.find('> a >span:first-child').text(),\\n SiteUrl: _SiteReg.test(_SiteUrl) ? '' : _SiteUrl,\\n HasChild: _ChildNodes && _ChildNodes.length > 0,\\n ChildNodes: _ChildNodes && _ChildNodes.toArray().map((item, index) => {\\n let _node = $(item).find('a');\\n let _group = _node.text();\\n let _uid = this.GroupDefine.has(_group) && this.GroupDefine.get(_group) || this.GroupDefine.set(_group, `${new Date().getTime()}${i}`).get(_group);\\n return {\\n Uid: _uid,\\n Group: _node.text(),\\n SiteUrl: _node.attr('href')\\n };\\n })\\n });\\n });\\n\\n /*保存首页数据*/\\n Request.saveJsonToFile(this.ListNavis, 'index.json', this.Group, [...this.GroupDefine]);\\n }).catch(err => {\\n console.error(err);\\n }));\\n }\",\n \"fetchIndex(){\\n return this.http.fetch('data/index.json?t=' + new Date().getTime())\\n .then(response=>{\\n //convert text to json\\n return response.json()\\n })\\n .then(json=>{\\n let infos = json;\\n return infos;\\n });\\n }\",\n \"function wrappedFetch() {\\n var wrappedPromise = {};\\n\\n var promise = new index_es(function (resolve, reject) {\\n wrappedPromise.resolve = resolve;\\n wrappedPromise.reject = reject;\\n });\\n\\n var args = new Array(arguments.length);\\n\\n for (var i = 0; i < args.length; i++) {\\n args[i] = arguments[i];\\n }\\n\\n wrappedPromise.promise = promise;\\n\\n index_es.resolve().then(function () {\\n return fetch.apply(null, args);\\n }).then(function (response) {\\n wrappedPromise.resolve(response);\\n }).catch(function (error) {\\n wrappedPromise.reject(error);\\n });\\n\\n return wrappedPromise;\\n}\",\n \"function page(index) {\\n var item = internal.loader.info(index),\\n res;\\n if (item) {\\n res = {\\n index: item.index,\\n data: item.cached,\\n loading: item.queued || item.loading || item.waiting,\\n cancel: item.cancel\\n };\\n } else {\\n res = null;\\n }\\n return res;\\n }\",\n \"getAddressIndex() {\\n return __awaiter(this, void 0, void 0, function* () {\\n return yield this.request(\\\"get_address_index\\\");\\n });\\n }\",\n \"async beginIndexRequest() {\\n const keyString = this.idsToIndex.shift();\\n const provider = this;\\n\\n this.pendingRequests += 1;\\n const identifier = await this.openmct.objects.parseKeyString(keyString);\\n const domainObject = await this.openmct.objects.get(identifier.key);\\n delete provider.pendingIndex[keyString];\\n try {\\n if (domainObject) {\\n await provider.index(identifier, domainObject);\\n }\\n } catch (error) {\\n console.warn('Failed to index domain object ' + keyString, error);\\n }\\n\\n setTimeout(function () {\\n provider.pendingRequests -= 1;\\n provider.keepIndexing();\\n }, 0);\\n }\",\n \"indexCountry() {\\n return new Promise(function (resolve, reject) {\\n logger.info('indexCountry() Initiated')\\n let sql = sqlObj.dashboardStatus.indexCountry;\\n dbInstance.doRead(sql)\\n .then(result => {\\n logger.info('indexCountry() Exited Successfully')\\n resolve(result);\\n })\\n .catch(err => {\\n logger.error('indexCountry() Error')\\n reject(err);\\n })\\n })\\n }\",\n \"async getBlockByIndex() {\\r\\n this.server.route({\\r\\n method: 'GET',\\r\\n path: '/api/block/{index}',\\r\\n handler: async (request, h) => {\\r\\n let block = await this.blockChain.getBlock(request.params.index);\\r\\n if(!block){\\r\\n throw Boom.notFound(\\\"Block not found.\\\");\\r\\n }else{\\r\\n return block;\\r\\n }\\r\\n }\\r\\n });\\r\\n }\",\n \"function load(index) {\\n return loadInternal(getLView(), index);\\n}\",\n \"function load(index) {\\n return loadInternal(getLView(), index);\\n}\",\n \"async load () {}\",\n \"function asyncGet() {\\n return new Promise(function (success, fail) {\\n let xhr = new XMLHttpRequest();\\n xhr.open(\\\"GET\\\", rootURL + \\\"list\\\", true);\\n xhr.onload = () => {\\n if (xhr.status === 200)\\n success(JSON.parse(xhr.responseText));\\n else fail(alert(xhr.statusText));\\n };\\n xhr.onerror = () => fail(alert(xhr.statusText));\\n xhr.send();\\n });\\n}\",\n \"async index () {\\n const transactions = await Transaction.all();\\n return transactions;\\n }\",\n \"async index () {\\n const abastecimento = await Abastecimento.all();\\n\\n return abastecimento;\\n }\",\n \"initDB(tables) {\\n let self = this;\\n return new Promise(function (resolve, reject) {\\n let req = self.indexDbApi.open(self.dbName, self.dbV);\\n let db;\\n let tableNames = Object.keys(tables);\\n let tableIndexes = Object.values(tables);\\n\\n req.onerror = function (e) {\\n console.log('DB init Error');\\n reject(e);\\n };\\n req.onsuccess = function (e) {\\n db = e.target.result;\\n console.log('DB init Success');\\n setTimeout(function () {\\n resolve(db);\\n }, 100);\\n };\\n req.onupgradeneeded = function (e) {\\n db = e.target.result;\\n let store;\\n for (let i = 0; i < tableNames.length; i++) {\\n if (!db.objectStoreNames.contains(tableNames[i])) {\\n store = db.createObjectStore(tableNames[i], {keyPath: self.keyPath, autoIncrement: false});\\n console.log('TABLE ' + tableNames[i] + ' created Success');\\n }\\n for (let j = 0; j < tableIndexes[i].length; j++) {\\n store.createIndex(tableIndexes[i][j][0], tableIndexes[i][j][0], {unique: tableIndexes[i][j][1]});\\n }\\n }\\n console.log(\\\"onupgradeneeded\\\");\\n };\\n });\\n\\n }\",\n \"function syncIt() {\\n return getIndexedDB()\\n .then(sendToServer)\\n .catch(function(err) {\\n return err;\\n })\\n}\",\n \"_nextLoadHandler(handlers, index=0) {\\n return utils.promise.result(this._executeLoadHandler(handlers[index]))\\n .then(() => ++index === handlers.length ? Promise.resolve() : this._nextLoadHandler(handlers, index));\\n }\",\n \"function syncDatabaseIndexDB() {\\n\\n //initialises the indexedDB database\\n initDatabase();\\n\\n fetch('/index/events')\\n .then(response => {\\n return response.json();\\n })\\n .then(events => {\\n clearEvent();\\n addEvents(events);\\n })\\n .catch(err => {\\n\\n });\\n fetch('/index/stories')\\n .then(response => {\\n return response.json();\\n })\\n .then(stories => {\\n clearStory();\\n addStories(stories)\\n //console.log(events);\\n })\\n .catch(err => {\\n\\n });\\n}\",\n \"function getIndex(){\\n var xhr = new XMLHttpRequest();\\n xhr.open(\\\"GET\\\", '/getIndex', true);\\n xhr.onreadystatechange= function() {\\n if (this.readyState!==4) return; // not ready yet\\n if (this.status===200) { // HTTP 200 OK\\n index =this.response;\\n getRetrieve();\\n } else {\\n alert(\\\"not working!\\\");\\n }\\n };\\n xhr.send(null);\\n}\",\n \"checkIndex(indexName) {\\n return this.indexExists(indexName)\\n .then(found => found ? Promise.resolve() : Promise.reject(new errors.InternalServerError('Index not created.')));\\n }\",\n \"function dbIndexQuery(index, indexName){\\n var tx = dbRequest.result.transaction('task')\\n var store = tx.objectStore('task');\\n const statusIndex= store.index(index);\\n const getStatus=statusIndex.getAll(indexName);\\n\\n getStatus.onsuccess=(e)=>{\\n\\n let web= e.target.result\\n let webKey=getStatus.key\\n web.map((pend)=>{\\n createLi(pend.time,pend.task,pend.status,activityDisplay)\\n console.log(web)\\n\\n })\\n }\\n }\",\n \"getPairsIndex() {\\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\\n return yield this.getRestData('/pairs');\\n });\\n }\",\n \"function testFunc(index) {\\n return new Promise(function (resolve) {\\n setTimeout(() => resolve(index), Math.random() * 11);\\n });\\n}\",\n \"indexExists(indexName) {\\n return new Promise((resolve, reject) => {\\n this.client.indices.exists({index: indexName}, (err, found) => {\\n if (err) reject(err);\\n resolve(found);\\n });\\n });\\n }\",\n \"function DISABLEDsetup_database_objects_table_async(indexedDbName, objectStoreName, keyId_json_path,table_id, node, table_conf, header_conf,column_conf) {\\n\\n\\t/*\\n\\t * indexedDbName\\n\\t * objectStore\\n\\t * \\n\\t * \\n\\t */\\n\\ttry {\\n\\t return new Promise(\\n\\t\\t function (resolve, reject) {\\n\\n\\t\\n//var table_conf = JSON.parse(JSON.stringify(t));\\n//var header_conf = JSON.parse(JSON.stringify(h));\\n//var column_conf = JSON.parse(JSON.stringify(c));\\n\\n\\nconsole.debug(\\\"# setup_database_objects_table\\\" );\\n //console.debug(\\\"objectStore: \\\" + objectStoreName);\\n//console.debug(\\\"indexedDbName: \\\" + indexedDbName);\\n // console.debug(\\\"node: \\\" + JSON.stringify(node));\\n\\t\\n //console.debug(\\\"table_conf: \\\" + JSON.stringify(table_conf));\\n //console.debug(\\\"header_conf: \\\" + JSON.stringify(header_conf));\\n //console.debug(\\\"column_conf: \\\" + JSON.stringify(column_conf));\\n\\n \\n // ##########\\n // list all objects in db\\n // ##########\\n\\n\\n // var table_obj = createTable(table_conf, key);\\n\\n var div_table_obj = document.createElement(\\\"div\\\");\\n div_table_obj.setAttribute(\\\"class\\\", \\\"tableContainer\\\");\\n var table_obj = document.createElement(\\\"table\\\");\\n\\n table_obj.setAttribute(\\\"class\\\", \\\"scrollTable\\\");\\n table_obj.setAttribute(\\\"width\\\", \\\"100%\\\");\\n table_obj.setAttribute(\\\"id\\\", table_id);\\n table_obj.setAttribute(\\\"indexedDbName\\\", indexedDbName);\\n table_obj.setAttribute(\\\"objectStoreName\\\", objectStoreName);\\n \\n\\n div_table_obj.appendChild(table_obj);\\n\\n var thead = document.createElement(\\\"thead\\\");\\n thead.setAttribute(\\\"class\\\", \\\"fixedHeader\\\");\\n thead.appendChild(writeTableHeaderRow(header_conf));\\n\\n table_obj.appendChild(thead);\\n\\n node.appendChild(table_obj);\\n\\n var tbody = document.createElement(\\\"tbody\\\");\\n tbody.setAttribute(\\\"class\\\", \\\"scrollContent\\\");\\n \\n node.appendChild(tbody);\\n\\n var dbRequest = indexedDB.open(indexedDbName);\\n dbRequest.onerror = function (event) {\\n reject(Error(\\\"Error text\\\"));\\n };\\n\\n dbRequest.onupgradeneeded = function (event) {\\n // Objectstore does not exist. Nothing to load\\n event.target.transaction.abort();\\n reject(Error('Not found'));\\n };\\n\\n \\n dbRequest.onsuccess = function (event) {\\n var database = event.target.result;\\n var transaction = database.transaction(objectStoreName, 'readonly');\\n var objectStore = transaction.objectStore(objectStoreName);\\n\\n if ('getAll' in objectStore) {\\n // IDBObjectStore.getAll() will return the full set of items\\n // in our store.\\n objectStore.getAll().onsuccess = function (event) {\\n const res = event.target.result;\\n // console.debug(res);\\n for (const url of res) {\\n\\n const tr = writeTableRow(url, column_conf, keyId_json_path);\\n\\n // create add row to table\\n\\n tbody.appendChild(tr);\\n\\n }\\n\\n };\\n // add a line where information on a new key can be added to\\n // the database.\\n // document.querySelector(\\\"button.onAddDecryptionKey\\\").onclick\\n // = this.onAddDecryptionKey;\\n\\n } else {\\n // Fallback to the traditional cursor approach if getAll\\n // isn't supported.\\n \\n var timestamps = [];\\n objectStore.openCursor().onsuccess = function (event) {\\n var cursor = event.target.result;\\n if (cursor) {\\n console.debug(cursor.value);\\n // timestamps.push(cursor.value);\\n cursor.continue();\\n } else {\\n // logTimestamps(timestamps);\\n }\\n };\\n\\n \\n }\\n\\n };\\n table_obj.appendChild(tbody);\\n node.appendChild(table_obj);\\n resolve (div_table_obj);\\n\\n \\n});\\n} catch (e) {\\n console.debug(e)\\n}\\n\\n\\n}\",\n \"static LoadFromMemoryAsync() {}\",\n \"async loadData() {\\n if (!this.load_data) throw new Error('no load data callback provided');\\n\\n return await Q.nfcall(this.load_data);\\n }\",\n \"getFullList() {\\n return new Promise((resolve) => {\\n // get first page to refresh total page count\\n this.getPageData(1).then((firstPage) => {\\n const pages = { 1: firstPage };\\n // save totalPages as a constant to avoid race condition with pages added during this\\n // process\\n const { totalPages } = this;\\n\\n if (totalPages <= 1) {\\n resolve(firstPage);\\n } else {\\n // now fetch all the missing pages\\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\\n this.getPageData(pageNum).then((newPage) => {\\n pages[pageNum] = newPage;\\n // look if all pages were collected\\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1)\\n .filter((i) => !(i in pages));\\n if (missingPages.length === 0) {\\n // collect all the so-far loaded pages in order (sorted keys)\\n // and flatten them into 1 array\\n resolve([].concat(...Object.keys(pages).sort().map((key) => pages[key])));\\n }\\n });\\n });\\n }\\n });\\n });\\n }\",\n \"static LoadFromFileAsync() {}\",\n \"function load(index){return loadInternal(getLView(),index);}\",\n \"load() {\\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\\\"__awaiter\\\"])(this, void 0, void 0, function* () { });\\n }\",\n \"getFullList() {\\n return new Promise((resolve) => {\\n // get first page to refresh total page count\\n this.getPageData(1).then((firstPage) => {\\n const pages = { 1: firstPage };\\n // save totalPages as a constant to avoid race condition with pages added during this\\n // process\\n const { totalPages } = this;\\n\\n if (totalPages === 1) {\\n resolve(firstPage);\\n }\\n\\n // now fetch all the missing pages\\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\\n this.getPageData(pageNum).then((newPage) => {\\n pages[pageNum] = newPage;\\n // look if all pages were collected\\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1).filter(\\n i => !(i in pages),\\n );\\n // eslint-disable-next-line no-console\\n console.log('missingPages', missingPages);\\n if (missingPages.length === 0) {\\n // collect all the so-far loaded pages in order (sorted keys)\\n // and flatten them into 1 array\\n resolve([].concat(...Object.keys(pages).sort().map(key => pages[key])));\\n }\\n });\\n });\\n });\\n });\\n }\",\n \"async loadSearch() {\\n let fs = this;\\n return fetchJSONFile(fs.index, function(data) {\\n //data = data.filter(function(page) {\\n // return page.lang == document.documentElement.lang;\\n //})\\n fs.fuse = new Fuse(data, fs.fuseConfig);\\n fs.isInit = true;\\n console.log(\\\"hugo-fuse-search: Fuse.js was succesfuly instantiated.\\\");\\n }, function(status, statusText) {\\n console.log(\\\"hugo-fuse-search: retrieval of index file was unsuccesful (\\\\\\\"\\\" + fs.index + \\\"\\\\\\\": \\\" + status + \\\" - \\\" + statusText + \\\")\\\")\\n });\\n }\",\n \"function gvpLoadPromise () {\\n if (context.uriAddressableDefsEnabled) {\\n return Promise[\\\"resolve\\\"]();\\n } else {\\n return context.globalValueProviders.loadFromStorage();\\n }\\n }\",\n \"async function index(req, res) {}\",\n \"async index () {\\n const status = await VisitaStatus.all();\\n return status;\\n }\",\n \"resolveWhenListIsPopulated(fn, orderedList, index, ctx) {\\n\\t\\tconst _promise = new Promise(function(resolve) {\\n\\t\\t\\tconst _resolve = resolve;\\n\\t\\t\\tfn(orderedList, index, ctx, _resolve);\\n\\t\\t});\\n\\t\\treturn _promise;\\n\\t}\",\n \"loadState() {\\n return Promise.resolve();\\n }\",\n \"async index({ request, response, view }) {\\n return await Bebida.all();\\n }\",\n \"function LoadPaneDataAsync(pane_index, callback) {\\n if (pane_index < 0 && pane_index > pane_count - 1) return;\\n if (paneStatuses[\\\"p\\\" + pane_index]) return;\\n\\n $.ajax({\\n url: options.url,\\n data: { pn: pane_index + 1, cid: options.currSort },\\n dataType: \\\"json\\\",\\n error: function (jqXHR, textStatus, errorThrown) { },\\n //complete: function (jqXHR, textStatus) { loading = false; },\\n success: function (data, status) {\\n if (data.code > 0) {\\n paneDatas[\\\"_\\\" + pane_index] = data.dataItem;\\n _loadPaneDataHandler(pane_index, data.dataItem);\\n callback && callback();\\n }\\n }\\n });\\n }\",\n \"getBlockByIndex() {\\n this.server.route({\\n method: 'GET',\\n path: '/block/{index}',\\n handler: (request, h) => {\\n return new Promise ((resolve,reject) => {\\n const blockIndex = request.params.index ?\\n encodeURIComponent(request.params.index) : -1;\\n if (isNaN(blockIndex)) { \\n reject(Boom.badRequest());\\n } else {\\n this.blockChain.getBlockHeight().then((chainHeight)=>{\\n if (blockIndex <=chainHeight && blockIndex >-1)\\n {\\n this.blockChain.getBlock(blockIndex).then ((block)=>{\\n resolve(block);\\n });\\n } else {\\n reject(Boom.badRequest());\\n }\\n });\\n }\\n });\\n }\\n });\\n }\",\n \"async fetchQueue( endpoint ){\\n\\t\\treturn await axios.get( endpoint )\\n\\t}\",\n \"async index () {\\n const properties = Property.all() \\n return properties\\n }\",\n \"function _getIndexedDB(callback) {\\n var transaction = _newIDBTransaction();\\n var objStore = transaction.objectStore('offlineItems');\\n var keyRange = IDBKeyRange.lowerBound(0);\\n var cursorRequest = objStore.index('byDate').openCursor(keyRange);\\n var returnableItems = [];\\n transaction.oncomplete = function(e) { callback(returnableItems); };\\n cursorRequest.onsuccess = function(e) {\\n var result = e.target.result;\\n if (!!result == false) { return; }\\n returnableItems.push(result.value);\\n result.continue();\\n };\\n cursorRequest.onerror = function() { console.error(\\\"error\\\"); };\\n }\",\n \"load() {\\n return Promise.resolve(false /* identified */);\\n }\",\n \"list() {\\n return this.ready.then(db => {\\n const transaction = db.transaction([STORE_NAME], 'readonly');\\n const store = transaction.objectStore(STORE_NAME);\\n const request = store.index('store').getAll(IDBKeyRange.only(this.name));\\n return waitForRequest(request);\\n }).then(files => {\\n const result = {};\\n files.forEach(file => {\\n result[file.fileID] = file.data;\\n });\\n return result;\\n });\\n }\",\n \"getBlockByIndex() {\\n this.server.route({\\n method: 'GET',\\n path: '/block/{index}',\\n handler: (request, h) => {\\n return new Promise ((resolve,reject) => {\\n const blockIndex = request.params.index ?\\n encodeURIComponent(request.params.index) : -1;\\n if (isNaN(blockIndex)) { \\n reject(Boom.badRequest());\\n } else {\\n this.blockChain.getBlockHeight().then((chainHeight)=>{\\n if (blockIndex <=chainHeight && blockIndex >-1)\\n {\\n this.blockChain.getBlock(blockIndex).then ((newBlock)=>{\\n resolve(JSON.stringify(newBlock));\\n });\\n } else {\\n reject(Boom.badRequest());\\n }\\n });\\n }\\n });\\n }\\n });\\n }\",\n \"function loadIndexes() {\\n // Get search indexes.\\n dataService.fetch('get', '/api/admin/indexes').then(\\n function (data) {\\n $scope.activeIndexes = data;\\n // Get mappings configuration.\\n dataService.fetch('get', '/api/admin/mappings').then(\\n function (mappings) {\\n // Reset the scopes variables for mappings.\\n $scope.activeMappings = {};\\n $scope.inActiveMappings = {};\\n\\n // Filter out active indexes.\\n for (var index in mappings) {\\n if (!$scope.activeIndexes.hasOwnProperty(index)) {\\n $scope.inActiveMappings[index] = mappings[index];\\n }\\n else {\\n $scope.activeMappings[index] = mappings[index];\\n }\\n }\\n },\\n function (reason) {\\n $scope.message = reason.message;\\n $scope.messageClass = 'alert-danger';\\n }\\n );\\n },\\n function (reason) {\\n $scope.message = reason.message;\\n $scope.messageClass = 'alert-danger';\\n }\\n );\\n }\",\n \"function reference(index) {\\n return loadInternal(index, contextViewData);\\n}\",\n \"async getBlock(index) {\\r\\n // return Block as a JSON object\\r\\n return JSON.parse(await getDBData(index))\\r\\n }\",\n \"function createNewPromise(callback, id, index) {\\n return new Promise((resolve, reject) => {\\n callback(resolve, reject, id, index);\\n });\\n}\",\n \"static getFromIndexedDB(name, version, objStore, callback){\\n\\t\\tDBHelper.openIndexedDB(name, version).then(function(db) {\\n\\t\\t\\tlet tx = db.transaction(objStore);\\n\\t\\t\\tlet store = tx.objectStore(objStore);\\n\\n\\t\\t\\treturn store.getAll().then((response) => {\\n\\t\\t\\t\\tif(response.length) {\\n\\t\\t\\t\\t\\tcallback(null, response);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tcallback('There is no records in IndexedDB', null);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t});\\n\\t}\",\n \"function ɵɵload(index) {\\n return loadInternal(getLView(), index);\\n}\",\n \"fetch() {\\r\\n return new Promise((resolve, reject) => {\\r\\n const t = time.measure.start()\\r\\n this.docClient.scan({ TableName: this.table }, (err, data) => {\\r\\n time.measure.end(t, `Fetch (scan) from table ${this.table}`)\\r\\n if (err) {\\r\\n reject(err)\\r\\n } else {\\r\\n resolve(data.Items)\\r\\n }\\r\\n })\\r\\n })\\r\\n }\",\n \"getBlockByIndex() {\\n this.server.route({\\n method: 'GET',\\n path: '/block/{index}',\\n handler: async (request, h) => {\\n let blockIndex = parseInt(request.params.index);\\n const result = await this.blockchain.getBlock(blockIndex);\\n return result.statusCode !== undefined ? result : await this.blockchain.addDecodedStoryToReturnObj(JSON.stringify(result).toString());\\n }\\n });\\n }\",\n \"getInitialIndexes() {\\n this.setState({\\n initialLoading: true,\\n initialLoadText: 'índices...',\\n loadError: false\\n });\\n this.subscribe(\\n TimeseriesService.list({template_category: 'emac-index', max_events: 1}),\\n data => {\\n this.setState(state => ({\\n indexes: data,\\n tableData: generateTableData(Object.values(state.targets), data, state.tickets, availability),\\n initialLoading: false,\\n lastUpdate: moment().format(config.DATETIME_FORMAT)\\n }));\\n this.setDataUpdate();\\n },\\n (err) => this.setState({loadError: true, initialLoading: false})\\n );\\n }\",\n \"async index () {\\n return await Operator.all()\\n }\",\n \"function loadFromIndex(storeName, indexName, innerFunction, callback) {\\n var cursor = db.transaction([storeName], 'readonly').objectStore(storeName).index(indexName).openCursor();\\n \\n cursor.onsuccess = function(event) {\\n var result = this.result;\\n if (result) {\\n innerFunction(result);\\n result.continue();\\n }\\n else {\\n callback();\\n }\\n };\\n \\n }\",\n \"loadPage(rawPath) {\\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\\n\\n if (this.pageDb.has(pagePath)) {\\n const page = this.pageDb.get(pagePath);\\n\\n if (true) {\\n return Promise.resolve(page.payload);\\n }\\n }\\n\\n if (this.inFlightDb.has(pagePath)) {\\n return this.inFlightDb.get(pagePath);\\n }\\n\\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\\n const result = allData[1];\\n\\n if (result.status === PageResourceStatus.Error) {\\n return {\\n status: PageResourceStatus.Error\\n };\\n }\\n\\n let pageData = result.payload;\\n const {\\n componentChunkName,\\n staticQueryHashes = []\\n } = pageData;\\n const finalResult = {};\\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\\n finalResult.createdAt = new Date();\\n let pageResources;\\n\\n if (!component) {\\n finalResult.status = PageResourceStatus.Error;\\n } else {\\n finalResult.status = PageResourceStatus.Success;\\n\\n if (result.notFound === true) {\\n finalResult.notFound = true;\\n }\\n\\n pageData = Object.assign(pageData, {\\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\\n });\\n pageResources = toPageResources(pageData, component);\\n } // undefined if final result is an error\\n\\n\\n return pageResources;\\n });\\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\\n // Check for cache in case this static query result has already been loaded\\n if (this.staticQueryDb[staticQueryHash]) {\\n const jsonPayload = this.staticQueryDb[staticQueryHash];\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n }\\n\\n return this.memoizedGet(`${\\\"\\\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\\n const jsonPayload = JSON.parse(req.responseText);\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n });\\n })).then(staticQueryResults => {\\n const staticQueryResultsMap = {};\\n staticQueryResults.forEach(({\\n staticQueryHash,\\n jsonPayload\\n }) => {\\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\\n this.staticQueryDb[staticQueryHash] = jsonPayload;\\n });\\n return staticQueryResultsMap;\\n });\\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\\n let payload;\\n\\n if (pageResources) {\\n payload = { ...pageResources,\\n staticQueryResults\\n };\\n finalResult.payload = payload;\\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\\n page: payload,\\n pageResources: payload\\n });\\n }\\n\\n this.pageDb.set(pagePath, finalResult);\\n return payload;\\n });\\n });\\n inFlightPromise.then(response => {\\n this.inFlightDb.delete(pagePath);\\n }).catch(error => {\\n this.inFlightDb.delete(pagePath);\\n throw error;\\n });\\n this.inFlightDb.set(pagePath, inFlightPromise);\\n return inFlightPromise;\\n }\",\n \"loadPage(rawPath) {\\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\\n\\n if (this.pageDb.has(pagePath)) {\\n const page = this.pageDb.get(pagePath);\\n\\n if (true) {\\n return Promise.resolve(page.payload);\\n }\\n }\\n\\n if (this.inFlightDb.has(pagePath)) {\\n return this.inFlightDb.get(pagePath);\\n }\\n\\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\\n const result = allData[1];\\n\\n if (result.status === PageResourceStatus.Error) {\\n return {\\n status: PageResourceStatus.Error\\n };\\n }\\n\\n let pageData = result.payload;\\n const {\\n componentChunkName,\\n staticQueryHashes = []\\n } = pageData;\\n const finalResult = {};\\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\\n finalResult.createdAt = new Date();\\n let pageResources;\\n\\n if (!component) {\\n finalResult.status = PageResourceStatus.Error;\\n } else {\\n finalResult.status = PageResourceStatus.Success;\\n\\n if (result.notFound === true) {\\n finalResult.notFound = true;\\n }\\n\\n pageData = Object.assign(pageData, {\\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\\n });\\n pageResources = toPageResources(pageData, component);\\n } // undefined if final result is an error\\n\\n\\n return pageResources;\\n });\\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\\n // Check for cache in case this static query result has already been loaded\\n if (this.staticQueryDb[staticQueryHash]) {\\n const jsonPayload = this.staticQueryDb[staticQueryHash];\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n }\\n\\n return this.memoizedGet(`${\\\"\\\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\\n const jsonPayload = JSON.parse(req.responseText);\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n });\\n })).then(staticQueryResults => {\\n const staticQueryResultsMap = {};\\n staticQueryResults.forEach(({\\n staticQueryHash,\\n jsonPayload\\n }) => {\\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\\n this.staticQueryDb[staticQueryHash] = jsonPayload;\\n });\\n return staticQueryResultsMap;\\n });\\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\\n let payload;\\n\\n if (pageResources) {\\n payload = { ...pageResources,\\n staticQueryResults\\n };\\n finalResult.payload = payload;\\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\\n page: payload,\\n pageResources: payload\\n });\\n }\\n\\n this.pageDb.set(pagePath, finalResult);\\n return payload;\\n });\\n });\\n inFlightPromise.then(response => {\\n this.inFlightDb.delete(pagePath);\\n }).catch(error => {\\n this.inFlightDb.delete(pagePath);\\n throw error;\\n });\\n this.inFlightDb.set(pagePath, inFlightPromise);\\n return inFlightPromise;\\n }\",\n \"async index () {\\n const deposito = await Deposito.all();\\n return deposito;\\n }\",\n \"loadPage(rawPath) {\\n const pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\\\"findPath\\\"])(rawPath);\\n\\n if (this.pageDb.has(pagePath)) {\\n const page = this.pageDb.get(pagePath);\\n\\n if (true) {\\n return Promise.resolve(page.payload);\\n }\\n }\\n\\n if (this.inFlightDb.has(pagePath)) {\\n return this.inFlightDb.get(pagePath);\\n }\\n\\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\\n const result = allData[1];\\n\\n if (result.status === PageResourceStatus.Error) {\\n return {\\n status: PageResourceStatus.Error\\n };\\n }\\n\\n let pageData = result.payload;\\n const {\\n componentChunkName,\\n staticQueryHashes = []\\n } = pageData;\\n const finalResult = {};\\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\\n finalResult.createdAt = new Date();\\n let pageResources;\\n\\n if (!component) {\\n finalResult.status = PageResourceStatus.Error;\\n } else {\\n finalResult.status = PageResourceStatus.Success;\\n\\n if (result.notFound === true) {\\n finalResult.notFound = true;\\n }\\n\\n pageData = Object.assign(pageData, {\\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\\n });\\n pageResources = toPageResources(pageData, component);\\n } // undefined if final result is an error\\n\\n\\n return pageResources;\\n });\\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\\n // Check for cache in case this static query result has already been loaded\\n if (this.staticQueryDb[staticQueryHash]) {\\n const jsonPayload = this.staticQueryDb[staticQueryHash];\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n }\\n\\n return this.memoizedGet(`${\\\"\\\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\\n const jsonPayload = JSON.parse(req.responseText);\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n });\\n })).then(staticQueryResults => {\\n const staticQueryResultsMap = {};\\n staticQueryResults.forEach(({\\n staticQueryHash,\\n jsonPayload\\n }) => {\\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\\n this.staticQueryDb[staticQueryHash] = jsonPayload;\\n });\\n return staticQueryResultsMap;\\n });\\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\\n let payload;\\n\\n if (pageResources) {\\n payload = _objectSpread(_objectSpread({}, pageResources), {}, {\\n staticQueryResults\\n });\\n finalResult.payload = payload;\\n _emitter__WEBPACK_IMPORTED_MODULE_2__[\\\"default\\\"].emit(`onPostLoadPageResources`, {\\n page: payload,\\n pageResources: payload\\n });\\n }\\n\\n this.pageDb.set(pagePath, finalResult);\\n return payload;\\n });\\n });\\n inFlightPromise.then(response => {\\n this.inFlightDb.delete(pagePath);\\n }).catch(error => {\\n this.inFlightDb.delete(pagePath);\\n throw error;\\n });\\n this.inFlightDb.set(pagePath, inFlightPromise);\\n return inFlightPromise;\\n }\",\n \"async function initIndex() {\\n await initThemes()\\n fetchAlbumsImgur()\\n M.updateTextFields();\\n}\",\n \"async index () {\\n const atividade = await AtividadeDoDia.all();\\n return atividade;\\n }\",\n \"async function run () {\\n const escenicArticles = await getEscenicArticles(client, elascticsearchSourceIndexParams).catch(console.log)\\n const transformedArticles = transformEscenicArticle(escenicArticles)\\n transformedArticles\\n .map(article => createUrlNavIdMapping(article))\\n // await bulkIndex(transformedArticles)\\n}\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"getAllByIndex(storeName, indexName, keyRange) {\\n const data = [];\\n return from(new Promise((resolve, reject) => {\\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\\n .then((db) => {\\n validateBeforeTransaction(db, storeName, reject);\\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\\n const objectStore = transaction.objectStore(storeName);\\n const index = objectStore.index(indexName);\\n const request = index.openCursor(keyRange);\\n request.onsuccess = (event) => {\\n const cursor = event.target.result;\\n if (cursor) {\\n data.push(cursor.value);\\n cursor.continue();\\n }\\n else {\\n resolve(data);\\n }\\n };\\n })\\n .catch((reason) => reject(reason));\\n }));\\n }\",\n \"function index_esm_async(fn, onError) {\\n return function () {\\n var args = [];\\n for (var _i = 0; _i < arguments.length; _i++) {\\n args[_i] = arguments[_i];\\n }\\n Promise.resolve(true).then(function () {\\n fn.apply(void 0, args);\\n }).catch(function (error) {\\n if (onError) {\\n onError(error);\\n }\\n });\\n };\\n}\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result) || {};\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"constructor(core, baseURL = \\\"/ext/index/X/tx\\\") {\\n super(core, baseURL);\\n /**\\n * Get last accepted tx, vtx or block\\n *\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getLastAccepted = (encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getLastAccepted\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get container by index\\n *\\n * @param index\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getContainerByIndex = (index = \\\"0\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n index,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getContainerByIndex\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get contrainer by ID\\n *\\n * @param containerID\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getContainerByID = (containerID = \\\"0\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n containerID,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getContainerByID\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get container range\\n *\\n * @param startIndex\\n * @param numToFetch\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getContainerRange = (startIndex = 0, numToFetch = 100, encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n startIndex,\\n numToFetch,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getContainerRange\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get index by containerID\\n *\\n * @param containerID\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getIndex = (containerID = \\\"\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n containerID,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getIndex\\\", params);\\n return response.data.result.index;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Check if container is accepted\\n *\\n * @param containerID\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.isAccepted = (containerID = \\\"\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n containerID,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.isAccepted\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n }\",\n \"function load_model(index){\\n if(index >= self.models.length){\\n loaded.resolve();\\n }else{\\n var model = self.models[index];\\n self.pos_widget.loading_message(_t('Loading')+' '+(model.label || model.model || ''), progress);\\n var fields = typeof model.fields === 'function' ? model.fields(self,tmp) : model.fields;\\n var domain = typeof model.domain === 'function' ? model.domain(self,tmp) : model.domain;\\n var context = typeof model.context === 'function' ? model.context(self,tmp) : model.context;\\n var ids = typeof model.ids === 'function' ? model.ids(self,tmp) : model.ids;\\n progress += progress_step;\\n\\n if( model.model ){\\n if (model.ids) {\\n var records = new instance.web.Model(model.model).call('read',[ids,fields],context);\\n } else {\\n var records = new instance.web.Model(model.model).query(fields).filter(domain).context(context).all()\\n }\\n records.then(function(result){\\n try{ // catching exceptions in model.loaded(...)\\n\\n result_filtered = []\\n if(model.model == \\\"product.product\\\")\\n {\\n for(var i = 0; i < result.length; i++)\\n {\\n //Filtrando los productos que tengan stock >0, que no tengan una compañia\\n //o que tengan una compañia asignada y coincida con la que tiene configurada el\\n //punto de venta\\n if(result[i].stock_qty > 0 && (result[i].company_id == false || (result[i].company_id != false && result[i].company_id[0] == self.config.company_id[0])))\\n {\\n result_filtered.push(result[i]);\\n }\\n }\\n result = result_filtered;\\n }\\n\\n $.when(model.loaded(self,result,tmp))\\n .then(function(){ load_model(index + 1); },\\n function(err){ loaded.reject(err); });\\n }catch(err){\\n loaded.reject(err);\\n }\\n },function(err){\\n loaded.reject(err);\\n });\\n }else if( model.loaded ){\\n try{ // catching exceptions in model.loaded(...)\\n $.when(model.loaded(self,tmp))\\n .then( function(){ load_model(index +1); },\\n function(err){ loaded.reject(err); });\\n }catch(err){\\n loaded.reject(err);\\n }\\n }else{\\n load_model(index + 1);\\n }\\n }\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.70689124","0.6799907","0.6459076","0.64186","0.6398918","0.6349781","0.62687784","0.62290114","0.6192579","0.6090689","0.60649323","0.60526985","0.6047419","0.60411704","0.6028308","0.6021699","0.60055244","0.5975181","0.59711975","0.5960433","0.59251773","0.5924601","0.5914405","0.589476","0.58265656","0.5819227","0.5814982","0.58119315","0.57929933","0.5787757","0.5718783","0.5714132","0.5705826","0.57014626","0.56750166","0.56750166","0.5671128","0.56681","0.5637177","0.5609277","0.56085664","0.55957437","0.5586686","0.55646867","0.55642456","0.5556605","0.555313","0.5540329","0.55356765","0.55341953","0.55123407","0.5510772","0.5500237","0.5496024","0.54837537","0.54831994","0.54769605","0.5453688","0.5441287","0.5438654","0.54350406","0.54262793","0.542575","0.5413852","0.54063386","0.5392346","0.5387349","0.53838104","0.53789485","0.537301","0.53658503","0.53520155","0.53439146","0.5334698","0.53222424","0.5315072","0.530383","0.53028625","0.52970886","0.5294206","0.5285951","0.52737993","0.527296","0.52698225","0.52550966","0.52550966","0.52510047","0.5249351","0.5245122","0.5237378","0.5235755","0.523273","0.523273","0.523273","0.523273","0.52324253","0.52306527","0.5224917","0.52231497","0.5220224"],"string":"[\n \"0.70689124\",\n \"0.6799907\",\n \"0.6459076\",\n \"0.64186\",\n \"0.6398918\",\n \"0.6349781\",\n \"0.62687784\",\n \"0.62290114\",\n \"0.6192579\",\n \"0.6090689\",\n \"0.60649323\",\n \"0.60526985\",\n \"0.6047419\",\n \"0.60411704\",\n \"0.6028308\",\n \"0.6021699\",\n \"0.60055244\",\n \"0.5975181\",\n \"0.59711975\",\n \"0.5960433\",\n \"0.59251773\",\n \"0.5924601\",\n \"0.5914405\",\n \"0.589476\",\n \"0.58265656\",\n \"0.5819227\",\n \"0.5814982\",\n \"0.58119315\",\n \"0.57929933\",\n \"0.5787757\",\n \"0.5718783\",\n \"0.5714132\",\n \"0.5705826\",\n \"0.57014626\",\n \"0.56750166\",\n \"0.56750166\",\n \"0.5671128\",\n \"0.56681\",\n \"0.5637177\",\n \"0.5609277\",\n \"0.56085664\",\n \"0.55957437\",\n \"0.5586686\",\n \"0.55646867\",\n \"0.55642456\",\n \"0.5556605\",\n \"0.555313\",\n \"0.5540329\",\n \"0.55356765\",\n \"0.55341953\",\n \"0.55123407\",\n \"0.5510772\",\n \"0.5500237\",\n \"0.5496024\",\n \"0.54837537\",\n \"0.54831994\",\n \"0.54769605\",\n \"0.5453688\",\n \"0.5441287\",\n \"0.5438654\",\n \"0.54350406\",\n \"0.54262793\",\n \"0.542575\",\n \"0.5413852\",\n \"0.54063386\",\n \"0.5392346\",\n \"0.5387349\",\n \"0.53838104\",\n \"0.53789485\",\n \"0.537301\",\n \"0.53658503\",\n \"0.53520155\",\n \"0.53439146\",\n \"0.5334698\",\n \"0.53222424\",\n \"0.5315072\",\n \"0.530383\",\n \"0.53028625\",\n \"0.52970886\",\n \"0.5294206\",\n \"0.5285951\",\n \"0.52737993\",\n \"0.527296\",\n \"0.52698225\",\n \"0.52550966\",\n \"0.52550966\",\n \"0.52510047\",\n \"0.5249351\",\n \"0.5245122\",\n \"0.5237378\",\n \"0.5235755\",\n \"0.523273\",\n \"0.523273\",\n \"0.523273\",\n \"0.523273\",\n \"0.52324253\",\n \"0.52306527\",\n \"0.5224917\",\n \"0.52231497\",\n \"0.5220224\"\n]"},"document_score":{"kind":"string","value":"0.7352213"},"document_rank":{"kind":"string","value":"0"}}},{"rowIdx":75,"cells":{"query":{"kind":"string","value":"A class to define how a fighter behaves. Gun constructor Sets the properties with the provided arguments"},"document":{"kind":"string","value":"function Gun(x, y, size) {\n this.x = x;\n this.y = y;\n this.size = size;\n this.angle;\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 Gun(descr) {\n\n // Common inherited setup logic from Entity\n this.setup(descr);\n\n this.rememberResets();\n\t\n\tthis.tower = g_sprites.tower;\n this.diamond = g_sprites.diamond;\n\t\n\tthis.towerHeight = this.tower.height;\n\tthis.towerWidth = this.tower.width;\n\t\n // Set normal drawing scale, and warp state off\n this._scale = 0;\n\n this.cooldown = this.getCooldown();\n}","function Gun() {\n ( function init( self )\n {\n self.bulletCountMax = 30;\n self.timeBetweenBullet = 100;\n self.timeReload = 2500;\n\n // State: 0: Can fire, 1: cooldown between bullets, 2: reloading\n self.state = 0;\n self.bulletCount = self.bulletCountMax;\n self.timeSinceLastBullet = 0;\n self.timeSinceReload = 0;\n\n self.animationTime = 0;\n } ) ( this );\n}","function Gun(name, type, range, auto, db, magSize, maxMagSize, ammoType, bullet, melee) {\r\n // Properties\r\n // Basic properties\r\n this.name = name;\r\n this.type = type;\r\n this.range = range;\r\n this.isFullAuto = auto;\r\n this.noise = db;\r\n this.magSize = magSize;\r\n\tthis.maxMagSize = maxMagSize;\r\n this.ammoType = ammoType;\r\n this.bulletDamage = bullet;\r\n this.meleeValue = melee;\r\n\r\n // Secondary fire mode properties\r\n this.secondaryFire = false;\r\n this.secondaryFireAmmo = null;\r\n\tthis.secondaryFiremaxMag = null;\r\n\tthis.secondaryDamage = null;\r\n\tthis.ammoSecondaryType = null;\r\n\r\n // Modifiers\r\n this.rangeModifier = 0;\r\n this.scopeAttached = false;\r\n\tthis.magAttached = false;\r\n\tthis.silencerAttached = false;\r\n\tthis.bayonetAttached = false;\r\n this.noiseModifier = 0;\r\n this.magModifier = null;\r\n this.damageModifier = 0;\r\n this.accuracyModifier = 0;\r\n this.meleeValueModifier = 0;\r\n\r\n // Methods\r\n /*\r\n\tNOTES:\r\n\tMoved the methods to here instead of gun.prototype because we do not want to modify the object that the gun extends... which is the Object object.\r\n\tMeaning that, before, *all* objects had a SprayAndPray method.\r\n\tHowever, if you make a new object that derives from gun, you can use myObject.prototype.myMethod to add myMethod to the gun object.\r\n */\r\n\r\n /*\r\n\tAdds an attachment to the gun\r\n\tattachment - string - name of attachment to apply\r\n */\r\n this.addAttachment = function(attachment) {\r\n\tvar output = \"\";\r\n\r\n\tswitch(attachment) {\r\n\t case \"GP-30 grenade launcher\":\r\n\t\tif (this.type === \"russian assault rifle\") {\r\n\t\t this.secondaryFire = true;\r\n\t\t this.secondaryFireAmmo = 1;\r\n\t\t\tthis.secondaryFiremaxMag = 1;\r\n\t\t\tthis.secondaryDamage = 300;\r\n\t\t\tthis.ammoSecondaryType = \"grenades\";\r\n\t\t\tdocument.getElementById(\"grenadeLauncherAttachment\").innerHTML = \"\";\r\n\t\t output = \"

                    The GP-30 grenade launcher slides onto the rails under your \"+ this.name +\". The smell of gun grease and sweat wafts up from the heat that radiates off of the ground and into your nostrils as a sickly sweet aroma. You grin slightly, cocking the weapon to the side to admire your handiwork and slide a grenade into your newly attached piece of hardware. It is now ready to fire. Click the grenade icon in the secondary fire pane, and then on the target you wish to attack!

                    \";\r\n\t\t} else {\r\n\t\t output = \"

                    You can only use this attachment with a russian-made assault rifle.

                    \";\r\n\t\t}\r\n\t break;\r\n\r\n\t case \"Red dot sight\":\r\n\t\tthis.rangeModifier = 20;\r\n\t\tthis.scopeAttached = true;\r\n\t\tdocument.getElementById(\"scopeAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    Your red dot sight slides into position with a slight *click*. You check your sights and make the necessary adjustments. Good to go. You now have a \" + this.rangeModifier + \" point accuracy bonus.

                    \";\r\n\t break;\r\n\r\n\t case \"Reflex sight\":\r\n\t\tthis.rangeModifier = 10;\r\n\t\tthis.scopeAttached = true;\r\n\t\tdocument.getElementById(\"scopeAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    Your reflex sight attaches with no issue. You tweak the settings until you are happy with them and begin staring down the sights intently for the kill.

                    \";\r\n\t break;\r\n\r\n\t case \"6H5 type bayonet\":\r\n\t\tthis.bayonetAttached = true;\r\n\t\tthis.meleeValueModifier = 20;\r\n\t\tdocument.getElementById(\"bayonetAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You affix the 6H5 type bayonet to the end of your weapon and let loose a maniacal guffaw! You now have a [20] point damage bonus for melee attacks.

                    \";\r\n\t break;\r\n\r\n\t case \"Silencer\":\r\n\t\tthis.silencerAttached = true;\r\n\t\tthis.noiseModifier = 40;\r\n\t\tdocument.getElementById(\"silencerAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You screw the silencer onto the end of your weapon with no problems.

                    \";\r\n\t break;\r\n\r\n\t case \"Extended Magazine\":\r\n\t this.magModifier = 54;\r\n\t\tthis.magAttached = true;\r\n\t this.magSize = (this.magModifier + this.magSize);\r\n\t\tthis.maxMagSize = (this.magModifier + this.magSize);\r\n\t\tdocument.getElementById(\"magAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You slide in a fresh drum magazine for your \" + this.name + \". It pops into place with a satisfying clicking noise. A wicked grin pulls at the corners of your lips and you begin checking your sights. \" + \"Your total magazine capacity for this gun has been upgraded to \" + this.magSize + \" shots of \" + this.ammoType + \".

                    \";\r\n break;\r\n\r\n\t case \"Standard magazine (AK)\":\r\n\t\tthis.magModifier = 0;\r\n\t\tthis.magSize = 15;\r\n\t\tthis.maxMagSize = 15;\r\n\t\tthis.magAttached = false;\r\n\t\tdocument.getElementById(\"magAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You slide in a standard 15 round magazine for your \" + this.type + \".

                    \";\r\n\t break;\r\n\r\n\t\t\r\n\t\tcase \"Standard iron sights\":\r\n\t\tthis.rangeModifier = 0;\r\n\t\tthis.scopeAttached = false;\r\n\t\tdocument.getElementById(\"scopeAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You remove the scope from your weapon and go back to using your standard iron sights.

                    \";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"no bayonet\":\r\n\t\tthis.meleeValueModifier = 0;\r\n\t\tthis.bayonetAttached = false;\r\n\t\tdocument.getElementById(\"bayonetAttachment\").innerHTML = \"\";\r\n\t output = \"

                    You remove the bayonet from your weapon.

                    \";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"no grenades\":\r\n\t\tthis.secondaryFire = false;\r\n\t\tthis.secondaryFireAmmo = null;\r\n\t\tthis.secondaryFiremaxMag = null;\r\n\t\tthis.secondaryDamage = null;\r\n\t\tthis.ammoSecondaryType = null;\r\n\t\tdocument.getElementById(\"grenadeLauncherAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You detach the grenade launcher from your weapon.

                    \";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"no silencer\":\r\n\t\tthis.silencerAttached = false;\r\n\t\tthis.noiseModifier = 0;\r\n\t\tdocument.getElementById(\"silencerAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You unscrew the silencer from the end of your weapon.

                    \";\r\n\t break;\r\n\t\t\r\n\t\tdefault:\r\n\t\toutput = \"

                    This attachment is nowhere to be found in your pack! Most unfortunate.

                    \";\r\n\t break;\r\n\t}\r\n\t\r\n\t\r\n\r\n\tLogInfo(output);\r\n } // addAttachment\r\n\r\n /*\r\n\tBust a cap. Or many of them, as the case may be.\r\n\ttarget - object - the thing that you want to make dead\r\n */\r\n this.sprayAndPray = function(target){\r\n\tvar output = \"\",\r\n\t randomSeed = Math.floor(Math.random() * 10 + 3),\r\n\t newMagSize = 0,\r\n\t damageDealt = 0;\r\n\r\n\tif (!target.dead && target.isAlive) {\r\n\t if (this.isFullAuto) {\r\n\t\t\r\n\t\t// Checks to see if we have enough ammo and fires if we do!\r\n\t\tif (this.magSize >= 3) {\r\n\t\t newMagSize = this.magSize - randomSeed;\r\n\t\t damageDealt = this.bulletDamage * randomSeed;\r\n\t\t output = \"

                    You switch your \" + this.type +\" over to full-auto and throw some hot lead downrange with your \"+ this.name +\"! *BRRRRAPP!* You fired \" + randomSeed + \" shots for a combined total damage score of \"+ damageDealt + \" (\"+ this.bulletDamage + \" per round).

                    \";\r\n\t\t} else {\r\n\t\t output = \"

                    Please reload your weapon.

                    \";\r\n\t\t}\r\n\t } else {\r\n\t\toutput = \"

                    You cannot spray and pray with a non-automatic weapon. Try taking an aimed shot instead.

                    \";\r\n\t }\r\n\r\n\t if (damageDealt > target.health && target.isAlive && target.isLiving) {\r\n\t\ttarget.dead = true;\r\n\t\toutput += \"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \" + target.name + \"'s head courtesy of your \" + this.type +\", Effectively killing the *shit* out of it! \" + target.deathKnell + \" You have \" + newMagSize + \" rounds of \" + this.ammoType + \" left!

                    \";\r\n\t } else if (damageDealt === target.health && target.isAlive && target.isLiving) {\r\n\t\ttarget.dead = true;\r\n\t\toutput += \"

                    You scored a direct hit on \" + target.name + \"! \" + \" blood spurts from an artery, and they drop to the floor still twitching. \" + target.deathKnell + \" You have \" + newMagSize + \" rounds of \" + this.ammoType +\" left!

                    \";\r\n\t } else if (damageDealt >= target.health && target.isAlive && !target.isLiving) {\r\n\t\ttarget.dead = true;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t\toutput += \"

                    You destroyed the \" + target.name + \"! \" + target.deathKnell + \" You have \" + newMagSize + \" shots of \" + this.ammoType + \" left!

                    \";\r\n\t } else {\r\n\t\ttarget.health = target.health - damageDealt;\r\n\t\tthis.magSize = newMagSize;\r\n\t output += \"

                    Your volley of shots strikes \"+ target.name + \". They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t }\r\n\t} else {\r\n\t output = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\r\n\tLogInfo(output);\r\n } // sprayAndPray\r\n\t\r\n\t\r\n\r\n\t// Bust *a* cap. in the singular case this time! Arriba!\r\n\tthis.aimedShot = function(target){\r\n\r\n\tvar output = \"\";\r\n\r\n\t// is it dead?\r\n if (!target.dead) {\t\r\n\t\r\n\t\t newMagSize = 0;\r\n\t damageDealt = 0;\r\n\t\t\r\n\t// do we have enough ammo? if so let's rock!\r\n\tif (this.magSize >= 1) {\t\r\n\t\tnewMagSize = this.magSize - 1;\r\n\t damageDealt = this.bulletDamage;\t\t\r\n\tif (damageDealt > target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.magSize = newMagSize;\r\n\t output += \"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \" + target.name + \"'s head courtesy of your \" + this.type +\", Effectively killing the *shit* out of it! \" + target.deathKnell + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t} else if (damageDealt === target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.magSize = newMagSize;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You scored a fatal hit on \" + target.name + \"! \" + \" blood spurts from an artery in a glorious crimson fountain in front of them, and they drop to the floor still twitching. \" + target.deathKnell + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t} else if (damageDealt >= target.health && !target.isLiving) {\r\n\t target.dead = true;\r\n\t\tthis.magSize = newMagSize;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You destroyed the \" + target.name + \"! \" + target.deathKnell + \"

                    \";\r\n\t} else {\r\n\t target.health = target.health - damageDealt;\r\n\t\tthis.magSize = newMagSize;\r\n\t output += \"

                    Steadying your weapon, you level a well-placed shot into \"+ target.name + \" For [\" + this.bulletDamage + \"] points of damage. They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t}\t\r\n\t}else{\r\n\toutput += \"

                    Please reload your weapon

                    \";\r\n\t}\t\t\r\n\t}else{\r\n\toutput = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\tLogInfo(output);\r\n\t} // Aimed shot\r\n\t\r\n\t\r\n\r\n\t// Gettin' stabby with it (melee)!\r\n\r\n\tthis.attackMelee = function(target){\r\n\r\n\tvar output = \"\";\r\n\r\n\t// is it dead?\r\n if (!target.dead) {\t\r\n\t\r\n\t damageDealt = this.meleeValueModifier + this.meleeValue;\r\n\t\t\t\t\r\n\tif (damageDealt > target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t output += \"

                    [CRITICAL HIT] You completely decapitated \" + target.name + \" with your insane melee skills, Effectively killing the *shit* out of it! \" + target.deathKnell + \"

                    \";\r\n\t} else if (damageDealt === target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You land a devastating blow on \" + target.name + \"! \" + \" blood pours from a wound you have left in their throat, and they drop to the floor still twitching. \" + target.deathKnell + \"

                    \";\r\n\t} else if (damageDealt >= target.health && !target.isLiving) {\r\n\t target.dead = true;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You destroyed the \" + target.name + \"! \" + target.deathKnell + \"

                    \";\r\n\t} else {\r\n\t target.health = target.health - damageDealt;\r\n\t output += \"

                    You swing frantically at \"+ target.name + \" For [\" + damageDealt + \"] points of damage. They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \"

                    \";\r\n\t}\t\r\n\t}else{\r\n\toutput = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\tLogInfo(output);\r\n\t} // attackMelee\r\n\t\r\n\t\r\n\t// Lob a grenade!\r\n\tthis.grenade = function(target){\r\n\tvar output = \"\";\r\n\r\n\t// is it dead?\r\n if (!target.dead) {\t\r\n\t\r\n\t\t newSecondaryMagSize = 0;\r\n\t damageDealt = 0;\r\n\t\t\r\n\t// do we have enough ammo? if so let's rock!\r\n\tif (this.secondaryFireAmmo >= 1) {\t\r\n\t\tnewSecondaryMagSize = this.secondaryFireAmmo - 1;\r\n\t damageDealt = this.secondaryDamage;\t\t\r\n\tif (damageDealt > target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    [CRITICAL HIT] Your attack obliterated \" + target.name + \". \" + target.deathKnell + \" You now have \" + newSecondaryMagSize +\" Rounds of \"+ this.ammoSecondaryType +\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \";\r\n\t} else if (damageDealt === target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    The explosion splatters \" + target.name + \" all over the room! \" + target.deathKnell + \" You now have \" + newSecondaryMagSize +\" Rounds of \"+ this.ammoSecondaryType +\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \";\r\n\t} else if (damageDealt >= target.health && !target.isLiving) {\r\n\t target.dead = true;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You exploded the \" + target.name + \"! \" + target.deathKnell + \"

                    \";\r\n\t} else {\r\n\t target.health = target.health - damageDealt;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\t\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t output += \"

                    You launch a well-placed shot with one of your \" + this.ammoSecondaryType + \". \"+ target.name + \" was hit For a whopping [\" + this.secondaryDamage + \"] points of damage. They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \" You now have \" + newSecondaryMagSize +\" Rounds of \"+ this.ammoSecondaryType +\" left in your launcher. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \";\r\n\t}\t\r\n\t}else{\r\n\toutput += \"

                    Please reload your grenade launcher

                    \";\r\n\t}\t\t\r\n\t}else{\r\n\toutput = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\tLogInfo(output);\r\n\t} // Grenade\r\n\t\r\n\t\r\n\t\r\n\t//reload function\r\n\tthis.reload = function(){\r\n\t\r\n\t\tcurrentRounds = this.magSize + this.magModifier;\r\n\t\r\n\t\tif( currentRounds === this.maxMagSize){\r\n\t\t\r\n\t\toutput = \"You do not need to reload this weapon.\";\r\n\t\t\r\n\t\t}else{\r\n\t\t\r\n\t\tamountToReload = this.maxMagSize - currentRounds;\r\n\t\tthis.magSize = this.magSize + amountToReload;\r\n\t\toutput = \"You reload your weapon. You now have \" + this.magSize + \" rounds of \" + this.ammoType + \".\";\r\n\t\tLogInfo(output);\r\n\t\t\r\n\t\t}\r\n\t}// reload\r\n\t\r\n\t\r\n\t\r\n\t//secondary reload function (used for alt. fire weapons)\r\n\tthis.secondaryReload = function(){\r\n\t\r\n\t\tAKS74u.secondaryFireAmmo = 1;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + AKS74u.secondaryFireAmmo;\r\n\t\toutput = \"You reload another grenade\";\r\n\t\tLogInfo(output);\r\n\t}// secondary reload\r\n\t\r\n\t\r\n\t}","function Person(name, stance, perception, taunt){\r\n this.name = name;\r\n this.stance = stance;\r\n this.perception = perception;\r\n this.taunt = taunt;\r\n this.weapon = null;\r\n\t\r\n\t/* \r\n\tcurrent attack mode property for players (starts as single shot)\r\n\t*/\r\n\tthis.currentAttackMode = \"single\";\r\n\r\n /*\r\n\tGo ahead, give them a gun, see if I care.\r\n\tgun - object - the gun to equip them with\r\n */\r\n this.arm = function(gun) {\r\n\tthis.weapon = gun;\r\n }\r\n\r\n /*\r\n\tAttacks with the current weapon\r\n\ttarget - object - the thing you want to attack\r\n */\r\n this.attack = function(target) {\r\n\tthis.weapon.sprayAndPray(target);\r\n }\r\n\t\r\n\t/*\r\n\tAttacks with single shot\r\n\t*/\r\n\tthis.attackSingle = function(target) {\r\n\tthis.weapon.aimedShot(target);\r\n }\r\n\t\r\n\t/*\r\n\tAttacks with melee\r\n\t*/\r\n\tthis.attackMelee = function(target) {\r\n\tthis.weapon.attackMelee(target);\r\n }\r\n\t\r\n\t/*\r\n\tAttacks with grenade\r\n\t*/\r\n\tthis.attackGrenade = function(target) {\r\n\tthis.weapon.grenade(target);\r\n }\r\n\t\r\n}","function DoggoFighter(name,specialAbility){\n this.name = name;\n this.specialAbility = specialAbility;\n}","constructor(name, legs, isDanger){\n super(name, legs)//properties inherited from the parent class\n this.isDanger = isDanger\n }","function Gun( ownerImage, projectileImage, shoot ) {\n this.ownerImage = ownerImage;\n this.image = projectileImage;\n this.shoot = shoot;\n if (this.shoot === undefined) {\n // Do nothing\n this.shoot = function() {\n \n }\n }\n}","youngGun(args) {\n return this.createGameObject(\"YoungGun\", young_gun_1.YoungGun, args);\n }","function Dog(hungry) {\n\n this.status = \"normal\";\n this.color = \"black\";\n this.hungry = \"hungry\";\n}","function Penguin(name){\n this.name = name;\n this.numLegs = 2;\n}","function Penguin(name){\n this.name = name;\n this.numLegs = 2;\n}","function Penguin(name){\n this.name = name;\n this.numLegs = 2;\n}","function Warrior(heroName=\"Cloud\", heroLevel=99, heroWeapon=\"the Brotherhood\") {\n // In order to effectively call 'super' in JS, we use \n Hero.call(this, heroName, heroLevel);\n this.heroWeapon = heroWeapon;\n}","constructor(name, health, speed, strength, wisdom){\n super(name);\n this.health = 200;\n this.speed = 10;\n this.strength = 10;\n this.wisdom = 10;\n }","function Fighter(name, health, damagePerAttack) {\n this.name = name\n this.health = health;\n this.damagePerAttack = damagePerAttack;\n this.toString = function() { return this.name; }\n}","function Penguin(name) {\n this.name = name;\n this.numLegs = 2;\n}","function Penguin(name) {\n this.name = name;\n this.numLegs = 2;\n}","constructor(...args) {\n super(...args);\n\n this.addClasses('character');\n this.directionX = 0;\n this.directionY = 0;\n }","function Ninja(name, health=100) {\n // create a private variable that stores a reference to the new object we create\n var self = this;\n var strength =3;\n var speed =3;\n this.nameT = name;\n this.healthT =health;\n\n this.sayName = function(){\n console.log(`My ninja name is ${this.nameT}`)\n } \n this.showStats = function() {\n console.log(`Name: ${this.nameT} , Health is ${this.healthT} , Speed: ${speed} , Strength${strength}` )\n }\n \n this.drinkSake = function() {\n this.healthT +=10;\n }\n\n\n // this.method = function() {\n // console.log( \"I am a method\");\n\n // var privateMethod = function() {\n // console.log(\"this is a private method for \" + self.name);\n // console.log(self);\n // }\n // this.age = age;\n // this.greet = function() {\n // console.log(\"Hello my name is \" + this.name + \" and I am \" + this.age + \" years old!\");\n // // we can access our attributes within the constructor!\n // console.log(\"Also my privateVariable says: \" + privateVariable)\n // // we can access our methods within the constructor!\n // privateMethod();\n // }\n}","function Fighter(name, health, damagePerAttack, special, avatar) {\n this.name = name;\n this.health = health;\n this.maxHealth = health;\n this.damagePerAttack = damagePerAttack;\n this.special = special;\n this.avatar = avatar;\n this.toString = function() {\n return this.name;\n };\n}","function Penguin(name) { // All penguins have 2 legs, so we only need the function parameter name\n this.name = name;\n this.numLegs = 2;\n}","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.corpses = 0;\n this.isCastle = false;\n this.isGoldMine = false;\n this.isGrass = false;\n this.isIslandGoldMine = false;\n this.isPath = false;\n this.isRiver = false;\n this.isTower = false;\n this.isUnitSpawn = false;\n this.isWall = false;\n this.isWorkerSpawn = false;\n this.numGhouls = 0;\n this.numHounds = 0;\n this.numZombies = 0;\n this.owner = null;\n this.tileEast = null;\n this.tileNorth = null;\n this.tileSouth = null;\n this.tileWest = null;\n this.tower = null;\n this.unit = null;\n this.x = 0;\n this.y = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","function AllianceFaction(Character, Class, Gender, Profession){\n this.Character = Character;\n this.Class = Class;\n this.Gender = Gender;\n this.Profession = Profession;\n this.profile = function(){\n return `My race is ${this.Character}, I am a ${this.Gender} ${this.Class}, I specialize in ${this.Profession}`;\n // console.log(this);\n }\n}","function Weapon(name, target) {\n this.name = name;\n this.target = target;\n}","function Gun(x, y, size)\n{\n\tthis.x = x;\n\tthis.y = y;\n\tthis.size = size;\n}","constructor()\n\t{\n\t\tthis.HP = 100;\n\t\tthis.dmg = 30;\n\t\tthis.evasion = 15;\n\n\t\t//boolean for special move\n\t\tthis.fly = 0;\n\t\tthis.invi = 0;\n\t\tthis.slammed = 0;\n\n\t\tthis.alive = true;\n\t}","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.canMove = false;\n this.drunkDirection = '';\n this.focus = 0;\n this.health = 0;\n this.isDead = false;\n this.isDrunk = false;\n this.job = '';\n this.owner = null;\n this.tile = null;\n this.tolerance = 0;\n this.turnsBusy = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","function Warrior(name, health, anger) {\n Hero.call(this, name, health);\n this.anger = anger;\n}","function Ninja() {\r\n this.swung = true;\r\n}","function Penguin(name, numLegs){\n this.name = name;\n this.numLegs = numLegs;\n}","initialize() {\n // prepare characters for fighting\n this.c1.prepareForFight();\n this.c2.prepareForFight();\n\n // show characters stats\n console.log('Players are ready to fight!');\n this.c1.printStats();\n this.c2.printStats();\n\n // who starts the fight?\n if (\n // character 1 is faster?\n this.c1.speed > this.c2.speed ||\n (\n // same speed...\n this.c1.speed === this.c2.speed &&\n // ...but character 1 is luckier\n this.c1.luck > this.c2.luck\n )\n ) {\n // character 1 starts the fight\n this.attacker = this.c1;\n this.defender = this.c2;\n } else {\n // character 2 starts the fight\n this.attacker = this.c2;\n this.defender = this.c1;\n }\n }","function Greetr()\r\n{\r\n this.greeting = 'Hola mundo!';\r\n}","function dragonConstructor(name, age){\n\tthis.species = \"Dragon\";\n\tthis.size = \"Enormous\";\n\tthis.isDead = false;\n\tthis.name = name;\n\tthis.age = age;\n\n\tthis.getDefeated = () => this.isDead = true;\n}","function Dog() {\nthis.name = \"Rupert\";\nthis.color = \"brown\";\nthis.numLegs = 4;\n}","function fighterStats(name, hp, atk, def) {\n this.name = name;\n this.hp = hp;\n this.hp2 = hp;\n this.atk = atk;\n this.def = def;\n\n /** Takes damage from an enemy@param{int} damage The damage taken*/\n this.takeDamage = function(damage) {\n var damageTaken = Math.abs(damage - this.def);\n if(damage <= this.def) {\n damageTaken = 1;\n }\n this.hp2 = this.hp2 - damageTaken;\n this.hp2 = this.hp2 < 0 ? 0 : this.hp2;\n console.log(damageTaken);\n // console.log('You have taken ' + damage + 'damage!');\n }\n}","function Ninja(name, health=100, speed=3, strength=3){\n this.name=name;\n this.health=health;\n this.speed=speed;\n this.strength = strength;\n this.sayName = function(){\n console.log(\"My ninja name is \"+name);\n };\n}","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n /**\n * The name of the game.\n */\n this.name = 'Chess';\n\n // default values for private member values\n this.currentPlayer = null;\n this.currentTurn = 0;\n this.fen = '';\n this.gameObjects = {};\n this.maxTurns = 0;\n this.moves = [];\n this.pieces = [];\n this.players = [];\n this.session = '';\n this.turnsToDraw = 0;\n }","constructor(){\n console.log(\"Creating a new alien\")\n this.health = 100;\n this.damage = 50;\n\n }","function Dog() {\n this.name = \"Rex\";\n this.color = \"Black\";\n this.numLegs = 4;\n}","function Dog() {\n this.name = \"Rusty\";\n this.color = \"Golden\";\n this.numLegs = 4;\n}","function turtle(name,color,weapon,favoritePizzaType){\n this.name=name;\n this.color=color;\n this.weapon=weapon;\n this.favoritePizzaType=favoritePizzaType;\n}","constructor(name, age, breed, color) {\n // Set those equal to the instance\n this.name = name;\n this.age = age;\n this.breed = breed;\n this.color = color;\n this.energyLevel = 0;\n this.barkLevel = 10;\n }","function Ninja(name) {\n this.name = name;\n this.health = 100;\n const speed = 3;\n const strength = 3;\n \n // Add methods to the Ninja prototype\n // Log the Ninja's name to the console\n Ninja.prototype.sayName = function() {\n console.log(\"My ninja name is \" + this.name + \"!\");\n return this;\n };\n\n // Shows the Ninja's Strength and Speed, and their Health\n Ninja.prototype.showStats = function() {\n console.log(\"Name: \" + this.name + \", \" + \"Health: \" + this.health + \", \" + \"Speed: \" + speed + \", \" + \"Strength: \" + strength);\n return this;\n };\n\n // Adds +10 Health to the Ninja\n Ninja.prototype.drinkSake = function() {\n this.health += 10;\n return this;\n };\n\n // Takes another Ninja instance and subtracts 5 Health from the Ninja passed in\n Ninja.prototype.punch = function(punchReceiver) {\n // Validation to only accept instances of the Ninja class\n if (punchReceiver instanceof Ninja) {\n punchReceiver.health -= 5;\n console.log(punchReceiver.name + \" was punched by \" + this.name + \" and lost 5 Health!\");\n } else {\n console.log(\"Not a Ninja\")\n };\n return this;\n };\n\n // Subtracts 15 Health for each point of Strength the calling Ninja has, and like .punch() will take another Ninja instance\n Ninja.prototype.kick = function(kickReceiver) {\n // Validation to only accept instances of the Ninja class\n if (kickReceiver instanceof Ninja) {\n const kickDamage = 15 * strength;\n kickReceiver.health -= kickDamage;\n console.log(kickReceiver.name + \" was kicked by \" + this.name + \" and lost \" + kickDamage + \" Health!\");\n } else {\n console.log(\"Not a Ninja\")\n };\n return this;\n };\n}","constructor(name, hull, firePower, accuracy) { // constructors are info about class (this. belongs to constructor)\n this.name = name;\n this.hull = hull;\n this.firePower = firePower;\n this.accuracy = accuracy;\n }","function Person(name, weapon) {\n this.name = name;\n this.weapon = weapon;\n}","function Game_Troop() {\n this.initialize.apply(this, arguments);\n}","constructor(name){\n console.log(\"Creating a new alien\")\n this.health = 100;\n this.damage = 50;\n //assigned to the object being created\n this.name = name; \n\n }","function Penguin(name, numLegs) {\n this.name = name;\n this.numLegs = numLegs;\n}","function Game_Unit() {\n this.initialize.apply(this, arguments);\n}","function Ninja(name){\n\n\tlet speed = 3;\n\tlet strength = 3;\n\tthis.name = name;\n\tthis.health = 100;\n\n\tthis.sayName = function(){\n\t\tconsole.log(this.name);\n\t}\n\n\tthis.showStats = function(){\n\t\tconsole.log(`Name: ${this.name}, Health: ${this.health}, Strength: ${strength}, Speed: ${speed}`);\n\t}\n\n\tthis.drinkSake = function(){\n\t\tthis.health += 10;\n\t\treturn this;\n\t}\n\n\tthis.punch = function(target){\n\t\tif(target instanceof Ninja){\n\t\t\ttarget.health -= 5;\n\t\t\tconsole.log(`${target.name} was punched by ${this.name} and health is down to ${target.health}`);\n\t\t}\n\t\telse{\n\t\t\tconsole.log(`You can't punch a ${target.constructor.name}`);\n\t\t}\n\t}\n\n\tthis.kick = function(target){\n\t\tif(target instanceof Ninja){\n\t\t\ttarget.health -= 15;\n\t\t\tconsole.log(`${target.name} was kicked by ${this.name} and health is down to ${target.health}`);\n\t\t}\n\t\telse{\n\t\t\tconsole.log(`You can't kick a ${target.constructor.name}`);\n\t\t}\n\t}\n\n}","function Player () {\n\t this.x = 450; \n\t this.y = 850;\n\t this.w = 20;\n\t this.h = 20;\n\t this.deltaX = 0;\n\t this.deltaY = 0;\n\t this.xTarget = 0;\n\t this.yTarget = 0;\n\t this.tired = false;\n\t this.speed = 0;\n\t this.topSpeed = 5;\n\t this.energy = 150;\n\t this.maxEnergy = 150;\n\t this.maxHealth = 150;\n\t this.health = 150;\n\t this.recovery = 0\n\t this.xcenter = 400;\n\t this.ycenter = 300;\n\t this.fill = '#000000';\n\t this.xdirection = 1;\n\t this.ydirection = 0;\n\t this.acceleration = 0.4;\n\t this.radius = 0;\n\t this.angle = 1.7;\n\t this.mot = 0;\n\t this.closestVehicle = 0;\n\t this.distanceFromVehicle = 0;\n\t this.gettingInVehicle = 0;\n\t this.inBuilding = 0;\n\t this.walkTimer = 0;\n\t this.xVector = 0;\n\t this.yVector = 0;\n\t this.standImage = playerStand;\n\t this.walkAnimations = [\"\", playerWalk1, playerWalk2, playerWalk3, playerWalk4];\n\t this.activeWeapon = -1;\n\t this.weaponsPossessed = [\n\t\t{name: \"Pistol\", img: \"\", possess: false, ammo: 0, notHaveColor: '#783a3a', haveColor: 'red'},\n\t\t{name: \"Machine Gun\", img: \"\", possess: false, ammo: 0, notHaveColor: '#595c38', haveColor: '#fffb00'},\n\t\t{name: \"Plasma Gun\", img: \"\", possess: false, ammo: 0, notHaveColor: '#388994', haveColor: '#05e2ff'},\n\t\t{name: \"Rocket Launcher\", img: \"\", possess: false, ammo: 0, notHaveColor: '#661b61', haveColor: '#ff00ee'}\n\t ];\n\t this.weaponCount = 0;\n\t this.nearDoor = false;\n\t this.nearBuilding = false;\n\t this.ammo = [1000, 1500, 2000, 50, 30]\n\t this.kills = 0;\n\t this.points = 100;\n\t this.maxPoints = 10000;\n\t this.onTile = {x: 0, y: 0};\n\t this.inBounds = {\n\n\t }\n\t this.fBuffer = 0\n\t this.onWeaponIcon = -1;\n\t this.onPerkIcon = -1;\n\t this.interactTimer = 0;\n\t this.interactDebounceTime = 50;\n\t this.walkedOn = {\n\t\tsand: false,\n\t\twater: false,\n\t\tgrass: false, \n\t }\n}","function OogaahBattlefield() {\n\tOogaahPile.apply(this, null); // construct the base class\n}","function Weapon() {\r\n this.name;\r\n this.type;\r\n}","function User() {\r\n //\"this\" refers back to the object that calls it and is assigned the users name later on in the code\r\n this.name = \"\";\r\n //this starts each user with 100 health\r\n this.life = 100;\r\n /*this is a function that takes the parameter \"targetPlayer\" (which is the player that would lose health) and\r\n adds 1 to the target players health while at the same time decreasing the user who is giving health by 1\r\n */\r\n this.givelife = function givelife(targetPlayer) {\r\n targetPlayer.life += 1;\r\n this.life -= 1;\r\n console.log(this.name, 'gave one life to', targetPlayer.name)\r\n };\r\n}","constructor(name, weapon, type){ // Constructor is something only for subclass\n // console.log(this) - js wont allow us to run this in subclass untill we use the super() keyword\n super(name, weapon); // Super calls the super class of elf (Character). It goes up and calls the constructor\n console.log('this from subclass', this)\n this.type = type\n }","function Dog() {\n this.name = \"Fluffers\";\n this.color = \"yellow\";\n this.numLegs = 4;\n}","function GObject(h, s, tileimg){\n\tthis.health = 100; \n\tthis.strength = 5;\t//can think of this as resistance for objects\n\tthis.timg = tileimg;\n}","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}","function Dragon(life, name, level, color, spell){\n //Keyword this references the newly created Dragon object\n //So we pass that to our previous constructor as a reference\n Enemy.call(this, life, name, level); //Remeber this is an object itself\n //And set the rest of the properties\n this.color = color;\n this.spell = spell;\n }","TakeWeapon() {\n this._on_cooldown = true\n this._PaintSpawn()\n this._last_use = Date.now()\n }","function Greeter(phase) {\n this.phase = phase;\n}","function Dog(){//Constructors are functions that create new objects.\n this.name = 'Charlie';//They define properties and behaviors that will belong to the new object.\n this.color = 'Red-brown';//'this.attribute' etc.\n this.numLegs = 4;\n}","constructor(name, legs) {\n this.name = name;\n this.legs = legs;\n }","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }","function WalkingCreature(oxygen, legs) {\n Walker.call(this, legs, oxygen);\n}","function Penguin(name, numLegs) {\n this.name = name;\n this.numLegs = 2;\n }","function Penguin(name, numLegs) {\n this.name = name;\n this.numLegs = 2;\n }","constructor(hull, firepower,accuracy){\n this.hull=hull;\n this.firepower=firepower;\n this.accuracy=accuracy;\n }","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.fireExtinguished = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","constructor(name, favoriteFood, hoursOfSleep) {\n // you can set any your custom properties\n this.legs = 2;\n this.hands = 2;\n this.head = 1;\n this.name = name;\n this.favoriteFood = favoriteFood;\n this.hoursOfSleep = hoursOfSleep;\n }","function Dog(){\n this.name = \"Bob\";\n this.color = \"red\";\n this.numLegs = 4;\n}","function Character() {\r\n // customization attributes\r\n isMale = false;\r\n\r\n // battle attributes\r\n money = -1;\r\n lifePoints = -1;\r\n weaponUpgrade = -1;\r\n shieldUpgrade = -1;\r\n clockNumber = -1;\r\n brainNumber = -1;\r\n \r\n // customization attributes\r\n this.setGender = function(gender) {\r\n if(gender===\"male\")\r\n isMale = true;\r\n else // is not male -> female\r\n isMale = false;\r\n };// end mutator\r\n this.getGender = function() {\r\n if(isMale)\r\n return \"male\";\r\n else // is not male -> female\r\n return \"female\";\r\n };// end accessor\r\n this.setImage = function() { \r\n if(isMale)\r\n $(\"#girlSprite\").css(\"visibility\", \"hidden\");// hide girl for boy, and vice versa\r\n else// is female\r\n $(\"#boySprite\").css(\"visibility\", \"hidden\");\r\n changeCharacterLives();\r\n };// end setImage \r\n \r\n // battle-related functions\r\n this.setMoney = function(m) {\r\n money = m;\r\n };// end mutator\r\n this.getMoney = function() {\r\n return money;\r\n };// end accessor\r\n this.setLifePoints = function(lp) {\r\n lifePoints = lp;\r\n changeCharacterLives();\r\n };// end mutator\r\n this.getLifePoints = function() {\r\n return lifePoints;\r\n };// end accessor \r\n this.setWeaponUpgrade = function(level) {\r\n weaponUpgrade = level;\r\n };// end mutator\r\n this.getWeaponUpgrade = function() {\r\n return weaponUpgrade;\r\n };// end accessor \r\n this.setShieldUpgrade = function(level) {\r\n shieldUpgrade = level;\r\n };// end mutator\r\n this.getShieldUpgrade = function() {\r\n return shieldUpgrade;\r\n };// end accessor \r\n this.setClockNumber = function(amount) {\r\n clockNumber = amount;\r\n };// end mutator\r\n this.getClockNumber = function() {\r\n return clockNumber;\r\n };// end accessor\r\n this.setBrainNumber = function(amount) {\r\n brainNumber = amount;\r\n };// end mutator\r\n this.getBrainNumber = function() {\r\n return brainNumber;\r\n };// end accessor \r\n \r\n this.loseLife = function() {\r\n lifePoints --;\r\n changeCharacterLives();\r\n };// end loseLife\r\n function changeCharacterLives() {\r\n var canvas = document.getElementById(\"characterLives\");\r\n var context = canvas.getContext('2d');\r\n var imageObj = new Image();\r\n context.clearRect(0,0,canvas.width,canvas.height);\r\n imageObj.src = \"images/heart.png\";\r\n imageObj.onload = function() {\r\n for(var i=0; i> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","constructor(){\n this.hull=20;\n this.firepower=5;\n this.accuracy=0.7;\n }","function Character(name, profession, gender, age, strength, hitPoints) {\n this.name = name;\n this.profession = profession;\n this.gender = gender;\n this.age = age;\n this.strength = strength;\n this.hitPoints = hitPoints;\n this.PrintStatus = function() {\n // console.log(this.name, this.profession, this.gender, this.age, this.strength, this.hitPoints);\n console.log(JSON.stringify(this));\n // console.log(this);\n }\n this.IsAlive = function() {\n if (hitPoints > 0) {\n console.log(this.name + ' is alive. For now...')\n } else {\n console.log(this.name + ' is dead. Such a shame. Welp...')\n }\n }\n this.Attack = function(target) {\n target.hitPoints -= this.strength;\n console.log(target.name + ' took some damage! They have ' + target.hitPoints + ' hit points left. In your face ' + target.name + '!')\n }\n this.levelUp = function() {\n this.age += 1;\n this.strength += 5;\n this.hitPoints += 25;\n console.log(`${this.name} leveled up yo! That's kinda rad. They are now ${this.age} years old, have ${this.strength} strength and have ${this.hitPoints} hit points.`)\n }\n}","function Ninja(name){\n\tthis.name = name;\n\tthis.health = 100;\n\t// speed and strength need to be private\n\tthis.speed = 3;\n\tthis.strength =3;\n}","function ShadowRunner() {\n Archer.apply(this, arguments);\n this.class = 'ShadowRunner';\n this.health = 21;\n this.armor = 17;\n this.dex = 13;\n this.str = 5;\n }","constructor() {\n super(\"MainScene\");\n // Monster variables\n this.monsterImage = null;\n this.hp = 5;\n this.hpText = null;\n this.soulsText = null;\n // Levels in upgrades\n this.levels = {\n bolt: 0\n }\n // Status of monster\n this.alive = false;\n }","function Animal() {\n // arguments\n this.spaces = \"Animal\";\n this.growup = function () {\n console.log(\"Stronger\");\n }\n}","function SuperHuman(name,age,power){\n this.power = power;\n Human.call(this,name,age);\n}","function fight() {\n // Update interface with fighters' name and hp's\n refreshDomElement($outputDiv, playersArray[0].name + ' and ' + playersArray[1].name + ' are going to fight !');\n\n // Choose first attacker and add new property on chosen player\n var first = randomIntFromInterval(1, 2);\n player1 = playersArray[0];\n player2 = playersArray[1];\n\n if (first === 1) {\n player1.start = 1;\n } else {\n player2.start = 1;\n }\n\n // Round function\n round();\n}","function Dog (color, status, hungry) {\n this.color = color\n this.status = status\n this.hungry = false\n this.owner = undefined\n}"],"string":"[\n \"function Gun(descr) {\\n\\n // Common inherited setup logic from Entity\\n this.setup(descr);\\n\\n this.rememberResets();\\n\\t\\n\\tthis.tower = g_sprites.tower;\\n this.diamond = g_sprites.diamond;\\n\\t\\n\\tthis.towerHeight = this.tower.height;\\n\\tthis.towerWidth = this.tower.width;\\n\\t\\n // Set normal drawing scale, and warp state off\\n this._scale = 0;\\n\\n this.cooldown = this.getCooldown();\\n}\",\n \"function Gun() {\\n ( function init( self )\\n {\\n self.bulletCountMax = 30;\\n self.timeBetweenBullet = 100;\\n self.timeReload = 2500;\\n\\n // State: 0: Can fire, 1: cooldown between bullets, 2: reloading\\n self.state = 0;\\n self.bulletCount = self.bulletCountMax;\\n self.timeSinceLastBullet = 0;\\n self.timeSinceReload = 0;\\n\\n self.animationTime = 0;\\n } ) ( this );\\n}\",\n \"function Gun(name, type, range, auto, db, magSize, maxMagSize, ammoType, bullet, melee) {\\r\\n // Properties\\r\\n // Basic properties\\r\\n this.name = name;\\r\\n this.type = type;\\r\\n this.range = range;\\r\\n this.isFullAuto = auto;\\r\\n this.noise = db;\\r\\n this.magSize = magSize;\\r\\n\\tthis.maxMagSize = maxMagSize;\\r\\n this.ammoType = ammoType;\\r\\n this.bulletDamage = bullet;\\r\\n this.meleeValue = melee;\\r\\n\\r\\n // Secondary fire mode properties\\r\\n this.secondaryFire = false;\\r\\n this.secondaryFireAmmo = null;\\r\\n\\tthis.secondaryFiremaxMag = null;\\r\\n\\tthis.secondaryDamage = null;\\r\\n\\tthis.ammoSecondaryType = null;\\r\\n\\r\\n // Modifiers\\r\\n this.rangeModifier = 0;\\r\\n this.scopeAttached = false;\\r\\n\\tthis.magAttached = false;\\r\\n\\tthis.silencerAttached = false;\\r\\n\\tthis.bayonetAttached = false;\\r\\n this.noiseModifier = 0;\\r\\n this.magModifier = null;\\r\\n this.damageModifier = 0;\\r\\n this.accuracyModifier = 0;\\r\\n this.meleeValueModifier = 0;\\r\\n\\r\\n // Methods\\r\\n /*\\r\\n\\tNOTES:\\r\\n\\tMoved the methods to here instead of gun.prototype because we do not want to modify the object that the gun extends... which is the Object object.\\r\\n\\tMeaning that, before, *all* objects had a SprayAndPray method.\\r\\n\\tHowever, if you make a new object that derives from gun, you can use myObject.prototype.myMethod to add myMethod to the gun object.\\r\\n */\\r\\n\\r\\n /*\\r\\n\\tAdds an attachment to the gun\\r\\n\\tattachment - string - name of attachment to apply\\r\\n */\\r\\n this.addAttachment = function(attachment) {\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\tswitch(attachment) {\\r\\n\\t case \\\"GP-30 grenade launcher\\\":\\r\\n\\t\\tif (this.type === \\\"russian assault rifle\\\") {\\r\\n\\t\\t this.secondaryFire = true;\\r\\n\\t\\t this.secondaryFireAmmo = 1;\\r\\n\\t\\t\\tthis.secondaryFiremaxMag = 1;\\r\\n\\t\\t\\tthis.secondaryDamage = 300;\\r\\n\\t\\t\\tthis.ammoSecondaryType = \\\"grenades\\\";\\r\\n\\t\\t\\tdocument.getElementById(\\\"grenadeLauncherAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\t output = \\\"

                    The GP-30 grenade launcher slides onto the rails under your \\\"+ this.name +\\\". The smell of gun grease and sweat wafts up from the heat that radiates off of the ground and into your nostrils as a sickly sweet aroma. You grin slightly, cocking the weapon to the side to admire your handiwork and slide a grenade into your newly attached piece of hardware. It is now ready to fire. Click the grenade icon in the secondary fire pane, and then on the target you wish to attack!

                    \\\";\\r\\n\\t\\t} else {\\r\\n\\t\\t output = \\\"

                    You can only use this attachment with a russian-made assault rifle.

                    \\\";\\r\\n\\t\\t}\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Red dot sight\\\":\\r\\n\\t\\tthis.rangeModifier = 20;\\r\\n\\t\\tthis.scopeAttached = true;\\r\\n\\t\\tdocument.getElementById(\\\"scopeAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    Your red dot sight slides into position with a slight *click*. You check your sights and make the necessary adjustments. Good to go. You now have a \\\" + this.rangeModifier + \\\" point accuracy bonus.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Reflex sight\\\":\\r\\n\\t\\tthis.rangeModifier = 10;\\r\\n\\t\\tthis.scopeAttached = true;\\r\\n\\t\\tdocument.getElementById(\\\"scopeAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    Your reflex sight attaches with no issue. You tweak the settings until you are happy with them and begin staring down the sights intently for the kill.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"6H5 type bayonet\\\":\\r\\n\\t\\tthis.bayonetAttached = true;\\r\\n\\t\\tthis.meleeValueModifier = 20;\\r\\n\\t\\tdocument.getElementById(\\\"bayonetAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You affix the 6H5 type bayonet to the end of your weapon and let loose a maniacal guffaw! You now have a [20] point damage bonus for melee attacks.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Silencer\\\":\\r\\n\\t\\tthis.silencerAttached = true;\\r\\n\\t\\tthis.noiseModifier = 40;\\r\\n\\t\\tdocument.getElementById(\\\"silencerAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You screw the silencer onto the end of your weapon with no problems.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Extended Magazine\\\":\\r\\n\\t this.magModifier = 54;\\r\\n\\t\\tthis.magAttached = true;\\r\\n\\t this.magSize = (this.magModifier + this.magSize);\\r\\n\\t\\tthis.maxMagSize = (this.magModifier + this.magSize);\\r\\n\\t\\tdocument.getElementById(\\\"magAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You slide in a fresh drum magazine for your \\\" + this.name + \\\". It pops into place with a satisfying clicking noise. A wicked grin pulls at the corners of your lips and you begin checking your sights. \\\" + \\\"Your total magazine capacity for this gun has been upgraded to \\\" + this.magSize + \\\" shots of \\\" + this.ammoType + \\\".

                    \\\";\\r\\n break;\\r\\n\\r\\n\\t case \\\"Standard magazine (AK)\\\":\\r\\n\\t\\tthis.magModifier = 0;\\r\\n\\t\\tthis.magSize = 15;\\r\\n\\t\\tthis.maxMagSize = 15;\\r\\n\\t\\tthis.magAttached = false;\\r\\n\\t\\tdocument.getElementById(\\\"magAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You slide in a standard 15 round magazine for your \\\" + this.type + \\\".

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"Standard iron sights\\\":\\r\\n\\t\\tthis.rangeModifier = 0;\\r\\n\\t\\tthis.scopeAttached = false;\\r\\n\\t\\tdocument.getElementById(\\\"scopeAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You remove the scope from your weapon and go back to using your standard iron sights.

                    \\\";\\r\\n\\t\\tbreak;\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"no bayonet\\\":\\r\\n\\t\\tthis.meleeValueModifier = 0;\\r\\n\\t\\tthis.bayonetAttached = false;\\r\\n\\t\\tdocument.getElementById(\\\"bayonetAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t output = \\\"

                    You remove the bayonet from your weapon.

                    \\\";\\r\\n\\t\\tbreak;\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"no grenades\\\":\\r\\n\\t\\tthis.secondaryFire = false;\\r\\n\\t\\tthis.secondaryFireAmmo = null;\\r\\n\\t\\tthis.secondaryFiremaxMag = null;\\r\\n\\t\\tthis.secondaryDamage = null;\\r\\n\\t\\tthis.ammoSecondaryType = null;\\r\\n\\t\\tdocument.getElementById(\\\"grenadeLauncherAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You detach the grenade launcher from your weapon.

                    \\\";\\r\\n\\t\\tbreak;\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"no silencer\\\":\\r\\n\\t\\tthis.silencerAttached = false;\\r\\n\\t\\tthis.noiseModifier = 0;\\r\\n\\t\\tdocument.getElementById(\\\"silencerAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You unscrew the silencer from the end of your weapon.

                    \\\";\\r\\n\\t break;\\r\\n\\t\\t\\r\\n\\t\\tdefault:\\r\\n\\t\\toutput = \\\"

                    This attachment is nowhere to be found in your pack! Most unfortunate.

                    \\\";\\r\\n\\t break;\\r\\n\\t}\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\tLogInfo(output);\\r\\n } // addAttachment\\r\\n\\r\\n /*\\r\\n\\tBust a cap. Or many of them, as the case may be.\\r\\n\\ttarget - object - the thing that you want to make dead\\r\\n */\\r\\n this.sprayAndPray = function(target){\\r\\n\\tvar output = \\\"\\\",\\r\\n\\t randomSeed = Math.floor(Math.random() * 10 + 3),\\r\\n\\t newMagSize = 0,\\r\\n\\t damageDealt = 0;\\r\\n\\r\\n\\tif (!target.dead && target.isAlive) {\\r\\n\\t if (this.isFullAuto) {\\r\\n\\t\\t\\r\\n\\t\\t// Checks to see if we have enough ammo and fires if we do!\\r\\n\\t\\tif (this.magSize >= 3) {\\r\\n\\t\\t newMagSize = this.magSize - randomSeed;\\r\\n\\t\\t damageDealt = this.bulletDamage * randomSeed;\\r\\n\\t\\t output = \\\"

                    You switch your \\\" + this.type +\\\" over to full-auto and throw some hot lead downrange with your \\\"+ this.name +\\\"! *BRRRRAPP!* You fired \\\" + randomSeed + \\\" shots for a combined total damage score of \\\"+ damageDealt + \\\" (\\\"+ this.bulletDamage + \\\" per round).

                    \\\";\\r\\n\\t\\t} else {\\r\\n\\t\\t output = \\\"

                    Please reload your weapon.

                    \\\";\\r\\n\\t\\t}\\r\\n\\t } else {\\r\\n\\t\\toutput = \\\"

                    You cannot spray and pray with a non-automatic weapon. Try taking an aimed shot instead.

                    \\\";\\r\\n\\t }\\r\\n\\r\\n\\t if (damageDealt > target.health && target.isAlive && target.isLiving) {\\r\\n\\t\\ttarget.dead = true;\\r\\n\\t\\toutput += \\\"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \\\" + target.name + \\\"'s head courtesy of your \\\" + this.type +\\\", Effectively killing the *shit* out of it! \\\" + target.deathKnell + \\\" You have \\\" + newMagSize + \\\" rounds of \\\" + this.ammoType + \\\" left!

                    \\\";\\r\\n\\t } else if (damageDealt === target.health && target.isAlive && target.isLiving) {\\r\\n\\t\\ttarget.dead = true;\\r\\n\\t\\toutput += \\\"

                    You scored a direct hit on \\\" + target.name + \\\"! \\\" + \\\" blood spurts from an artery, and they drop to the floor still twitching. \\\" + target.deathKnell + \\\" You have \\\" + newMagSize + \\\" rounds of \\\" + this.ammoType +\\\" left!

                    \\\";\\r\\n\\t } else if (damageDealt >= target.health && target.isAlive && !target.isLiving) {\\r\\n\\t\\ttarget.dead = true;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput += \\\"

                    You destroyed the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\" You have \\\" + newMagSize + \\\" shots of \\\" + this.ammoType + \\\" left!

                    \\\";\\r\\n\\t } else {\\r\\n\\t\\ttarget.health = target.health - damageDealt;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t output += \\\"

                    Your volley of shots strikes \\\"+ target.name + \\\". They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t }\\r\\n\\t} else {\\r\\n\\t output = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\r\\n\\tLogInfo(output);\\r\\n } // sprayAndPray\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\t// Bust *a* cap. in the singular case this time! Arriba!\\r\\n\\tthis.aimedShot = function(target){\\r\\n\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\t// is it dead?\\r\\n if (!target.dead) {\\t\\r\\n\\t\\r\\n\\t\\t newMagSize = 0;\\r\\n\\t damageDealt = 0;\\r\\n\\t\\t\\r\\n\\t// do we have enough ammo? if so let's rock!\\r\\n\\tif (this.magSize >= 1) {\\t\\r\\n\\t\\tnewMagSize = this.magSize - 1;\\r\\n\\t damageDealt = this.bulletDamage;\\t\\t\\r\\n\\tif (damageDealt > target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t output += \\\"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \\\" + target.name + \\\"'s head courtesy of your \\\" + this.type +\\\", Effectively killing the *shit* out of it! \\\" + target.deathKnell + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t} else if (damageDealt === target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You scored a fatal hit on \\\" + target.name + \\\"! \\\" + \\\" blood spurts from an artery in a glorious crimson fountain in front of them, and they drop to the floor still twitching. \\\" + target.deathKnell + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t} else if (damageDealt >= target.health && !target.isLiving) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You destroyed the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else {\\r\\n\\t target.health = target.health - damageDealt;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t output += \\\"

                    Steadying your weapon, you level a well-placed shot into \\\"+ target.name + \\\" For [\\\" + this.bulletDamage + \\\"] points of damage. They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t}\\t\\r\\n\\t}else{\\r\\n\\toutput += \\\"

                    Please reload your weapon

                    \\\";\\r\\n\\t}\\t\\t\\r\\n\\t}else{\\r\\n\\toutput = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\tLogInfo(output);\\r\\n\\t} // Aimed shot\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\t// Gettin' stabby with it (melee)!\\r\\n\\r\\n\\tthis.attackMelee = function(target){\\r\\n\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\t// is it dead?\\r\\n if (!target.dead) {\\t\\r\\n\\t\\r\\n\\t damageDealt = this.meleeValueModifier + this.meleeValue;\\r\\n\\t\\t\\t\\t\\r\\n\\tif (damageDealt > target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t output += \\\"

                    [CRITICAL HIT] You completely decapitated \\\" + target.name + \\\" with your insane melee skills, Effectively killing the *shit* out of it! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else if (damageDealt === target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You land a devastating blow on \\\" + target.name + \\\"! \\\" + \\\" blood pours from a wound you have left in their throat, and they drop to the floor still twitching. \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else if (damageDealt >= target.health && !target.isLiving) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You destroyed the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else {\\r\\n\\t target.health = target.health - damageDealt;\\r\\n\\t output += \\\"

                    You swing frantically at \\\"+ target.name + \\\" For [\\\" + damageDealt + \\\"] points of damage. They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\"

                    \\\";\\r\\n\\t}\\t\\r\\n\\t}else{\\r\\n\\toutput = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\tLogInfo(output);\\r\\n\\t} // attackMelee\\r\\n\\t\\r\\n\\t\\r\\n\\t// Lob a grenade!\\r\\n\\tthis.grenade = function(target){\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\t// is it dead?\\r\\n if (!target.dead) {\\t\\r\\n\\t\\r\\n\\t\\t newSecondaryMagSize = 0;\\r\\n\\t damageDealt = 0;\\r\\n\\t\\t\\r\\n\\t// do we have enough ammo? if so let's rock!\\r\\n\\tif (this.secondaryFireAmmo >= 1) {\\t\\r\\n\\t\\tnewSecondaryMagSize = this.secondaryFireAmmo - 1;\\r\\n\\t damageDealt = this.secondaryDamage;\\t\\t\\r\\n\\tif (damageDealt > target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    [CRITICAL HIT] Your attack obliterated \\\" + target.name + \\\". \\\" + target.deathKnell + \\\" You now have \\\" + newSecondaryMagSize +\\\" Rounds of \\\"+ this.ammoSecondaryType +\\\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \\\";\\r\\n\\t} else if (damageDealt === target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    The explosion splatters \\\" + target.name + \\\" all over the room! \\\" + target.deathKnell + \\\" You now have \\\" + newSecondaryMagSize +\\\" Rounds of \\\"+ this.ammoSecondaryType +\\\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \\\";\\r\\n\\t} else if (damageDealt >= target.health && !target.isLiving) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You exploded the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else {\\r\\n\\t target.health = target.health - damageDealt;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\t\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t output += \\\"

                    You launch a well-placed shot with one of your \\\" + this.ammoSecondaryType + \\\". \\\"+ target.name + \\\" was hit For a whopping [\\\" + this.secondaryDamage + \\\"] points of damage. They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\" You now have \\\" + newSecondaryMagSize +\\\" Rounds of \\\"+ this.ammoSecondaryType +\\\" left in your launcher. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \\\";\\r\\n\\t}\\t\\r\\n\\t}else{\\r\\n\\toutput += \\\"

                    Please reload your grenade launcher

                    \\\";\\r\\n\\t}\\t\\t\\r\\n\\t}else{\\r\\n\\toutput = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\tLogInfo(output);\\r\\n\\t} // Grenade\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t//reload function\\r\\n\\tthis.reload = function(){\\r\\n\\t\\r\\n\\t\\tcurrentRounds = this.magSize + this.magModifier;\\r\\n\\t\\r\\n\\t\\tif( currentRounds === this.maxMagSize){\\r\\n\\t\\t\\r\\n\\t\\toutput = \\\"You do not need to reload this weapon.\\\";\\r\\n\\t\\t\\r\\n\\t\\t}else{\\r\\n\\t\\t\\r\\n\\t\\tamountToReload = this.maxMagSize - currentRounds;\\r\\n\\t\\tthis.magSize = this.magSize + amountToReload;\\r\\n\\t\\toutput = \\\"You reload your weapon. You now have \\\" + this.magSize + \\\" rounds of \\\" + this.ammoType + \\\".\\\";\\r\\n\\t\\tLogInfo(output);\\r\\n\\t\\t\\r\\n\\t\\t}\\r\\n\\t}// reload\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t//secondary reload function (used for alt. fire weapons)\\r\\n\\tthis.secondaryReload = function(){\\r\\n\\t\\r\\n\\t\\tAKS74u.secondaryFireAmmo = 1;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + AKS74u.secondaryFireAmmo;\\r\\n\\t\\toutput = \\\"You reload another grenade\\\";\\r\\n\\t\\tLogInfo(output);\\r\\n\\t}// secondary reload\\r\\n\\t\\r\\n\\t\\r\\n\\t}\",\n \"function Person(name, stance, perception, taunt){\\r\\n this.name = name;\\r\\n this.stance = stance;\\r\\n this.perception = perception;\\r\\n this.taunt = taunt;\\r\\n this.weapon = null;\\r\\n\\t\\r\\n\\t/* \\r\\n\\tcurrent attack mode property for players (starts as single shot)\\r\\n\\t*/\\r\\n\\tthis.currentAttackMode = \\\"single\\\";\\r\\n\\r\\n /*\\r\\n\\tGo ahead, give them a gun, see if I care.\\r\\n\\tgun - object - the gun to equip them with\\r\\n */\\r\\n this.arm = function(gun) {\\r\\n\\tthis.weapon = gun;\\r\\n }\\r\\n\\r\\n /*\\r\\n\\tAttacks with the current weapon\\r\\n\\ttarget - object - the thing you want to attack\\r\\n */\\r\\n this.attack = function(target) {\\r\\n\\tthis.weapon.sprayAndPray(target);\\r\\n }\\r\\n\\t\\r\\n\\t/*\\r\\n\\tAttacks with single shot\\r\\n\\t*/\\r\\n\\tthis.attackSingle = function(target) {\\r\\n\\tthis.weapon.aimedShot(target);\\r\\n }\\r\\n\\t\\r\\n\\t/*\\r\\n\\tAttacks with melee\\r\\n\\t*/\\r\\n\\tthis.attackMelee = function(target) {\\r\\n\\tthis.weapon.attackMelee(target);\\r\\n }\\r\\n\\t\\r\\n\\t/*\\r\\n\\tAttacks with grenade\\r\\n\\t*/\\r\\n\\tthis.attackGrenade = function(target) {\\r\\n\\tthis.weapon.grenade(target);\\r\\n }\\r\\n\\t\\r\\n}\",\n \"function DoggoFighter(name,specialAbility){\\n this.name = name;\\n this.specialAbility = specialAbility;\\n}\",\n \"constructor(name, legs, isDanger){\\n super(name, legs)//properties inherited from the parent class\\n this.isDanger = isDanger\\n }\",\n \"function Gun( ownerImage, projectileImage, shoot ) {\\n this.ownerImage = ownerImage;\\n this.image = projectileImage;\\n this.shoot = shoot;\\n if (this.shoot === undefined) {\\n // Do nothing\\n this.shoot = function() {\\n \\n }\\n }\\n}\",\n \"youngGun(args) {\\n return this.createGameObject(\\\"YoungGun\\\", young_gun_1.YoungGun, args);\\n }\",\n \"function Dog(hungry) {\\n\\n this.status = \\\"normal\\\";\\n this.color = \\\"black\\\";\\n this.hungry = \\\"hungry\\\";\\n}\",\n \"function Penguin(name){\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Penguin(name){\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Penguin(name){\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Warrior(heroName=\\\"Cloud\\\", heroLevel=99, heroWeapon=\\\"the Brotherhood\\\") {\\n // In order to effectively call 'super' in JS, we use \\n Hero.call(this, heroName, heroLevel);\\n this.heroWeapon = heroWeapon;\\n}\",\n \"constructor(name, health, speed, strength, wisdom){\\n super(name);\\n this.health = 200;\\n this.speed = 10;\\n this.strength = 10;\\n this.wisdom = 10;\\n }\",\n \"function Fighter(name, health, damagePerAttack) {\\n this.name = name\\n this.health = health;\\n this.damagePerAttack = damagePerAttack;\\n this.toString = function() { return this.name; }\\n}\",\n \"function Penguin(name) {\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Penguin(name) {\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"constructor(...args) {\\n super(...args);\\n\\n this.addClasses('character');\\n this.directionX = 0;\\n this.directionY = 0;\\n }\",\n \"function Ninja(name, health=100) {\\n // create a private variable that stores a reference to the new object we create\\n var self = this;\\n var strength =3;\\n var speed =3;\\n this.nameT = name;\\n this.healthT =health;\\n\\n this.sayName = function(){\\n console.log(`My ninja name is ${this.nameT}`)\\n } \\n this.showStats = function() {\\n console.log(`Name: ${this.nameT} , Health is ${this.healthT} , Speed: ${speed} , Strength${strength}` )\\n }\\n \\n this.drinkSake = function() {\\n this.healthT +=10;\\n }\\n\\n\\n // this.method = function() {\\n // console.log( \\\"I am a method\\\");\\n\\n // var privateMethod = function() {\\n // console.log(\\\"this is a private method for \\\" + self.name);\\n // console.log(self);\\n // }\\n // this.age = age;\\n // this.greet = function() {\\n // console.log(\\\"Hello my name is \\\" + this.name + \\\" and I am \\\" + this.age + \\\" years old!\\\");\\n // // we can access our attributes within the constructor!\\n // console.log(\\\"Also my privateVariable says: \\\" + privateVariable)\\n // // we can access our methods within the constructor!\\n // privateMethod();\\n // }\\n}\",\n \"function Fighter(name, health, damagePerAttack, special, avatar) {\\n this.name = name;\\n this.health = health;\\n this.maxHealth = health;\\n this.damagePerAttack = damagePerAttack;\\n this.special = special;\\n this.avatar = avatar;\\n this.toString = function() {\\n return this.name;\\n };\\n}\",\n \"function Penguin(name) { // All penguins have 2 legs, so we only need the function parameter name\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n // default values for private member values\\n this.corpses = 0;\\n this.isCastle = false;\\n this.isGoldMine = false;\\n this.isGrass = false;\\n this.isIslandGoldMine = false;\\n this.isPath = false;\\n this.isRiver = false;\\n this.isTower = false;\\n this.isUnitSpawn = false;\\n this.isWall = false;\\n this.isWorkerSpawn = false;\\n this.numGhouls = 0;\\n this.numHounds = 0;\\n this.numZombies = 0;\\n this.owner = null;\\n this.tileEast = null;\\n this.tileNorth = null;\\n this.tileSouth = null;\\n this.tileWest = null;\\n this.tower = null;\\n this.unit = null;\\n this.x = 0;\\n this.y = 0;\\n\\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"function AllianceFaction(Character, Class, Gender, Profession){\\n this.Character = Character;\\n this.Class = Class;\\n this.Gender = Gender;\\n this.Profession = Profession;\\n this.profile = function(){\\n return `My race is ${this.Character}, I am a ${this.Gender} ${this.Class}, I specialize in ${this.Profession}`;\\n // console.log(this);\\n }\\n}\",\n \"function Weapon(name, target) {\\n this.name = name;\\n this.target = target;\\n}\",\n \"function Gun(x, y, size)\\n{\\n\\tthis.x = x;\\n\\tthis.y = y;\\n\\tthis.size = size;\\n}\",\n \"constructor()\\n\\t{\\n\\t\\tthis.HP = 100;\\n\\t\\tthis.dmg = 30;\\n\\t\\tthis.evasion = 15;\\n\\n\\t\\t//boolean for special move\\n\\t\\tthis.fly = 0;\\n\\t\\tthis.invi = 0;\\n\\t\\tthis.slammed = 0;\\n\\n\\t\\tthis.alive = true;\\n\\t}\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n // default values for private member values\\n this.canMove = false;\\n this.drunkDirection = '';\\n this.focus = 0;\\n this.health = 0;\\n this.isDead = false;\\n this.isDrunk = false;\\n this.job = '';\\n this.owner = null;\\n this.tile = null;\\n this.tolerance = 0;\\n this.turnsBusy = 0;\\n\\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"function Warrior(name, health, anger) {\\n Hero.call(this, name, health);\\n this.anger = anger;\\n}\",\n \"function Ninja() {\\r\\n this.swung = true;\\r\\n}\",\n \"function Penguin(name, numLegs){\\n this.name = name;\\n this.numLegs = numLegs;\\n}\",\n \"initialize() {\\n // prepare characters for fighting\\n this.c1.prepareForFight();\\n this.c2.prepareForFight();\\n\\n // show characters stats\\n console.log('Players are ready to fight!');\\n this.c1.printStats();\\n this.c2.printStats();\\n\\n // who starts the fight?\\n if (\\n // character 1 is faster?\\n this.c1.speed > this.c2.speed ||\\n (\\n // same speed...\\n this.c1.speed === this.c2.speed &&\\n // ...but character 1 is luckier\\n this.c1.luck > this.c2.luck\\n )\\n ) {\\n // character 1 starts the fight\\n this.attacker = this.c1;\\n this.defender = this.c2;\\n } else {\\n // character 2 starts the fight\\n this.attacker = this.c2;\\n this.defender = this.c1;\\n }\\n }\",\n \"function Greetr()\\r\\n{\\r\\n this.greeting = 'Hola mundo!';\\r\\n}\",\n \"function dragonConstructor(name, age){\\n\\tthis.species = \\\"Dragon\\\";\\n\\tthis.size = \\\"Enormous\\\";\\n\\tthis.isDead = false;\\n\\tthis.name = name;\\n\\tthis.age = age;\\n\\n\\tthis.getDefeated = () => this.isDead = true;\\n}\",\n \"function Dog() {\\nthis.name = \\\"Rupert\\\";\\nthis.color = \\\"brown\\\";\\nthis.numLegs = 4;\\n}\",\n \"function fighterStats(name, hp, atk, def) {\\n this.name = name;\\n this.hp = hp;\\n this.hp2 = hp;\\n this.atk = atk;\\n this.def = def;\\n\\n /** Takes damage from an enemy@param{int} damage The damage taken*/\\n this.takeDamage = function(damage) {\\n var damageTaken = Math.abs(damage - this.def);\\n if(damage <= this.def) {\\n damageTaken = 1;\\n }\\n this.hp2 = this.hp2 - damageTaken;\\n this.hp2 = this.hp2 < 0 ? 0 : this.hp2;\\n console.log(damageTaken);\\n // console.log('You have taken ' + damage + 'damage!');\\n }\\n}\",\n \"function Ninja(name, health=100, speed=3, strength=3){\\n this.name=name;\\n this.health=health;\\n this.speed=speed;\\n this.strength = strength;\\n this.sayName = function(){\\n console.log(\\\"My ninja name is \\\"+name);\\n };\\n}\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n /**\\n * The name of the game.\\n */\\n this.name = 'Chess';\\n\\n // default values for private member values\\n this.currentPlayer = null;\\n this.currentTurn = 0;\\n this.fen = '';\\n this.gameObjects = {};\\n this.maxTurns = 0;\\n this.moves = [];\\n this.pieces = [];\\n this.players = [];\\n this.session = '';\\n this.turnsToDraw = 0;\\n }\",\n \"constructor(){\\n console.log(\\\"Creating a new alien\\\")\\n this.health = 100;\\n this.damage = 50;\\n\\n }\",\n \"function Dog() {\\n this.name = \\\"Rex\\\";\\n this.color = \\\"Black\\\";\\n this.numLegs = 4;\\n}\",\n \"function Dog() {\\n this.name = \\\"Rusty\\\";\\n this.color = \\\"Golden\\\";\\n this.numLegs = 4;\\n}\",\n \"function turtle(name,color,weapon,favoritePizzaType){\\n this.name=name;\\n this.color=color;\\n this.weapon=weapon;\\n this.favoritePizzaType=favoritePizzaType;\\n}\",\n \"constructor(name, age, breed, color) {\\n // Set those equal to the instance\\n this.name = name;\\n this.age = age;\\n this.breed = breed;\\n this.color = color;\\n this.energyLevel = 0;\\n this.barkLevel = 10;\\n }\",\n \"function Ninja(name) {\\n this.name = name;\\n this.health = 100;\\n const speed = 3;\\n const strength = 3;\\n \\n // Add methods to the Ninja prototype\\n // Log the Ninja's name to the console\\n Ninja.prototype.sayName = function() {\\n console.log(\\\"My ninja name is \\\" + this.name + \\\"!\\\");\\n return this;\\n };\\n\\n // Shows the Ninja's Strength and Speed, and their Health\\n Ninja.prototype.showStats = function() {\\n console.log(\\\"Name: \\\" + this.name + \\\", \\\" + \\\"Health: \\\" + this.health + \\\", \\\" + \\\"Speed: \\\" + speed + \\\", \\\" + \\\"Strength: \\\" + strength);\\n return this;\\n };\\n\\n // Adds +10 Health to the Ninja\\n Ninja.prototype.drinkSake = function() {\\n this.health += 10;\\n return this;\\n };\\n\\n // Takes another Ninja instance and subtracts 5 Health from the Ninja passed in\\n Ninja.prototype.punch = function(punchReceiver) {\\n // Validation to only accept instances of the Ninja class\\n if (punchReceiver instanceof Ninja) {\\n punchReceiver.health -= 5;\\n console.log(punchReceiver.name + \\\" was punched by \\\" + this.name + \\\" and lost 5 Health!\\\");\\n } else {\\n console.log(\\\"Not a Ninja\\\")\\n };\\n return this;\\n };\\n\\n // Subtracts 15 Health for each point of Strength the calling Ninja has, and like .punch() will take another Ninja instance\\n Ninja.prototype.kick = function(kickReceiver) {\\n // Validation to only accept instances of the Ninja class\\n if (kickReceiver instanceof Ninja) {\\n const kickDamage = 15 * strength;\\n kickReceiver.health -= kickDamage;\\n console.log(kickReceiver.name + \\\" was kicked by \\\" + this.name + \\\" and lost \\\" + kickDamage + \\\" Health!\\\");\\n } else {\\n console.log(\\\"Not a Ninja\\\")\\n };\\n return this;\\n };\\n}\",\n \"constructor(name, hull, firePower, accuracy) { // constructors are info about class (this. belongs to constructor)\\n this.name = name;\\n this.hull = hull;\\n this.firePower = firePower;\\n this.accuracy = accuracy;\\n }\",\n \"function Person(name, weapon) {\\n this.name = name;\\n this.weapon = weapon;\\n}\",\n \"function Game_Troop() {\\n this.initialize.apply(this, arguments);\\n}\",\n \"constructor(name){\\n console.log(\\\"Creating a new alien\\\")\\n this.health = 100;\\n this.damage = 50;\\n //assigned to the object being created\\n this.name = name; \\n\\n }\",\n \"function Penguin(name, numLegs) {\\n this.name = name;\\n this.numLegs = numLegs;\\n}\",\n \"function Game_Unit() {\\n this.initialize.apply(this, arguments);\\n}\",\n \"function Ninja(name){\\n\\n\\tlet speed = 3;\\n\\tlet strength = 3;\\n\\tthis.name = name;\\n\\tthis.health = 100;\\n\\n\\tthis.sayName = function(){\\n\\t\\tconsole.log(this.name);\\n\\t}\\n\\n\\tthis.showStats = function(){\\n\\t\\tconsole.log(`Name: ${this.name}, Health: ${this.health}, Strength: ${strength}, Speed: ${speed}`);\\n\\t}\\n\\n\\tthis.drinkSake = function(){\\n\\t\\tthis.health += 10;\\n\\t\\treturn this;\\n\\t}\\n\\n\\tthis.punch = function(target){\\n\\t\\tif(target instanceof Ninja){\\n\\t\\t\\ttarget.health -= 5;\\n\\t\\t\\tconsole.log(`${target.name} was punched by ${this.name} and health is down to ${target.health}`);\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(`You can't punch a ${target.constructor.name}`);\\n\\t\\t}\\n\\t}\\n\\n\\tthis.kick = function(target){\\n\\t\\tif(target instanceof Ninja){\\n\\t\\t\\ttarget.health -= 15;\\n\\t\\t\\tconsole.log(`${target.name} was kicked by ${this.name} and health is down to ${target.health}`);\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(`You can't kick a ${target.constructor.name}`);\\n\\t\\t}\\n\\t}\\n\\n}\",\n \"function Player () {\\n\\t this.x = 450; \\n\\t this.y = 850;\\n\\t this.w = 20;\\n\\t this.h = 20;\\n\\t this.deltaX = 0;\\n\\t this.deltaY = 0;\\n\\t this.xTarget = 0;\\n\\t this.yTarget = 0;\\n\\t this.tired = false;\\n\\t this.speed = 0;\\n\\t this.topSpeed = 5;\\n\\t this.energy = 150;\\n\\t this.maxEnergy = 150;\\n\\t this.maxHealth = 150;\\n\\t this.health = 150;\\n\\t this.recovery = 0\\n\\t this.xcenter = 400;\\n\\t this.ycenter = 300;\\n\\t this.fill = '#000000';\\n\\t this.xdirection = 1;\\n\\t this.ydirection = 0;\\n\\t this.acceleration = 0.4;\\n\\t this.radius = 0;\\n\\t this.angle = 1.7;\\n\\t this.mot = 0;\\n\\t this.closestVehicle = 0;\\n\\t this.distanceFromVehicle = 0;\\n\\t this.gettingInVehicle = 0;\\n\\t this.inBuilding = 0;\\n\\t this.walkTimer = 0;\\n\\t this.xVector = 0;\\n\\t this.yVector = 0;\\n\\t this.standImage = playerStand;\\n\\t this.walkAnimations = [\\\"\\\", playerWalk1, playerWalk2, playerWalk3, playerWalk4];\\n\\t this.activeWeapon = -1;\\n\\t this.weaponsPossessed = [\\n\\t\\t{name: \\\"Pistol\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#783a3a', haveColor: 'red'},\\n\\t\\t{name: \\\"Machine Gun\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#595c38', haveColor: '#fffb00'},\\n\\t\\t{name: \\\"Plasma Gun\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#388994', haveColor: '#05e2ff'},\\n\\t\\t{name: \\\"Rocket Launcher\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#661b61', haveColor: '#ff00ee'}\\n\\t ];\\n\\t this.weaponCount = 0;\\n\\t this.nearDoor = false;\\n\\t this.nearBuilding = false;\\n\\t this.ammo = [1000, 1500, 2000, 50, 30]\\n\\t this.kills = 0;\\n\\t this.points = 100;\\n\\t this.maxPoints = 10000;\\n\\t this.onTile = {x: 0, y: 0};\\n\\t this.inBounds = {\\n\\n\\t }\\n\\t this.fBuffer = 0\\n\\t this.onWeaponIcon = -1;\\n\\t this.onPerkIcon = -1;\\n\\t this.interactTimer = 0;\\n\\t this.interactDebounceTime = 50;\\n\\t this.walkedOn = {\\n\\t\\tsand: false,\\n\\t\\twater: false,\\n\\t\\tgrass: false, \\n\\t }\\n}\",\n \"function OogaahBattlefield() {\\n\\tOogaahPile.apply(this, null); // construct the base class\\n}\",\n \"function Weapon() {\\r\\n this.name;\\r\\n this.type;\\r\\n}\",\n \"function User() {\\r\\n //\\\"this\\\" refers back to the object that calls it and is assigned the users name later on in the code\\r\\n this.name = \\\"\\\";\\r\\n //this starts each user with 100 health\\r\\n this.life = 100;\\r\\n /*this is a function that takes the parameter \\\"targetPlayer\\\" (which is the player that would lose health) and\\r\\n adds 1 to the target players health while at the same time decreasing the user who is giving health by 1\\r\\n */\\r\\n this.givelife = function givelife(targetPlayer) {\\r\\n targetPlayer.life += 1;\\r\\n this.life -= 1;\\r\\n console.log(this.name, 'gave one life to', targetPlayer.name)\\r\\n };\\r\\n}\",\n \"constructor(name, weapon, type){ // Constructor is something only for subclass\\n // console.log(this) - js wont allow us to run this in subclass untill we use the super() keyword\\n super(name, weapon); // Super calls the super class of elf (Character). It goes up and calls the constructor\\n console.log('this from subclass', this)\\n this.type = type\\n }\",\n \"function Dog() {\\n this.name = \\\"Fluffers\\\";\\n this.color = \\\"yellow\\\";\\n this.numLegs = 4;\\n}\",\n \"function GObject(h, s, tileimg){\\n\\tthis.health = 100; \\n\\tthis.strength = 5;\\t//can think of this as resistance for objects\\n\\tthis.timg = tileimg;\\n}\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n}\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n}\",\n \"function Dragon(life, name, level, color, spell){\\n //Keyword this references the newly created Dragon object\\n //So we pass that to our previous constructor as a reference\\n Enemy.call(this, life, name, level); //Remeber this is an object itself\\n //And set the rest of the properties\\n this.color = color;\\n this.spell = spell;\\n }\",\n \"TakeWeapon() {\\n this._on_cooldown = true\\n this._PaintSpawn()\\n this._last_use = Date.now()\\n }\",\n \"function Greeter(phase) {\\n this.phase = phase;\\n}\",\n \"function Dog(){//Constructors are functions that create new objects.\\n this.name = 'Charlie';//They define properties and behaviors that will belong to the new object.\\n this.color = 'Red-brown';//'this.attribute' etc.\\n this.numLegs = 4;\\n}\",\n \"constructor(name, legs) {\\n this.name = name;\\n this.legs = legs;\\n }\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n }\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n }\",\n \"function WalkingCreature(oxygen, legs) {\\n Walker.call(this, legs, oxygen);\\n}\",\n \"function Penguin(name, numLegs) {\\n this.name = name;\\n this.numLegs = 2;\\n }\",\n \"function Penguin(name, numLegs) {\\n this.name = name;\\n this.numLegs = 2;\\n }\",\n \"constructor(hull, firepower,accuracy){\\n this.hull=hull;\\n this.firepower=firepower;\\n this.accuracy=accuracy;\\n }\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n // default values for private member values\\n this.fireExtinguished = 0;\\n\\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"constructor(name, favoriteFood, hoursOfSleep) {\\n // you can set any your custom properties\\n this.legs = 2;\\n this.hands = 2;\\n this.head = 1;\\n this.name = name;\\n this.favoriteFood = favoriteFood;\\n this.hoursOfSleep = hoursOfSleep;\\n }\",\n \"function Dog(){\\n this.name = \\\"Bob\\\";\\n this.color = \\\"red\\\";\\n this.numLegs = 4;\\n}\",\n \"function Character() {\\r\\n // customization attributes\\r\\n isMale = false;\\r\\n\\r\\n // battle attributes\\r\\n money = -1;\\r\\n lifePoints = -1;\\r\\n weaponUpgrade = -1;\\r\\n shieldUpgrade = -1;\\r\\n clockNumber = -1;\\r\\n brainNumber = -1;\\r\\n \\r\\n // customization attributes\\r\\n this.setGender = function(gender) {\\r\\n if(gender===\\\"male\\\")\\r\\n isMale = true;\\r\\n else // is not male -> female\\r\\n isMale = false;\\r\\n };// end mutator\\r\\n this.getGender = function() {\\r\\n if(isMale)\\r\\n return \\\"male\\\";\\r\\n else // is not male -> female\\r\\n return \\\"female\\\";\\r\\n };// end accessor\\r\\n this.setImage = function() { \\r\\n if(isMale)\\r\\n $(\\\"#girlSprite\\\").css(\\\"visibility\\\", \\\"hidden\\\");// hide girl for boy, and vice versa\\r\\n else// is female\\r\\n $(\\\"#boySprite\\\").css(\\\"visibility\\\", \\\"hidden\\\");\\r\\n changeCharacterLives();\\r\\n };// end setImage \\r\\n \\r\\n // battle-related functions\\r\\n this.setMoney = function(m) {\\r\\n money = m;\\r\\n };// end mutator\\r\\n this.getMoney = function() {\\r\\n return money;\\r\\n };// end accessor\\r\\n this.setLifePoints = function(lp) {\\r\\n lifePoints = lp;\\r\\n changeCharacterLives();\\r\\n };// end mutator\\r\\n this.getLifePoints = function() {\\r\\n return lifePoints;\\r\\n };// end accessor \\r\\n this.setWeaponUpgrade = function(level) {\\r\\n weaponUpgrade = level;\\r\\n };// end mutator\\r\\n this.getWeaponUpgrade = function() {\\r\\n return weaponUpgrade;\\r\\n };// end accessor \\r\\n this.setShieldUpgrade = function(level) {\\r\\n shieldUpgrade = level;\\r\\n };// end mutator\\r\\n this.getShieldUpgrade = function() {\\r\\n return shieldUpgrade;\\r\\n };// end accessor \\r\\n this.setClockNumber = function(amount) {\\r\\n clockNumber = amount;\\r\\n };// end mutator\\r\\n this.getClockNumber = function() {\\r\\n return clockNumber;\\r\\n };// end accessor\\r\\n this.setBrainNumber = function(amount) {\\r\\n brainNumber = amount;\\r\\n };// end mutator\\r\\n this.getBrainNumber = function() {\\r\\n return brainNumber;\\r\\n };// end accessor \\r\\n \\r\\n this.loseLife = function() {\\r\\n lifePoints --;\\r\\n changeCharacterLives();\\r\\n };// end loseLife\\r\\n function changeCharacterLives() {\\r\\n var canvas = document.getElementById(\\\"characterLives\\\");\\r\\n var context = canvas.getContext('2d');\\r\\n var imageObj = new Image();\\r\\n context.clearRect(0,0,canvas.width,canvas.height);\\r\\n imageObj.src = \\\"images/heart.png\\\";\\r\\n imageObj.onload = function() {\\r\\n for(var i=0; i> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"constructor(){\\n this.hull=20;\\n this.firepower=5;\\n this.accuracy=0.7;\\n }\",\n \"function Character(name, profession, gender, age, strength, hitPoints) {\\n this.name = name;\\n this.profession = profession;\\n this.gender = gender;\\n this.age = age;\\n this.strength = strength;\\n this.hitPoints = hitPoints;\\n this.PrintStatus = function() {\\n // console.log(this.name, this.profession, this.gender, this.age, this.strength, this.hitPoints);\\n console.log(JSON.stringify(this));\\n // console.log(this);\\n }\\n this.IsAlive = function() {\\n if (hitPoints > 0) {\\n console.log(this.name + ' is alive. For now...')\\n } else {\\n console.log(this.name + ' is dead. Such a shame. Welp...')\\n }\\n }\\n this.Attack = function(target) {\\n target.hitPoints -= this.strength;\\n console.log(target.name + ' took some damage! They have ' + target.hitPoints + ' hit points left. In your face ' + target.name + '!')\\n }\\n this.levelUp = function() {\\n this.age += 1;\\n this.strength += 5;\\n this.hitPoints += 25;\\n console.log(`${this.name} leveled up yo! That's kinda rad. They are now ${this.age} years old, have ${this.strength} strength and have ${this.hitPoints} hit points.`)\\n }\\n}\",\n \"function Ninja(name){\\n\\tthis.name = name;\\n\\tthis.health = 100;\\n\\t// speed and strength need to be private\\n\\tthis.speed = 3;\\n\\tthis.strength =3;\\n}\",\n \"function ShadowRunner() {\\n Archer.apply(this, arguments);\\n this.class = 'ShadowRunner';\\n this.health = 21;\\n this.armor = 17;\\n this.dex = 13;\\n this.str = 5;\\n }\",\n \"constructor() {\\n super(\\\"MainScene\\\");\\n // Monster variables\\n this.monsterImage = null;\\n this.hp = 5;\\n this.hpText = null;\\n this.soulsText = null;\\n // Levels in upgrades\\n this.levels = {\\n bolt: 0\\n }\\n // Status of monster\\n this.alive = false;\\n }\",\n \"function Animal() {\\n // arguments\\n this.spaces = \\\"Animal\\\";\\n this.growup = function () {\\n console.log(\\\"Stronger\\\");\\n }\\n}\",\n \"function SuperHuman(name,age,power){\\n this.power = power;\\n Human.call(this,name,age);\\n}\",\n \"function fight() {\\n // Update interface with fighters' name and hp's\\n refreshDomElement($outputDiv, playersArray[0].name + ' and ' + playersArray[1].name + ' are going to fight !');\\n\\n // Choose first attacker and add new property on chosen player\\n var first = randomIntFromInterval(1, 2);\\n player1 = playersArray[0];\\n player2 = playersArray[1];\\n\\n if (first === 1) {\\n player1.start = 1;\\n } else {\\n player2.start = 1;\\n }\\n\\n // Round function\\n round();\\n}\",\n \"function Dog (color, status, hungry) {\\n this.color = color\\n this.status = status\\n this.hungry = false\\n this.owner = undefined\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.67743284","0.6739134","0.66912013","0.66515183","0.6590362","0.6360284","0.6355191","0.6214117","0.61946684","0.6174791","0.6174791","0.6172805","0.6158926","0.6143233","0.6126082","0.6047762","0.6047762","0.6028191","0.6028043","0.6022599","0.6015924","0.6014758","0.6014676","0.5976162","0.5973028","0.59453994","0.5943851","0.5929283","0.5922839","0.5907319","0.58972603","0.5889763","0.586973","0.58695763","0.58653176","0.58640385","0.5860563","0.58498573","0.5838948","0.58373356","0.58350635","0.5830752","0.5830646","0.5822728","0.58213615","0.5821193","0.5819181","0.5817385","0.5811216","0.5810946","0.58070016","0.5803088","0.58004165","0.57872415","0.57857674","0.5781385","0.5780304","0.57791364","0.57791364","0.5769981","0.57605475","0.5760482","0.57447815","0.5741004","0.57384795","0.57384795","0.57340246","0.57323605","0.57323605","0.5724932","0.57210404","0.571987","0.57102376","0.5708682","0.5706589","0.5700068","0.5687746","0.5680388","0.5674733","0.5648329","0.564763","0.56468","0.5629625","0.5629416","0.5629279","0.56286854","0.5620858","0.56198674","0.5612431","0.56081796","0.56077737","0.56049144","0.5597199","0.559528","0.55828327","0.5576765","0.5573424","0.55732703","0.557199","0.5567445"],"string":"[\n \"0.67743284\",\n \"0.6739134\",\n \"0.66912013\",\n \"0.66515183\",\n \"0.6590362\",\n \"0.6360284\",\n \"0.6355191\",\n \"0.6214117\",\n \"0.61946684\",\n \"0.6174791\",\n \"0.6174791\",\n \"0.6172805\",\n \"0.6158926\",\n \"0.6143233\",\n \"0.6126082\",\n \"0.6047762\",\n \"0.6047762\",\n \"0.6028191\",\n \"0.6028043\",\n \"0.6022599\",\n \"0.6015924\",\n \"0.6014758\",\n \"0.6014676\",\n \"0.5976162\",\n \"0.5973028\",\n \"0.59453994\",\n \"0.5943851\",\n \"0.5929283\",\n \"0.5922839\",\n \"0.5907319\",\n \"0.58972603\",\n \"0.5889763\",\n \"0.586973\",\n \"0.58695763\",\n \"0.58653176\",\n \"0.58640385\",\n \"0.5860563\",\n \"0.58498573\",\n \"0.5838948\",\n \"0.58373356\",\n \"0.58350635\",\n \"0.5830752\",\n \"0.5830646\",\n \"0.5822728\",\n \"0.58213615\",\n \"0.5821193\",\n \"0.5819181\",\n \"0.5817385\",\n \"0.5811216\",\n \"0.5810946\",\n \"0.58070016\",\n \"0.5803088\",\n \"0.58004165\",\n \"0.57872415\",\n \"0.57857674\",\n \"0.5781385\",\n \"0.5780304\",\n \"0.57791364\",\n \"0.57791364\",\n \"0.5769981\",\n \"0.57605475\",\n \"0.5760482\",\n \"0.57447815\",\n \"0.5741004\",\n \"0.57384795\",\n \"0.57384795\",\n \"0.57340246\",\n \"0.57323605\",\n \"0.57323605\",\n \"0.5724932\",\n \"0.57210404\",\n \"0.571987\",\n \"0.57102376\",\n \"0.5708682\",\n \"0.5706589\",\n \"0.5700068\",\n \"0.5687746\",\n \"0.5680388\",\n \"0.5674733\",\n \"0.5648329\",\n \"0.564763\",\n \"0.56468\",\n \"0.5629625\",\n \"0.5629416\",\n \"0.5629279\",\n \"0.56286854\",\n \"0.5620858\",\n \"0.56198674\",\n \"0.5612431\",\n \"0.56081796\",\n \"0.56077737\",\n \"0.56049144\",\n \"0.5597199\",\n \"0.559528\",\n \"0.55828327\",\n \"0.5576765\",\n \"0.5573424\",\n \"0.55732703\",\n \"0.557199\",\n \"0.5567445\"\n]"},"document_score":{"kind":"string","value":"0.5953281"},"document_rank":{"kind":"string","value":"25"}}},{"rowIdx":76,"cells":{"query":{"kind":"string","value":"return the two oldest/oldest ages within the array of ages passed in."},"document":{"kind":"string","value":"function twoOldestAges(ages){\n ages.sort((a,b) => b-a)\n ages = ages.slice(0,2)\n ages.sort((a,b) => a-b);\n return ages;\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 twoOldestAges(ages){\n let sorted = ages.sort((a, b) => { return b - a; });\n return [sorted[1], sorted[0]];\n }","function twoOldestAges(ages){\nlet oldestAges = ages.sort((a, b) => b-a).splice(0,2).reverse();\n return oldestAges;\n}","function twoOldestAges(ages){\n var sortArr = ages.map(Number).sort(function (a, b) { return a - b; });\n var scoreTab = [sortArr[sortArr.length - 2], sortArr[sortArr.length - 1]];\n return scoreTab;\n}","function older(array){\n\tvar max = 0;\n\tvar olderst = {};\n\tfor (var i=0; i max){\n\t\t\tmax= array[i][\"age\"];\n\t\t\toldest = array[i];\n\t\t}\n\t}\n\treturn oldest;\t\t\n}","function byAge(arr){\n const youngToOld = arr.sort((a, b) => {\n return a.age - b.age\n })\n return youngToOld\n}","function older(a, b) {\n\treturn max(a, b, ageCompare);\n }","function findOlder(arr)\n{\n\tvar oldest = arr[0].age;\n\tvar oldClassmate = {};\n\n\tfor(var i=1; i oldest)\n\t\t{\n\t\t\toldest = arr[i].age;\n\t\t\toldClassmate = arr[i];\n\t\t}\n\t}\n\n\treturn oldClassmate;\n}","function older(people,age){\n\tnew newArray =[];\n\tfor ( var i =0; i < array.length-1;i++){\n\t\tif(Arr[i].age > age){\n\t\t\tnewArray.push(Arr[i].age);\n\t\t}\t\n\t}\n\treturn newArray;\n}","function younger(a, b) {\n\treturn min(a, b, ageCompare);\n }","function checkYoungest(array) {\n var arrIndex = 0;\n var minAge = array[0].age;\n for (var i = 1; i < array.length; i++) {\n if (array[i].age < minAge) {\n minAge = array[i];\n arrIndex = i;\n }\n }\n return array[arrIndex].firstname + ' ' + array[arrIndex].lastname;\n}","function differenceInAges (ages) {\n\n let max = Math.max(...ages),\n min = Math.min(...ages)\n diff = max - min\n \n return [min, max, diff]\n}","function older3ars(array){\n\t\tvar older=array[0].age\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tif(array[i].age>older){\n\t\t\t\tolder=array[i].age\n\t\t\t}\n\n\t\t}\n\t\treturn older;\n\t}","function findOldestPerson(people) {\n var oldest = people[0];\n for (var i = 1; i < people.length; i++) {\n if (people[i].age > oldest.age) {\n oldest = people[i];\n }\n }\n return oldest;\n}","function getMinAge(data) {\n\tconst ages = data.map(passenger => {\n\t\treturn passenger.fields.age;\n\t}).filter( p => p !== undefined)\n\treturn Math.min(...ages)\n}","function olderPeople(peopleArr, age) {\n return peopleArr.filter(function (person) {\n return person.age > age;\n });\n}","function olderPeople(peopleArr, age) {\n // initialize a new empty array\n let newArray = [];\n // loop through each persons\n peopleArr.forEach(element => {\n // check if person is older\n if (element.age > age) {\n // add to array\n newArray.push(element);\n }\n })\n return newArray\n}","function sortedByAge(arr) {\n return arr.sort((a, b) => (a - b) ? -1 : 1 )\n}","function above(person, age){\n let aboveAge = [];\n person.forEach(element => {\n if(element.age > age)\n {aboveAge.push(element)}\n });\n return aboveAge;\n }","function byAge(arr){\n return arr.sort(function(a, b){\n return a.age - b.age;\n });\n}","static older(person1, person2){\n return (person1.age >= person2.age)?person1:person2;\n }","function findYoungest(arr) {\n arr.sort(function(a, b) {\n return a.age - b.age;\n });\n\n return arr[0].firstname + ' ' + arr[0].lastname;\n}","function findOldestMale(people) {\n var oldest = people[0];\n for (var i = 1; i < people.length; i++) {\n if (people[i].gender == \"Male\") {\n if (people[i].age > oldest.age) {\n oldest = people[i];\n }\n }\n }\n return oldest;\n}","function getMinAge(data) {\n\tconst ages = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\n\tconst minAge = Math.min(...ages)\n\tconsole.log('MINIMUM AGE:', minAge)\n\treturn minAge\n}","function sortByAge(arr) {\n return arr.sort((a,b) => a.age - b.age); // increment\n}","function familyReport(ages) {\n // sort the ages into ascending order\n ages.sort(compareNumeric)\n // get the smallest age (first index)\n const smallest = ages[0];\n // get the largest age (last index)\n const largest = ages[ages.length - 1];\n // difference between largest and smallest age\n const difference = largest - smallest;\n\n return [smallest, largest, difference]\n}","function SortByNamexOlderThan(age) {\n var pl = [];\n let k = 0;\n for (let i of players) {\n if (i.age >= age) {\n i.awards.name.sort().reverse();\n pl[c++] = i;\n }\n }\n\n return pl.age.sort();\n}","function findOldestByGender(people, gender) {\n var oldest = people[0];\n for (var i = 1; i < people.length; i++) {\n if (people[i].gender == gender && people[i].age > oldest.age) {\n oldest = people[i];\n }\n }\n return oldest;\n}","function findOlder() {\n //let arr = [];\n //console.log(val);\n for (i = 0; i < devs.length; i++) {\n //let val = devs[i].age;\n //arr.push(val);\n if (devs[i].age > 24) {\n console.log(devs[i]);\n }\n }\n //console.log(arr);\n }","function secondOldest() {\n var firstMaxSoFar = ages[0]; \n var secondMax = undefined; \n \n document.getElementById(\"secondoldest\").innerHTML = outPutText; \n}","function getMinandMaxAge() {\n let ages = [];\n let leagueSelected = $(\"#division\").val();\n\n if (leagueSelected == \"Tee Ball\") {\n ages = [4, 6];\n }\n else if (leagueSelected == \"Minors\") {\n ages = [7, 9];\n }\n else if (leagueSelected == \"Majors\") {\n ages = [10, 12];\n }\n else {\n ages = [12, 14];\n }\n return ages;\n}","function AgeCroissant(a, b) {\n if (a.age < b.age) return -1;\n if (a.age > b.age) return 1;\n return 0;\n }","function compareAge(b1,b2){\n return b1<=b2\n }","function getMaxAge(data) {\n\tconst ages = data.map(passenger => {\n\t\treturn passenger.fields.age;}).filter( p => p !== undefined)\n\t\treturn Math.max(...ages)\n}","function returnMinors(arr)\r\n {\r\n \tminors=[]\r\n \tfor(var i of arr)\r\n \t{\r\n \t\tif(i['age']>=20)\r\n \t\t{\r\n \t\t\tminors.push(i)\r\n \t\t}\r\n \t}\r\n \treturn minors\r\n }","function sortAge(data){\n\n \n\n data.sort(function(a,b){\n if(a.dob.age < b.dob.age){\n return -1;\n }else{\n return 1;\n }\n });\n console.log(data)\n return [...data]\n \n }","function getAverageAge (arr) {\n return arr.reduce((acc, cur) => acc+cur.age, 0);\n}","function getAge(people) {\n let dayToday = new Date().getDate();\n let monthToday = new Date().getMonth();\n let yearToday = new Date().getFullYear();\n for (let i = 0; i < people.length; i++) {\n let birthDate = people[i].dob;\n let birthDateSplit = people[i].dob.split(\"/\");\n birthDateSplit[0] -= 1;\n let splitDiff = [];\n splitDiff[0] = monthToday - birthDateSplit[0];\n splitDiff[1] = dayToday - birthDateSplit[1];\n splitDiff[2] = yearToday - birthDateSplit[2];\n if (splitDiff[0] < 0 || (splitDiff[0] == 0 && splitDiff[1] < 0)) {\n splitDiff[2]--;\n }\n people[i].age = splitDiff[2];\n }\n}","function compareByAge(personA, personB) {\n if (personA.age < personB.age) {\n return -1;\n } else if (personA.age > personB.age) {\n return 1;\n } else {\n return 0;\n }\n }","function addAges(born) {\n //find all the films, this in includes things like producer and writer\n var links = document.evaluate(\n \"//div[contains(@class,'filmo')]/ol/li\",\n document,\n null,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null);\n\n //loop round each film\n for (var i = 0; i < links.snapshotLength; i++) {\n\t\t\tvar link = links.snapshotItem(i);\n\t\t\t//extract the year of the film\n\t\t\tyearindex = link.innerHTML.search(\"\\\\([0-9]{4}\\\\)\")\n\t\t\tif(yearindex>0) {\n\t\t\t\tvar filmborn = link.innerHTML.substring(yearindex + 1,\n\t\t\t\t\tyearindex + 5);\n\t\t\t\t//calculate ages\n\t\t\t\tvar filmage = new Date().getFullYear() - filmborn;\n\t\t\t\tvar age = filmborn - born;\n\t\t\t\tage = new String(age +\n\t\t\t\t\t\" year\" + (age == 1 ? '' : 's') + \" old\");\n\n\t\t\t\t//get them in a nice format\n\t\t\t\tif (filmage < 0) {\n\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\t\"in \" +\n\t\t\t\t\t\tMath.abs(filmage) + \" year\" +\n\t\t\t\t\t\t(Math.abs(filmage) == 1 ? '' : 's') +\n\t\t\t\t\t\t\" will be \" + age);\n\t\t\t\t}\n\t\t\t\tif (filmage == 0) {\n\t\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\t\t\t\"this year while \" + age);\n\t\t\t\t}\n\t\t\t\tif (filmage > 0) {\n\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\tMath.abs(filmage) + \" year\" +\n\t\t\t\t\t\t(Math.abs(filmage) == 1 ? '' : 's') +\n\t\t\t\t\t\t\" ago while \" + age);\n\t\t\t\t}\n\n\t\t\t\tlink.innerHTML =\n\t\t\t\t\tlink.innerHTML.substring(0, yearindex + 5)\n\t\t\t\t\t+ \", \" + agetxt\n\t\t\t\t\t+ link.innerHTML.substring(yearindex + 5);\n\t\t\t}\n }\n}","function sortedOfAge(arr){\n var over18 = []\n arr.filter((person) => {\n if (person.age > 18){\n over18.push(person)\n }\n })\n var inOrder = over18.sort((a, b) => {\n var nameA = a.lastName\n var nameB = b.lastName\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0\n })\n var finalArr = []\n inOrder.map((person) => {\n finalArr.push(\"
                  • \" + person.firstName + \" \" + person.lastName + \" is \" + person.age + \"
                  • \")\n })\n return finalArr\n }","function SecondGreatLow(arr) { \n\tif (arr.length === 2){\n\t\tif(arr[0] > arr[1]) {\n\t\t\treturn arr[0] + \" \" + arr[1];\n\t\t} else {\n\t\t\treturn arr[1] + \" \" + arr[0];\n\t\t}\n\t} else {\n\t\tvar greatest = Math.max.apply(Math, arr);\n\t\tvar lowest = Math.min.apply(Math, arr);\n\t\tvar newArr = [];\n\t\tfor (var i = 0; i \n item.gender === 'm' || item.gender === 'M')\n .sort((a, b) => a.age - b.age )\n }","function ageSort(){\n return function(people){\n people.sort(function(a,b){\n return a.age - b.age;\n });\n console.log(people);\n };\n }","function getAges(array, value) {\n let output = [];\n for (let i = 0; i < array.length; ++i) {\n output.push(array[i][value]);\n }\n return output;\n}","function SortByAge() {\n var pl = [];\n pl = Object.age(players).sort()\n return pl.reverse();\n}","static ageCompareHigh(user1, user2) {\n // TODO: check that age exists\n return user2.age - user1.age;\n }","function AgeSort() {\n employees.sort(function (a, b) {\n return (a.dob.age - b.dob.age)\n })\n visibleEmployees([...employees])\n }","function SecondGreatLow(arr) {\n //if length is 2 edge case\n if (arr.length === 2){\n sortedArr = arr.sort();\n return sortedArr[1]+\" \"+sortedArr[0];\n }\n\n var min, max, min2, max2;\n sortedArr = arr.sort();\n min = sortedArr[0];\n max = sortedArr[sortedArr.length];\n min2 = max;\n max2 = min;\n for (var i = 0; i < sortedArr.length; i++) {\n //set min2\n if (sortedArr[i] !== min){\n if(sortedArr[i] < min2){\n min2 = sortedArr[i];\n }\n }\n //set max2\n if (sortedArr[i] !== max){\n if(sortedArr[i] > max2){\n max2 = sortedArr[i];\n }\n }\n }//end loop\n return min2+\" \"+max2;\n}//end function","function getLeaveDatesInAscendinOrder(leaveDatesArray){\t\r\n\t\t var datesArray;\r\n\t\t var sortedArray=[];\r\n\t\t var stringDate;\r\n\t\t datesArray=new Array(leaveDatesArray.length);\r\n\t for(var j=0;j< leaveDatesArray.length;j++){\r\n\t \t //console.log(\"type of leave date : \"+ typeof leaveDatesArray[j].leaveDate)\r\n\t \t datesArray.push(new Date(leaveDatesArray[j].leaveDate));\r\n\t\t }\r\n\t datesArray.sort(function (a,b){ return (a > b) ? 1 : -1;});\r\n\t \r\n\t for(var j=0;j< leaveDatesArray.length;j++){\r\n\t \t stringDate=datesArray[j].getDate()+\"/\"+(datesArray[j].getMonth()+1)+\"/\"+datesArray[j].getFullYear(); new Date().g\r\n\t \t //leaveDetails [i][4][j]=(datesArray[j]+\"\").substring(0,15);\r\n\t \t sortedArray.push(stringDate);\r\n\t }\r\n\t \r\n\t return sortedArray;\r\n\t \r\n\t }","function findAverage(array) {\n const sumElementsAgesArray = (accumulator, currentValue) => accumulator + currentValue;\n const averageAge = array.reduce(sumElementsAgesArray, 0) / array.length;\n return averageAge;\n}","function sortByAge(){\n employees.sort(function(a,b){\n return (a.dob.age - b.dob.age)\n })\n setDisplayedEmployees([...employees])\n }","function lowhigh(arr) {\n max = arr[0];\n min = arr[0];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n if (arr[i] < min) {\n min = arr[i];\n }\n }\n return min, max;\n}","function olderThanTwentyFour(arr) {\n return arr.filter(n => n.age >= 24)\n}","function getAverageAge(arr) {\n return arr.reduce((acc, item) => acc + item.age, 0) / arr.length;\n}","howOld(birthday){\n \n //calculate the month difference from the current month\n //calculate the day difference from the current date\n //calculate year difference from the current year\n //put calculation in date format\n //calculate the age person\n //return the age of the person\n\n return -1;\n }","handleAllAges(ages) {\n const allAges = ages.filter( age => { return age.name == 'All Ages' } )\n if ( allAges.length < 1 ) {\n ages.push({\n id: \"58e4b35fdb252928067b4379\",\n name: \"All Ages\",\n displayOrder: 0\n })\n }\n return ages.sort(this.handleDisplayOrder)\n }","function bornBeforeYear(dataArr, year) {\n const result = [];\n dataArr.forEach(person => {\n const birthYear = new Date(person.birthday).getFullYear();\n (birthYear < year) && result.push(person);\n \n });\n return result; \n}","function averageAge(arr) {\n\n const currentAge = arr.map(cur => new Date().getFullYear() - cur.buildYear);\n\n function add(a, b) {\n return a + b;\n }\n\n const totalAge = currentAge.reduce(add, 0);\n const average = totalAge / arr.length;\n\n console.log(`Our ${arr.length} parks have an average age of ${average} years.`);\n}","function getMaxAge(data) {\n\tconst ageList = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\n\tconst maxAge = Math.max(...ageList)\n\tconsole.log('MAXIMUM AGE:', maxAge)\n\treturn maxAge\n}","function twoTeams(sailors) {\n const team1 = []; // holds sailors younger than 20 and older than 40\n const team2 = []; // holds sailors between the ages 20 and 40\n const sailorNames = Object.keys(sailors);\n\n sailorNames.forEach(sailor => {\n sailors[sailor] < 20 || sailors[sailor] > 40\n ? team1.push(sailor)\n : team2.push(sailor);\n });\n\n const sorted = [team1.sort(), team2.sort()];\n return sorted;\n}","function bestYearAvg (array){\n //puedo calcular el avg con el método de arriba, para ello, tengo que conseguir tener un array con todas las \n //peliculas de un año \n var ordenado = array.sort(function(a,b) {\n return a.parseInt(year) - b.parseInt(year);\n } );\n}","get oldestObject() {\n\t\n\t\tif(this.#_augmentaScene.objectCount == 0) {\n\t\t\tconsole.log('No object in scene')\n\t\t} else {\n\n\t\t\tlet maxAge = -1;\n\t\t\tlet maxId;\n\n\t\t\tfor(var id in this.#_augmentaObjects) {\n\t\t\t\tif(this.#_augmentaObjects[id].age > maxAge) {\n\t\t\t\t\tmaxAge = this.#_augmentaObjects[id].age;\n\t\t\t\t\tmaxId = id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.#_augmentaObjects[maxId]\n\t\t}\n\n\t}","function byAge(person1, person2) {\n var age1 = person1.age;\n var age2 = person2.age;\n return age2 - age1;\n}","function computeAge(i) \n {\n var todaysDate = new Date();\n var birthD = $(\"#booking_tickets_\"+ i +\"_birthdate_day\").val();\n var birthM = $(\"#booking_tickets_\"+ i +\"_birthdate_month\").val();\n var birthY = $(\"#booking_tickets_\"+ i +\"_birthdate_year\").val();\n\n if((birthM < todaysDate.getMonth()) || ((birthM == todaysDate.getMonth()) && (birthD <= todaysDate.getDate())))\n {\n var age = todaysDate.getFullYear() - birthY;\n }\n else\n {\n var age = todaysDate.getFullYear() - birthY - 1;\n } \n\n return age;\n }","getYearRange(date) {\n let year = [], first, last;\n date.forEach(e => {\n year.push(parseInt(e))\n })\n first = year[0];\n last = year[year.length-1]\n year.forEach(e => {\n first = e < first ? e : first;\n last = e > last ? e : last;\n })\n return({first,last});\n }","function CompareBirthdays(a, b)\r\n {\r\n return a[\"nextBirthday\"] - b[\"nextBirthday\"];\r\n }","function howOld(age, year) {\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n\n if (year > currentYear) {\n var NewAge = year - currentYear + age;\n return `You will be ${NewAge} in the year ${year}`;\n } else if (year < currentYear - age) {\n var diference = currentYear - age - year;\n return `The year ${year} was ${diference} years before you were born`;\n } else if (year < currentYear && year > currentYear - age) {\n var NewAge = age - (currentYear - year);\n return `You were ${NewAge} in the year ${year}`;\n }\n}","calculateAge() {\n let date_1 = new Date(age);\n let diff = Date.now() - date_1.getTime();\n var age_date = new Date(diff);\n return Math.abs(age_date.getUTCFullYear() - 1970); \n }","function olderPerson(obj) {\n var ins = obj[0];\n var str = \"\";\n for (let i = 0; i < obj.length; i++) {\n if (obj[i].age > ins.age) {\n ins = obj[i];\n str = ins.name.first + \" \" + ins.name.last;\n }\n }\n return str;\n}","function retire(year){\n\tconst age=new Date().getFullYear()-year;\n\treturn [age,65-age];\n}","function getAge() {\n year = born.slice(0, born.indexOf(\"-\"));\n month = born.slice(5, 7);\n day = born.slice(8);\n var today = new Date();\n var age = today.getFullYear() - year;\n var m = today.getMonth() - month;\n if (m < 0 || (m === 0 && today.getDate() < day)) {\n age--;\n }\n return age;\n }","function findOldestIndex(history){\n var index = null;// index of oldest element\n var sAge = null; // smallest age\n\n // Abort if there is no elements in history\n if(history.length<1){\n return -1;\n }\n\n index = 0;\n sAge = history[0].age;\n for (var i = 1; i < history.length; i++){\n if(history[i].age= minAge) console.log(personA);\n if (personB.age >= minAge) console.log(personB);\n}","howOld(birthday){\n \n // convert birthday into a numeric value\n\n // convert current date into a numeric value\n\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\n\n // convert the time elapsed value into years\n\n // round down the converted years value\n\n // return the rounded years value\n\n let date = new Date().getFullYear();\n let age = date-birthyear\n \n return age;\n return -1;\n }","function maleAge(){\n for (i=0; i a.age - b.age);\n }\n }\n console.log(devs);\n }","function calculateAge(birthyear, currentyear) {\n\tvar lowage = currentyear - birthyear - 1;\n\tvar highage = currentyear - birthyear;\n\talert(\"You are either \" + lowage + \" or \" + highage)\n}","function cmp(a, b) {\n let yearA = a[0].years[0]\n let yearB = b[0].years[0]\n return (yearB > yearA) ? 1 : ((yearB < yearA) ? -1 : 0)\n }","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}"],"string":"[\n \"function twoOldestAges(ages){\\n let sorted = ages.sort((a, b) => { return b - a; });\\n return [sorted[1], sorted[0]];\\n }\",\n \"function twoOldestAges(ages){\\nlet oldestAges = ages.sort((a, b) => b-a).splice(0,2).reverse();\\n return oldestAges;\\n}\",\n \"function twoOldestAges(ages){\\n var sortArr = ages.map(Number).sort(function (a, b) { return a - b; });\\n var scoreTab = [sortArr[sortArr.length - 2], sortArr[sortArr.length - 1]];\\n return scoreTab;\\n}\",\n \"function older(array){\\n\\tvar max = 0;\\n\\tvar olderst = {};\\n\\tfor (var i=0; i max){\\n\\t\\t\\tmax= array[i][\\\"age\\\"];\\n\\t\\t\\toldest = array[i];\\n\\t\\t}\\n\\t}\\n\\treturn oldest;\\t\\t\\n}\",\n \"function byAge(arr){\\n const youngToOld = arr.sort((a, b) => {\\n return a.age - b.age\\n })\\n return youngToOld\\n}\",\n \"function older(a, b) {\\n\\treturn max(a, b, ageCompare);\\n }\",\n \"function findOlder(arr)\\n{\\n\\tvar oldest = arr[0].age;\\n\\tvar oldClassmate = {};\\n\\n\\tfor(var i=1; i oldest)\\n\\t\\t{\\n\\t\\t\\toldest = arr[i].age;\\n\\t\\t\\toldClassmate = arr[i];\\n\\t\\t}\\n\\t}\\n\\n\\treturn oldClassmate;\\n}\",\n \"function older(people,age){\\n\\tnew newArray =[];\\n\\tfor ( var i =0; i < array.length-1;i++){\\n\\t\\tif(Arr[i].age > age){\\n\\t\\t\\tnewArray.push(Arr[i].age);\\n\\t\\t}\\t\\n\\t}\\n\\treturn newArray;\\n}\",\n \"function younger(a, b) {\\n\\treturn min(a, b, ageCompare);\\n }\",\n \"function checkYoungest(array) {\\n var arrIndex = 0;\\n var minAge = array[0].age;\\n for (var i = 1; i < array.length; i++) {\\n if (array[i].age < minAge) {\\n minAge = array[i];\\n arrIndex = i;\\n }\\n }\\n return array[arrIndex].firstname + ' ' + array[arrIndex].lastname;\\n}\",\n \"function differenceInAges (ages) {\\n\\n let max = Math.max(...ages),\\n min = Math.min(...ages)\\n diff = max - min\\n \\n return [min, max, diff]\\n}\",\n \"function older3ars(array){\\n\\t\\tvar older=array[0].age\\n\\t\\tfor (var i = 0; i < array.length; i++) {\\n\\t\\t\\tif(array[i].age>older){\\n\\t\\t\\t\\tolder=array[i].age\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\t\\treturn older;\\n\\t}\",\n \"function findOldestPerson(people) {\\n var oldest = people[0];\\n for (var i = 1; i < people.length; i++) {\\n if (people[i].age > oldest.age) {\\n oldest = people[i];\\n }\\n }\\n return oldest;\\n}\",\n \"function getMinAge(data) {\\n\\tconst ages = data.map(passenger => {\\n\\t\\treturn passenger.fields.age;\\n\\t}).filter( p => p !== undefined)\\n\\treturn Math.min(...ages)\\n}\",\n \"function olderPeople(peopleArr, age) {\\n return peopleArr.filter(function (person) {\\n return person.age > age;\\n });\\n}\",\n \"function olderPeople(peopleArr, age) {\\n // initialize a new empty array\\n let newArray = [];\\n // loop through each persons\\n peopleArr.forEach(element => {\\n // check if person is older\\n if (element.age > age) {\\n // add to array\\n newArray.push(element);\\n }\\n })\\n return newArray\\n}\",\n \"function sortedByAge(arr) {\\n return arr.sort((a, b) => (a - b) ? -1 : 1 )\\n}\",\n \"function above(person, age){\\n let aboveAge = [];\\n person.forEach(element => {\\n if(element.age > age)\\n {aboveAge.push(element)}\\n });\\n return aboveAge;\\n }\",\n \"function byAge(arr){\\n return arr.sort(function(a, b){\\n return a.age - b.age;\\n });\\n}\",\n \"static older(person1, person2){\\n return (person1.age >= person2.age)?person1:person2;\\n }\",\n \"function findYoungest(arr) {\\n arr.sort(function(a, b) {\\n return a.age - b.age;\\n });\\n\\n return arr[0].firstname + ' ' + arr[0].lastname;\\n}\",\n \"function findOldestMale(people) {\\n var oldest = people[0];\\n for (var i = 1; i < people.length; i++) {\\n if (people[i].gender == \\\"Male\\\") {\\n if (people[i].age > oldest.age) {\\n oldest = people[i];\\n }\\n }\\n }\\n return oldest;\\n}\",\n \"function getMinAge(data) {\\n\\tconst ages = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\\n\\tconst minAge = Math.min(...ages)\\n\\tconsole.log('MINIMUM AGE:', minAge)\\n\\treturn minAge\\n}\",\n \"function sortByAge(arr) {\\n return arr.sort((a,b) => a.age - b.age); // increment\\n}\",\n \"function familyReport(ages) {\\n // sort the ages into ascending order\\n ages.sort(compareNumeric)\\n // get the smallest age (first index)\\n const smallest = ages[0];\\n // get the largest age (last index)\\n const largest = ages[ages.length - 1];\\n // difference between largest and smallest age\\n const difference = largest - smallest;\\n\\n return [smallest, largest, difference]\\n}\",\n \"function SortByNamexOlderThan(age) {\\n var pl = [];\\n let k = 0;\\n for (let i of players) {\\n if (i.age >= age) {\\n i.awards.name.sort().reverse();\\n pl[c++] = i;\\n }\\n }\\n\\n return pl.age.sort();\\n}\",\n \"function findOldestByGender(people, gender) {\\n var oldest = people[0];\\n for (var i = 1; i < people.length; i++) {\\n if (people[i].gender == gender && people[i].age > oldest.age) {\\n oldest = people[i];\\n }\\n }\\n return oldest;\\n}\",\n \"function findOlder() {\\n //let arr = [];\\n //console.log(val);\\n for (i = 0; i < devs.length; i++) {\\n //let val = devs[i].age;\\n //arr.push(val);\\n if (devs[i].age > 24) {\\n console.log(devs[i]);\\n }\\n }\\n //console.log(arr);\\n }\",\n \"function secondOldest() {\\n var firstMaxSoFar = ages[0]; \\n var secondMax = undefined; \\n \\n document.getElementById(\\\"secondoldest\\\").innerHTML = outPutText; \\n}\",\n \"function getMinandMaxAge() {\\n let ages = [];\\n let leagueSelected = $(\\\"#division\\\").val();\\n\\n if (leagueSelected == \\\"Tee Ball\\\") {\\n ages = [4, 6];\\n }\\n else if (leagueSelected == \\\"Minors\\\") {\\n ages = [7, 9];\\n }\\n else if (leagueSelected == \\\"Majors\\\") {\\n ages = [10, 12];\\n }\\n else {\\n ages = [12, 14];\\n }\\n return ages;\\n}\",\n \"function AgeCroissant(a, b) {\\n if (a.age < b.age) return -1;\\n if (a.age > b.age) return 1;\\n return 0;\\n }\",\n \"function compareAge(b1,b2){\\n return b1<=b2\\n }\",\n \"function getMaxAge(data) {\\n\\tconst ages = data.map(passenger => {\\n\\t\\treturn passenger.fields.age;}).filter( p => p !== undefined)\\n\\t\\treturn Math.max(...ages)\\n}\",\n \"function returnMinors(arr)\\r\\n {\\r\\n \\tminors=[]\\r\\n \\tfor(var i of arr)\\r\\n \\t{\\r\\n \\t\\tif(i['age']>=20)\\r\\n \\t\\t{\\r\\n \\t\\t\\tminors.push(i)\\r\\n \\t\\t}\\r\\n \\t}\\r\\n \\treturn minors\\r\\n }\",\n \"function sortAge(data){\\n\\n \\n\\n data.sort(function(a,b){\\n if(a.dob.age < b.dob.age){\\n return -1;\\n }else{\\n return 1;\\n }\\n });\\n console.log(data)\\n return [...data]\\n \\n }\",\n \"function getAverageAge (arr) {\\n return arr.reduce((acc, cur) => acc+cur.age, 0);\\n}\",\n \"function getAge(people) {\\n let dayToday = new Date().getDate();\\n let monthToday = new Date().getMonth();\\n let yearToday = new Date().getFullYear();\\n for (let i = 0; i < people.length; i++) {\\n let birthDate = people[i].dob;\\n let birthDateSplit = people[i].dob.split(\\\"/\\\");\\n birthDateSplit[0] -= 1;\\n let splitDiff = [];\\n splitDiff[0] = monthToday - birthDateSplit[0];\\n splitDiff[1] = dayToday - birthDateSplit[1];\\n splitDiff[2] = yearToday - birthDateSplit[2];\\n if (splitDiff[0] < 0 || (splitDiff[0] == 0 && splitDiff[1] < 0)) {\\n splitDiff[2]--;\\n }\\n people[i].age = splitDiff[2];\\n }\\n}\",\n \"function compareByAge(personA, personB) {\\n if (personA.age < personB.age) {\\n return -1;\\n } else if (personA.age > personB.age) {\\n return 1;\\n } else {\\n return 0;\\n }\\n }\",\n \"function addAges(born) {\\n //find all the films, this in includes things like producer and writer\\n var links = document.evaluate(\\n \\\"//div[contains(@class,'filmo')]/ol/li\\\",\\n document,\\n null,\\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\\n null);\\n\\n //loop round each film\\n for (var i = 0; i < links.snapshotLength; i++) {\\n\\t\\t\\tvar link = links.snapshotItem(i);\\n\\t\\t\\t//extract the year of the film\\n\\t\\t\\tyearindex = link.innerHTML.search(\\\"\\\\\\\\([0-9]{4}\\\\\\\\)\\\")\\n\\t\\t\\tif(yearindex>0) {\\n\\t\\t\\t\\tvar filmborn = link.innerHTML.substring(yearindex + 1,\\n\\t\\t\\t\\t\\tyearindex + 5);\\n\\t\\t\\t\\t//calculate ages\\n\\t\\t\\t\\tvar filmage = new Date().getFullYear() - filmborn;\\n\\t\\t\\t\\tvar age = filmborn - born;\\n\\t\\t\\t\\tage = new String(age +\\n\\t\\t\\t\\t\\t\\\" year\\\" + (age == 1 ? '' : 's') + \\\" old\\\");\\n\\n\\t\\t\\t\\t//get them in a nice format\\n\\t\\t\\t\\tif (filmage < 0) {\\n\\t\\t\\t\\t\\tvar agetxt = new String(\\n\\t\\t\\t\\t\\t\\t\\\"in \\\" +\\n\\t\\t\\t\\t\\t\\tMath.abs(filmage) + \\\" year\\\" +\\n\\t\\t\\t\\t\\t\\t(Math.abs(filmage) == 1 ? '' : 's') +\\n\\t\\t\\t\\t\\t\\t\\\" will be \\\" + age);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (filmage == 0) {\\n\\t\\t\\t\\t\\t\\tvar agetxt = new String(\\n\\t\\t\\t\\t\\t\\t\\t\\t\\\"this year while \\\" + age);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (filmage > 0) {\\n\\t\\t\\t\\t\\tvar agetxt = new String(\\n\\t\\t\\t\\t\\t\\tMath.abs(filmage) + \\\" year\\\" +\\n\\t\\t\\t\\t\\t\\t(Math.abs(filmage) == 1 ? '' : 's') +\\n\\t\\t\\t\\t\\t\\t\\\" ago while \\\" + age);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tlink.innerHTML =\\n\\t\\t\\t\\t\\tlink.innerHTML.substring(0, yearindex + 5)\\n\\t\\t\\t\\t\\t+ \\\", \\\" + agetxt\\n\\t\\t\\t\\t\\t+ link.innerHTML.substring(yearindex + 5);\\n\\t\\t\\t}\\n }\\n}\",\n \"function sortedOfAge(arr){\\n var over18 = []\\n arr.filter((person) => {\\n if (person.age > 18){\\n over18.push(person)\\n }\\n })\\n var inOrder = over18.sort((a, b) => {\\n var nameA = a.lastName\\n var nameB = b.lastName\\n if (nameA < nameB) {\\n return -1;\\n }\\n if (nameA > nameB) {\\n return 1;\\n }\\n return 0\\n })\\n var finalArr = []\\n inOrder.map((person) => {\\n finalArr.push(\\\"
                  • \\\" + person.firstName + \\\" \\\" + person.lastName + \\\" is \\\" + person.age + \\\"
                  • \\\")\\n })\\n return finalArr\\n }\",\n \"function SecondGreatLow(arr) { \\n\\tif (arr.length === 2){\\n\\t\\tif(arr[0] > arr[1]) {\\n\\t\\t\\treturn arr[0] + \\\" \\\" + arr[1];\\n\\t\\t} else {\\n\\t\\t\\treturn arr[1] + \\\" \\\" + arr[0];\\n\\t\\t}\\n\\t} else {\\n\\t\\tvar greatest = Math.max.apply(Math, arr);\\n\\t\\tvar lowest = Math.min.apply(Math, arr);\\n\\t\\tvar newArr = [];\\n\\t\\tfor (var i = 0; i \\n item.gender === 'm' || item.gender === 'M')\\n .sort((a, b) => a.age - b.age )\\n }\",\n \"function ageSort(){\\n return function(people){\\n people.sort(function(a,b){\\n return a.age - b.age;\\n });\\n console.log(people);\\n };\\n }\",\n \"function getAges(array, value) {\\n let output = [];\\n for (let i = 0; i < array.length; ++i) {\\n output.push(array[i][value]);\\n }\\n return output;\\n}\",\n \"function SortByAge() {\\n var pl = [];\\n pl = Object.age(players).sort()\\n return pl.reverse();\\n}\",\n \"static ageCompareHigh(user1, user2) {\\n // TODO: check that age exists\\n return user2.age - user1.age;\\n }\",\n \"function AgeSort() {\\n employees.sort(function (a, b) {\\n return (a.dob.age - b.dob.age)\\n })\\n visibleEmployees([...employees])\\n }\",\n \"function SecondGreatLow(arr) {\\n //if length is 2 edge case\\n if (arr.length === 2){\\n sortedArr = arr.sort();\\n return sortedArr[1]+\\\" \\\"+sortedArr[0];\\n }\\n\\n var min, max, min2, max2;\\n sortedArr = arr.sort();\\n min = sortedArr[0];\\n max = sortedArr[sortedArr.length];\\n min2 = max;\\n max2 = min;\\n for (var i = 0; i < sortedArr.length; i++) {\\n //set min2\\n if (sortedArr[i] !== min){\\n if(sortedArr[i] < min2){\\n min2 = sortedArr[i];\\n }\\n }\\n //set max2\\n if (sortedArr[i] !== max){\\n if(sortedArr[i] > max2){\\n max2 = sortedArr[i];\\n }\\n }\\n }//end loop\\n return min2+\\\" \\\"+max2;\\n}//end function\",\n \"function getLeaveDatesInAscendinOrder(leaveDatesArray){\\t\\r\\n\\t\\t var datesArray;\\r\\n\\t\\t var sortedArray=[];\\r\\n\\t\\t var stringDate;\\r\\n\\t\\t datesArray=new Array(leaveDatesArray.length);\\r\\n\\t for(var j=0;j< leaveDatesArray.length;j++){\\r\\n\\t \\t //console.log(\\\"type of leave date : \\\"+ typeof leaveDatesArray[j].leaveDate)\\r\\n\\t \\t datesArray.push(new Date(leaveDatesArray[j].leaveDate));\\r\\n\\t\\t }\\r\\n\\t datesArray.sort(function (a,b){ return (a > b) ? 1 : -1;});\\r\\n\\t \\r\\n\\t for(var j=0;j< leaveDatesArray.length;j++){\\r\\n\\t \\t stringDate=datesArray[j].getDate()+\\\"/\\\"+(datesArray[j].getMonth()+1)+\\\"/\\\"+datesArray[j].getFullYear(); new Date().g\\r\\n\\t \\t //leaveDetails [i][4][j]=(datesArray[j]+\\\"\\\").substring(0,15);\\r\\n\\t \\t sortedArray.push(stringDate);\\r\\n\\t }\\r\\n\\t \\r\\n\\t return sortedArray;\\r\\n\\t \\r\\n\\t }\",\n \"function findAverage(array) {\\n const sumElementsAgesArray = (accumulator, currentValue) => accumulator + currentValue;\\n const averageAge = array.reduce(sumElementsAgesArray, 0) / array.length;\\n return averageAge;\\n}\",\n \"function sortByAge(){\\n employees.sort(function(a,b){\\n return (a.dob.age - b.dob.age)\\n })\\n setDisplayedEmployees([...employees])\\n }\",\n \"function lowhigh(arr) {\\n max = arr[0];\\n min = arr[0];\\n for (var i = 0; i < arr.length; i++) {\\n if (arr[i] > max) {\\n max = arr[i];\\n }\\n if (arr[i] < min) {\\n min = arr[i];\\n }\\n }\\n return min, max;\\n}\",\n \"function olderThanTwentyFour(arr) {\\n return arr.filter(n => n.age >= 24)\\n}\",\n \"function getAverageAge(arr) {\\n return arr.reduce((acc, item) => acc + item.age, 0) / arr.length;\\n}\",\n \"howOld(birthday){\\n \\n //calculate the month difference from the current month\\n //calculate the day difference from the current date\\n //calculate year difference from the current year\\n //put calculation in date format\\n //calculate the age person\\n //return the age of the person\\n\\n return -1;\\n }\",\n \"handleAllAges(ages) {\\n const allAges = ages.filter( age => { return age.name == 'All Ages' } )\\n if ( allAges.length < 1 ) {\\n ages.push({\\n id: \\\"58e4b35fdb252928067b4379\\\",\\n name: \\\"All Ages\\\",\\n displayOrder: 0\\n })\\n }\\n return ages.sort(this.handleDisplayOrder)\\n }\",\n \"function bornBeforeYear(dataArr, year) {\\n const result = [];\\n dataArr.forEach(person => {\\n const birthYear = new Date(person.birthday).getFullYear();\\n (birthYear < year) && result.push(person);\\n \\n });\\n return result; \\n}\",\n \"function averageAge(arr) {\\n\\n const currentAge = arr.map(cur => new Date().getFullYear() - cur.buildYear);\\n\\n function add(a, b) {\\n return a + b;\\n }\\n\\n const totalAge = currentAge.reduce(add, 0);\\n const average = totalAge / arr.length;\\n\\n console.log(`Our ${arr.length} parks have an average age of ${average} years.`);\\n}\",\n \"function getMaxAge(data) {\\n\\tconst ageList = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\\n\\tconst maxAge = Math.max(...ageList)\\n\\tconsole.log('MAXIMUM AGE:', maxAge)\\n\\treturn maxAge\\n}\",\n \"function twoTeams(sailors) {\\n const team1 = []; // holds sailors younger than 20 and older than 40\\n const team2 = []; // holds sailors between the ages 20 and 40\\n const sailorNames = Object.keys(sailors);\\n\\n sailorNames.forEach(sailor => {\\n sailors[sailor] < 20 || sailors[sailor] > 40\\n ? team1.push(sailor)\\n : team2.push(sailor);\\n });\\n\\n const sorted = [team1.sort(), team2.sort()];\\n return sorted;\\n}\",\n \"function bestYearAvg (array){\\n //puedo calcular el avg con el método de arriba, para ello, tengo que conseguir tener un array con todas las \\n //peliculas de un año \\n var ordenado = array.sort(function(a,b) {\\n return a.parseInt(year) - b.parseInt(year);\\n } );\\n}\",\n \"get oldestObject() {\\n\\t\\n\\t\\tif(this.#_augmentaScene.objectCount == 0) {\\n\\t\\t\\tconsole.log('No object in scene')\\n\\t\\t} else {\\n\\n\\t\\t\\tlet maxAge = -1;\\n\\t\\t\\tlet maxId;\\n\\n\\t\\t\\tfor(var id in this.#_augmentaObjects) {\\n\\t\\t\\t\\tif(this.#_augmentaObjects[id].age > maxAge) {\\n\\t\\t\\t\\t\\tmaxAge = this.#_augmentaObjects[id].age;\\n\\t\\t\\t\\t\\tmaxId = id;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn this.#_augmentaObjects[maxId]\\n\\t\\t}\\n\\n\\t}\",\n \"function byAge(person1, person2) {\\n var age1 = person1.age;\\n var age2 = person2.age;\\n return age2 - age1;\\n}\",\n \"function computeAge(i) \\n {\\n var todaysDate = new Date();\\n var birthD = $(\\\"#booking_tickets_\\\"+ i +\\\"_birthdate_day\\\").val();\\n var birthM = $(\\\"#booking_tickets_\\\"+ i +\\\"_birthdate_month\\\").val();\\n var birthY = $(\\\"#booking_tickets_\\\"+ i +\\\"_birthdate_year\\\").val();\\n\\n if((birthM < todaysDate.getMonth()) || ((birthM == todaysDate.getMonth()) && (birthD <= todaysDate.getDate())))\\n {\\n var age = todaysDate.getFullYear() - birthY;\\n }\\n else\\n {\\n var age = todaysDate.getFullYear() - birthY - 1;\\n } \\n\\n return age;\\n }\",\n \"getYearRange(date) {\\n let year = [], first, last;\\n date.forEach(e => {\\n year.push(parseInt(e))\\n })\\n first = year[0];\\n last = year[year.length-1]\\n year.forEach(e => {\\n first = e < first ? e : first;\\n last = e > last ? e : last;\\n })\\n return({first,last});\\n }\",\n \"function CompareBirthdays(a, b)\\r\\n {\\r\\n return a[\\\"nextBirthday\\\"] - b[\\\"nextBirthday\\\"];\\r\\n }\",\n \"function howOld(age, year) {\\n const currentDate = new Date();\\n const currentYear = currentDate.getFullYear();\\n\\n if (year > currentYear) {\\n var NewAge = year - currentYear + age;\\n return `You will be ${NewAge} in the year ${year}`;\\n } else if (year < currentYear - age) {\\n var diference = currentYear - age - year;\\n return `The year ${year} was ${diference} years before you were born`;\\n } else if (year < currentYear && year > currentYear - age) {\\n var NewAge = age - (currentYear - year);\\n return `You were ${NewAge} in the year ${year}`;\\n }\\n}\",\n \"calculateAge() {\\n let date_1 = new Date(age);\\n let diff = Date.now() - date_1.getTime();\\n var age_date = new Date(diff);\\n return Math.abs(age_date.getUTCFullYear() - 1970); \\n }\",\n \"function olderPerson(obj) {\\n var ins = obj[0];\\n var str = \\\"\\\";\\n for (let i = 0; i < obj.length; i++) {\\n if (obj[i].age > ins.age) {\\n ins = obj[i];\\n str = ins.name.first + \\\" \\\" + ins.name.last;\\n }\\n }\\n return str;\\n}\",\n \"function retire(year){\\n\\tconst age=new Date().getFullYear()-year;\\n\\treturn [age,65-age];\\n}\",\n \"function getAge() {\\n year = born.slice(0, born.indexOf(\\\"-\\\"));\\n month = born.slice(5, 7);\\n day = born.slice(8);\\n var today = new Date();\\n var age = today.getFullYear() - year;\\n var m = today.getMonth() - month;\\n if (m < 0 || (m === 0 && today.getDate() < day)) {\\n age--;\\n }\\n return age;\\n }\",\n \"function findOldestIndex(history){\\n var index = null;// index of oldest element\\n var sAge = null; // smallest age\\n\\n // Abort if there is no elements in history\\n if(history.length<1){\\n return -1;\\n }\\n\\n index = 0;\\n sAge = history[0].age;\\n for (var i = 1; i < history.length; i++){\\n if(history[i].age= minAge) console.log(personA);\\n if (personB.age >= minAge) console.log(personB);\\n}\",\n \"howOld(birthday){\\n \\n // convert birthday into a numeric value\\n\\n // convert current date into a numeric value\\n\\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\\n\\n // convert the time elapsed value into years\\n\\n // round down the converted years value\\n\\n // return the rounded years value\\n\\n let date = new Date().getFullYear();\\n let age = date-birthyear\\n \\n return age;\\n return -1;\\n }\",\n \"function maleAge(){\\n for (i=0; i a.age - b.age);\\n }\\n }\\n console.log(devs);\\n }\",\n \"function calculateAge(birthyear, currentyear) {\\n\\tvar lowage = currentyear - birthyear - 1;\\n\\tvar highage = currentyear - birthyear;\\n\\talert(\\\"You are either \\\" + lowage + \\\" or \\\" + highage)\\n}\",\n \"function cmp(a, b) {\\n let yearA = a[0].years[0]\\n let yearB = b[0].years[0]\\n return (yearB > yearA) ? 1 : ((yearB < yearA) ? -1 : 0)\\n }\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.78486305","0.7427882","0.7326222","0.7013265","0.6738038","0.6712644","0.6627846","0.65975624","0.6574193","0.65132743","0.64635026","0.6458466","0.6167384","0.61547387","0.61451113","0.6124622","0.61235875","0.6054878","0.60398024","0.5996854","0.59744465","0.5914014","0.5867591","0.5856671","0.58202606","0.57858205","0.57242167","0.568981","0.56497484","0.5565444","0.55318314","0.54632664","0.5447516","0.54131216","0.5400243","0.5387784","0.5377324","0.534785","0.53326815","0.5315936","0.5313117","0.53014606","0.529978","0.52995855","0.52674514","0.52511173","0.5245469","0.5165579","0.51598126","0.51314634","0.5115528","0.5113536","0.5098518","0.5091819","0.5087076","0.50869864","0.5064244","0.5062651","0.5047704","0.50385827","0.503432","0.5019996","0.5009346","0.49864846","0.49831757","0.49817878","0.49811423","0.4966967","0.49572924","0.49408603","0.4938074","0.49268717","0.49176195","0.49129707","0.49129707","0.49129707","0.49129707","0.49129707","0.4912695","0.49116746","0.49035922","0.4887394","0.48794785","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706"],"string":"[\n \"0.78486305\",\n \"0.7427882\",\n \"0.7326222\",\n \"0.7013265\",\n \"0.6738038\",\n \"0.6712644\",\n \"0.6627846\",\n \"0.65975624\",\n \"0.6574193\",\n \"0.65132743\",\n \"0.64635026\",\n \"0.6458466\",\n \"0.6167384\",\n \"0.61547387\",\n \"0.61451113\",\n \"0.6124622\",\n \"0.61235875\",\n \"0.6054878\",\n \"0.60398024\",\n \"0.5996854\",\n \"0.59744465\",\n \"0.5914014\",\n \"0.5867591\",\n \"0.5856671\",\n \"0.58202606\",\n \"0.57858205\",\n \"0.57242167\",\n \"0.568981\",\n \"0.56497484\",\n \"0.5565444\",\n \"0.55318314\",\n \"0.54632664\",\n \"0.5447516\",\n \"0.54131216\",\n \"0.5400243\",\n \"0.5387784\",\n \"0.5377324\",\n \"0.534785\",\n \"0.53326815\",\n \"0.5315936\",\n \"0.5313117\",\n \"0.53014606\",\n \"0.529978\",\n \"0.52995855\",\n \"0.52674514\",\n \"0.52511173\",\n \"0.5245469\",\n \"0.5165579\",\n \"0.51598126\",\n \"0.51314634\",\n \"0.5115528\",\n \"0.5113536\",\n \"0.5098518\",\n \"0.5091819\",\n \"0.5087076\",\n \"0.50869864\",\n \"0.5064244\",\n \"0.5062651\",\n \"0.5047704\",\n \"0.50385827\",\n \"0.503432\",\n \"0.5019996\",\n \"0.5009346\",\n \"0.49864846\",\n \"0.49831757\",\n \"0.49817878\",\n \"0.49811423\",\n \"0.4966967\",\n \"0.49572924\",\n \"0.49408603\",\n \"0.4938074\",\n \"0.49268717\",\n \"0.49176195\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.4912695\",\n \"0.49116746\",\n \"0.49035922\",\n \"0.4887394\",\n \"0.48794785\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\"\n]"},"document_score":{"kind":"string","value":"0.74437"},"document_rank":{"kind":"string","value":"1"}}},{"rowIdx":77,"cells":{"query":{"kind":"string","value":"Simple route middleware to ensure user is authenticated."},"document":{"kind":"string","value":"function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n req.session.error = 'Please sign in!';\n res.redirect('/signin');\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 ensureAuthenticated(req, res, next){\n if (req.isAuthenticated()){\n return next();\n }\n else {\n res.redirect('/');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next){\n if(req.isAuthenticated()) return next();\n res.redirect(\"/login\");\n}","function isAuthenticated(){\n return function(req, res, next){\n if (req.isAuthenticated()){\n return next();\n }\n res.redirect('/signin');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { console.log(\"IS AUTH : \" + req); return next(); }\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n }","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n res.redirect('/login');\r\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/')\n }","function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n } else {\n res.redirect('/login')\n }\n}","function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) { return next(); }\r\n res.redirect('/login')\r\n}","function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) { return next(); }\r\n res.redirect('/login')\r\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n // check authentication\n if (req.isAuthenticated()) {\n // req.user is available for use here\n return next();\n }\n // denied. redirect to login\n res.redirect(\"/\");\n}","function ensureAuthenticated(req, res, next) {\n \tif (req.isAuthenticated()) { return next(); }\n \tres.redirect('/login');\n }","function isAuthenticated(req, res, next){\n \n // allow all /GET requests\n if(req.method == 'GET'){\n return next();\n } \n\n // allow any request where the user is authenticated\n if(req.isAuthenticated()){\n return next();\n } \n\n //for anything else, redirect to login page\n return res.redirect('/#login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n return next(); \n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n return next(); \n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/users/login');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/login')\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n\tif(req.isAuthenticated()) {\n\t\treturn next();\n\t} else {\n\t\tres.redirect('/user/login');\n\t}\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"/login\");\n}","function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if(req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/users/login');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/')\n}","function isAuthenticated(req, res, next)\n {\n if (req.user) return next();\n res.redirect('/');\n }","function ensureAuthenticated(req, res, next) {\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}","function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n };\n res.redirect('/login'); // <-- Attention: we don't have this page in the example.\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n return null;\n}","function ensureAuthenticated(request, response, next) {\r\n \"use strict\";\r\n if (request.isAuthenticated()) { return next(); }\r\n response.redirect('/login');\r\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated())\n\t return next();\n res.redirect('/login');\n}","function isAuthenticated() {\n return compose()\n .use(function(req, res, next) { // used to validate jwt of user session\n if(req.query && req.query.hasOwnProperty('access_token')) { // allows 'access_token' to be passed through 'req.query' if necessary\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n .use(function(req, res, next) { //used to attach 'user' to 'req'\n User.findById(req.user._id, function (err, user) {\n if (err) return next(err);\n if (!user) return res.status(401).send('Unauthorized');\n\n req.user = user;\n console.log('user auth success');\n next();\n });\n });\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated() && validate_user(req.user)) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n // req.user is available for use here\n return next(); }\n\n // denied. redirect to login\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n // req.user is available for use here\n return next(); }\n\n // denied. redirect to login\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/auth/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) next();\n else res.send(401);\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n next();\n } else {\n res.sendStatus(401);\n }\n}","function ensureAuthenticated(req, res, next) {\n\t\tif (req.isAuthenticated()) { return next(); }\n\t\tres.redirect('/login');\n\t}","function authenticate(req, res, next) {\n \n if (req.isAuthenticated()) {\n return next();\n } \n \n res.redirect('/');\n}","function checkAuthenticated(req, res, next) {\r\n \r\n if (req.isAuthenticated()) {\r\n return next()\r\n }\r\n res.redirect(\"/\");\r\n \r\n}","function ensureAuthenticated(req, res, next){\n req.user=req.user||(typeof req.body.user=='string'?JSON.parse(req.body.user):req.body.user);\nif(req.isAuthenticated()){\n return next();\n\t} else {\n\t\tres.json({status:\"no user\"});\n\t}\n\n}","function ensureAuthenticated (request, response, next) {\n console.log('inside ensure Authenticated');\n if (request.isAuthenticated()) {\n return next();\n }\n response.redirect('/login');\n}","function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n req.headers.authorization = req.get(\"authorization\");\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use(function(req, res, next) {\n User.findByIdAsync(req.user._id)\n .then(function(user) {\n if (!user) {\n return res.status(401).end();\n } return req.user = user; })\n .catch(function(err) {\n return next(err);\n });\n next()\n });\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/log');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n next();\n } else {\n req.flash(\"info\", \"Hey, you've got to be logged in to do that!\");\n res.redirect(\"/login\");\n }\n}","function ensureAuthenticated(req, res, next) {\n console.log('\\n\\nensureAuthenticated\\n\\n');\n // console.log(req);\n if (req.isAuthenticated()) {\n console.log('\\n\\nisAuthenticated');\n return next();\n }\n console.log('\\n\\nnot isAuthenticated');\n res.redirect('/login');\n}","function isUserAuthenticated(req, res, next) {\n if (req.user) next();\n else res.send(\"No autenticado\");\n}","function hasAccess(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } \n else\n {\n return res.redirect('/'); \n }\n}","function ensureAuthenticated(req, res, next) {\n if (!req.isAuthenticated()) {\n res.json({\n message: 'Authentication check failed.',\n });\n }\n\n return next();\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/admin');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/') // changed from '/login' to '/index'\n}","function isAuthenticated(req, res, next) {\n if (req.user) return next(); //there is an authenticated user\n res.redirect('/users/signin'); //send them to the login page\n}","function ensureAuthenticated(req, res, next) {\n req.session.redirect_url = req.route.path;\n if (req.isAuthenticated()) {\n console.log(\"authorized\");\n next();\n }\n else {\n console.log(\"not authorized\");\n res.redirect('/login');\n }\n}","function ensureAuthenticated(req, res, next) {\n\tif(req.isAuthenticated()){\n\t\treturn next();\n\t}\n\tconsole.log(\"redirected\");\n\tres.redirect('/');\n}","function authenticatedUser(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect('/');\n}","function isAuthenticated(req, res, next) {\n if(req.user) return next();\n return res.status(401).json({ msg: 'Not Authorized'})\n}","function checkAuthenticated(req, res, next) {\n // Check if the User is authenticated\n if (req.isAuthenticated()) {\n return next();\n }\n\n // If return false\n res.redirect(\"/\");\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n req.flash('error_msg', 'Du er ikke logget ind');\n res.redirect('/login');\n }\n}","function ensureAuthenticate(req, res, next) {\n\tif (req.isAuthenticated()) { return next();}\n\tres.redirect('/login')\n}","function verifyAuthentication(){\n return (req, res, next) => {\n if (req.isAuthenticated()){\n return next();\n }else{\n res.redirect('/login');\n }\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n req.flash('error', '');\n req.flash('error', 'You don\\'t have permission to access this page!');\n res.redirect('/login')\n }\n}","function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n // allow jwt to be placed on query string too\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n // attach user to the request\n .use(function(req, res, next) {\n User.findById(req.user._id, function(err, user) {\n if (err) {\n return next(err);\n }\n\n if (!user || _.isEmpty(user)) {\n return res.send(401);\n }\n\n req.user = user;\n next();\n });\n });\n}","function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n }\n\n res.redirect('/login')\n}","function secureRoute(req, res, next) {\n if(!req.headers.authorization) return res.status(401).json({ message: \"You are not allowed in because you're not cool enough.\"});\n\n var token = req.headers.authorization.replace(\"Bearer \", \"\")\n\n jwt.verify(token, secret, function(err, payload){\n if(err || !payload) return res.status(401).json({ message: \"You are not allowed in because you're not cool enough.\"});\n\n req.user = payload;\n next();\n });\n}"],"string":"[\n \"function ensureAuthenticated(req, res, next){\\n if (req.isAuthenticated()){\\n return next();\\n }\\n else {\\n res.redirect('/');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next){\\n if(req.isAuthenticated()) return next();\\n res.redirect(\\\"/login\\\");\\n}\",\n \"function isAuthenticated(){\\n return function(req, res, next){\\n if (req.isAuthenticated()){\\n return next();\\n }\\n res.redirect('/signin');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { console.log(\\\"IS AUTH : \\\" + req); return next(); }\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n }\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\r\\n if (req.isAuthenticated()) {\\r\\n return next();\\r\\n }\\r\\n res.redirect('/login');\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/')\\n }\",\n \"function ensureAuthenticated (req, res, next) {\\n if (req.isAuthenticated()) {\\n return next()\\n } else {\\n res.redirect('/login')\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\r\\n if (req.isAuthenticated()) { return next(); }\\r\\n res.redirect('/login')\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\r\\n if (req.isAuthenticated()) { return next(); }\\r\\n res.redirect('/login')\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n // check authentication\\n if (req.isAuthenticated()) {\\n // req.user is available for use here\\n return next();\\n }\\n // denied. redirect to login\\n res.redirect(\\\"/\\\");\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n \\tif (req.isAuthenticated()) { return next(); }\\n \\tres.redirect('/login');\\n }\",\n \"function isAuthenticated(req, res, next){\\n \\n // allow all /GET requests\\n if(req.method == 'GET'){\\n return next();\\n } \\n\\n // allow any request where the user is authenticated\\n if(req.isAuthenticated()){\\n return next();\\n } \\n\\n //for anything else, redirect to login page\\n return res.redirect('/#login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { \\n return next(); \\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { \\n return next(); \\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n res.redirect('/users/login');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n res.redirect('/login')\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif(req.isAuthenticated()) {\\n\\t\\treturn next();\\n\\t} else {\\n\\t\\tres.redirect('/user/login');\\n\\t}\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect(\\\"/login\\\");\\n}\",\n \"function ensureAuthenticated (req, res, next) {\\n if (req.isAuthenticated()) {\\n return next()\\n }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if(req.isAuthenticated()) {\\n return next();\\n } else {\\n res.redirect('/users/login');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/')\\n}\",\n \"function isAuthenticated(req, res, next)\\n {\\n if (req.user) return next();\\n res.redirect('/');\\n }\",\n \"function ensureAuthenticated(req, res, next) {\\n // if user is authenticated in the session, carry on \\n if (req.isAuthenticated())\\n return next();\\n\\n // if they aren't redirect them to the home page\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n // if user is authenticated in the session, carry on \\n if (req.isAuthenticated())\\n return next();\\n\\n // if they aren't redirect them to the home page\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated (req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n };\\n res.redirect('/login'); // <-- Attention: we don't have this page in the example.\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n return null;\\n}\",\n \"function ensureAuthenticated(request, response, next) {\\r\\n \\\"use strict\\\";\\r\\n if (request.isAuthenticated()) { return next(); }\\r\\n response.redirect('/login');\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated())\\n\\t return next();\\n res.redirect('/login');\\n}\",\n \"function isAuthenticated() {\\n return compose()\\n .use(function(req, res, next) { // used to validate jwt of user session\\n if(req.query && req.query.hasOwnProperty('access_token')) { // allows 'access_token' to be passed through 'req.query' if necessary\\n req.headers.authorization = 'Bearer ' + req.query.access_token;\\n }\\n validateJwt(req, res, next);\\n })\\n .use(function(req, res, next) { //used to attach 'user' to 'req'\\n User.findById(req.user._id, function (err, user) {\\n if (err) return next(err);\\n if (!user) return res.status(401).send('Unauthorized');\\n\\n req.user = user;\\n console.log('user auth success');\\n next();\\n });\\n });\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated() && validate_user(req.user)) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n // req.user is available for use here\\n return next(); }\\n\\n // denied. redirect to login\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n // req.user is available for use here\\n return next(); }\\n\\n // denied. redirect to login\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/auth/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) next();\\n else res.send(401);\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n next();\\n } else {\\n res.sendStatus(401);\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\t\\tif (req.isAuthenticated()) { return next(); }\\n\\t\\tres.redirect('/login');\\n\\t}\",\n \"function authenticate(req, res, next) {\\n \\n if (req.isAuthenticated()) {\\n return next();\\n } \\n \\n res.redirect('/');\\n}\",\n \"function checkAuthenticated(req, res, next) {\\r\\n \\r\\n if (req.isAuthenticated()) {\\r\\n return next()\\r\\n }\\r\\n res.redirect(\\\"/\\\");\\r\\n \\r\\n}\",\n \"function ensureAuthenticated(req, res, next){\\n req.user=req.user||(typeof req.body.user=='string'?JSON.parse(req.body.user):req.body.user);\\nif(req.isAuthenticated()){\\n return next();\\n\\t} else {\\n\\t\\tres.json({status:\\\"no user\\\"});\\n\\t}\\n\\n}\",\n \"function ensureAuthenticated (request, response, next) {\\n console.log('inside ensure Authenticated');\\n if (request.isAuthenticated()) {\\n return next();\\n }\\n response.redirect('/login');\\n}\",\n \"function isAuthenticated() {\\n return compose()\\n // Validate jwt\\n .use(function(req, res, next) {\\n req.headers.authorization = req.get(\\\"authorization\\\");\\n validateJwt(req, res, next);\\n })\\n // Attach user to request\\n .use(function(req, res, next) {\\n User.findByIdAsync(req.user._id)\\n .then(function(user) {\\n if (!user) {\\n return res.status(401).end();\\n } return req.user = user; })\\n .catch(function(err) {\\n return next(err);\\n });\\n next()\\n });\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/log');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { \\n next();\\n } else {\\n req.flash(\\\"info\\\", \\\"Hey, you've got to be logged in to do that!\\\");\\n res.redirect(\\\"/login\\\");\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n console.log('\\\\n\\\\nensureAuthenticated\\\\n\\\\n');\\n // console.log(req);\\n if (req.isAuthenticated()) {\\n console.log('\\\\n\\\\nisAuthenticated');\\n return next();\\n }\\n console.log('\\\\n\\\\nnot isAuthenticated');\\n res.redirect('/login');\\n}\",\n \"function isUserAuthenticated(req, res, next) {\\n if (req.user) next();\\n else res.send(\\\"No autenticado\\\");\\n}\",\n \"function hasAccess(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } \\n else\\n {\\n return res.redirect('/'); \\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (!req.isAuthenticated()) {\\n res.json({\\n message: 'Authentication check failed.',\\n });\\n }\\n\\n return next();\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/admin');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/') // changed from '/login' to '/index'\\n}\",\n \"function isAuthenticated(req, res, next) {\\n if (req.user) return next(); //there is an authenticated user\\n res.redirect('/users/signin'); //send them to the login page\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n req.session.redirect_url = req.route.path;\\n if (req.isAuthenticated()) {\\n console.log(\\\"authorized\\\");\\n next();\\n }\\n else {\\n console.log(\\\"not authorized\\\");\\n res.redirect('/login');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif(req.isAuthenticated()){\\n\\t\\treturn next();\\n\\t}\\n\\tconsole.log(\\\"redirected\\\");\\n\\tres.redirect('/');\\n}\",\n \"function authenticatedUser(req, res, next){\\n if(req.isAuthenticated()){\\n return next();\\n }\\n res.redirect('/');\\n}\",\n \"function isAuthenticated(req, res, next) {\\n if(req.user) return next();\\n return res.status(401).json({ msg: 'Not Authorized'})\\n}\",\n \"function checkAuthenticated(req, res, next) {\\n // Check if the User is authenticated\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n\\n // If return false\\n res.redirect(\\\"/\\\");\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n req.flash('error_msg', 'Du er ikke logget ind');\\n res.redirect('/login');\\n }\\n}\",\n \"function ensureAuthenticate(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next();}\\n\\tres.redirect('/login')\\n}\",\n \"function verifyAuthentication(){\\n return (req, res, next) => {\\n if (req.isAuthenticated()){\\n return next();\\n }else{\\n res.redirect('/login');\\n }\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n req.flash('error', '');\\n req.flash('error', 'You don\\\\'t have permission to access this page!');\\n res.redirect('/login')\\n }\\n}\",\n \"function isAuthenticated() {\\n return compose()\\n // Validate jwt\\n .use(function(req, res, next) {\\n // allow jwt to be placed on query string too\\n if (req.query && req.query.hasOwnProperty('access_token')) {\\n req.headers.authorization = 'Bearer ' + req.query.access_token;\\n }\\n validateJwt(req, res, next);\\n })\\n // attach user to the request\\n .use(function(req, res, next) {\\n User.findById(req.user._id, function(err, user) {\\n if (err) {\\n return next(err);\\n }\\n\\n if (!user || _.isEmpty(user)) {\\n return res.send(401);\\n }\\n\\n req.user = user;\\n next();\\n });\\n });\\n}\",\n \"function checkAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next()\\n }\\n\\n res.redirect('/login')\\n}\",\n \"function secureRoute(req, res, next) {\\n if(!req.headers.authorization) return res.status(401).json({ message: \\\"You are not allowed in because you're not cool enough.\\\"});\\n\\n var token = req.headers.authorization.replace(\\\"Bearer \\\", \\\"\\\")\\n\\n jwt.verify(token, secret, function(err, payload){\\n if(err || !payload) return res.status(401).json({ message: \\\"You are not allowed in because you're not cool enough.\\\"});\\n\\n req.user = payload;\\n next();\\n });\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.77062464","0.76014584","0.7570125","0.7560704","0.7558127","0.7558127","0.7558127","0.7551246","0.7539155","0.75295085","0.75295085","0.7519517","0.75158256","0.75106835","0.7509376","0.7509376","0.7509193","0.7509193","0.7509193","0.75080097","0.75054514","0.75034195","0.749991","0.749991","0.7496916","0.7496916","0.7495844","0.749249","0.7486191","0.7486191","0.74855965","0.7469043","0.7468823","0.7464914","0.7464914","0.7464914","0.7464914","0.7464914","0.7458528","0.7451176","0.7451176","0.7451176","0.7451176","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.7432074","0.7432074","0.7432074","0.7430772","0.7430497","0.74252594","0.74252594","0.74242","0.7406079","0.74012804","0.73913044","0.73905575","0.73861957","0.7382927","0.7382927","0.73820174","0.7381697","0.73723996","0.73561263","0.7351603","0.73496175","0.7335079","0.73260283","0.732043","0.72997856","0.72989535","0.7296191","0.7287464","0.72852117","0.728441","0.7284316","0.7282366","0.7274232","0.72711754","0.72704893","0.7269503","0.7265945","0.72615933","0.72517943","0.7250392","0.7250325","0.7244367","0.7242365","0.7239723","0.7234922","0.7228577"],"string":"[\n \"0.77062464\",\n \"0.76014584\",\n \"0.7570125\",\n \"0.7560704\",\n \"0.7558127\",\n \"0.7558127\",\n \"0.7558127\",\n \"0.7551246\",\n \"0.7539155\",\n \"0.75295085\",\n \"0.75295085\",\n \"0.7519517\",\n \"0.75158256\",\n \"0.75106835\",\n \"0.7509376\",\n \"0.7509376\",\n \"0.7509193\",\n \"0.7509193\",\n \"0.7509193\",\n \"0.75080097\",\n \"0.75054514\",\n \"0.75034195\",\n \"0.749991\",\n \"0.749991\",\n \"0.7496916\",\n \"0.7496916\",\n \"0.7495844\",\n \"0.749249\",\n \"0.7486191\",\n \"0.7486191\",\n \"0.74855965\",\n \"0.7469043\",\n \"0.7468823\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7458528\",\n \"0.7451176\",\n \"0.7451176\",\n \"0.7451176\",\n \"0.7451176\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.7432074\",\n \"0.7432074\",\n \"0.7432074\",\n \"0.7430772\",\n \"0.7430497\",\n \"0.74252594\",\n \"0.74252594\",\n \"0.74242\",\n \"0.7406079\",\n \"0.74012804\",\n \"0.73913044\",\n \"0.73905575\",\n \"0.73861957\",\n \"0.7382927\",\n \"0.7382927\",\n \"0.73820174\",\n \"0.7381697\",\n \"0.73723996\",\n \"0.73561263\",\n \"0.7351603\",\n \"0.73496175\",\n \"0.7335079\",\n \"0.73260283\",\n \"0.732043\",\n \"0.72997856\",\n \"0.72989535\",\n \"0.7296191\",\n \"0.7287464\",\n \"0.72852117\",\n \"0.728441\",\n \"0.7284316\",\n \"0.7282366\",\n \"0.7274232\",\n \"0.72711754\",\n \"0.72704893\",\n \"0.7269503\",\n \"0.7265945\",\n \"0.72615933\",\n \"0.72517943\",\n \"0.7250392\",\n \"0.7250325\",\n \"0.7244367\",\n \"0.7242365\",\n \"0.7239723\",\n \"0.7234922\",\n \"0.7228577\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":78,"cells":{"query":{"kind":"string","value":"append the created div to the divmodal"},"document":{"kind":"string","value":"componentDidMount() {\n modalRoot.appendChild(this.element);\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 addModal() {\n let div = $('
                    ');\n\tdiv.attr({\n\t\tid: 'modal-point',\n\t\tclass: 'modal fade'\n\t});\n div.attr(\"data-backdrop\", \"static\").attr(\"data-keyboard\", \"false\").attr(\"tabindex\", \"-1\").attr(\"role\", \"dialog\").attr(\"aria-hidden\", \"true\");\n $('body').append(div);\n\t$('#modal-point').on('hidden.bs.modal');\n}","function createModalDivHtml(options) {\n //If an element already exists with that ID, then dont recreate it.\n if ($(\"#\" + options.modalContainerId).length) {\n return;\n }\n\n var html = '';\n //Warning, do not put tabindex=\"-1\" in the element below. Doing so breaks search functionality in a select 2 drop down\n html += '
                    ';\n html += '
                    ';\n html += '
                    ';\n $('body').prepend(html);\n }","function genModCon() {\n const genModalDiv = ``;\n gallery.insertAdjacentHTML(\"afterEnd\", genModalDiv);\n const modalDiv = document.querySelector(\".modal-container\");\n modalDiv.style.display = \"none\";\n}","function modalWindow() {\r\n $('#gallery').append(\r\n `
                    \r\n
                    \r\n \r\n
                    \r\n
                    \r\n
                    \r\n
                    `);\r\n $('.modal-container').hide();\r\n }","function modalInject(){\n\t\t//inject modal holder into page\n\t\tif (!document.getElementById(\"g_block_modals\")) {\n\t\t\t$(\"body\").append(tdc.Grd.Templates.getByID('modalInject'));\n\t\t}\n\t}","function addModalToDom() {\n // create an instance of the overlay\n var $overlay = $('
                    ');\n $('body').prepend($overlay);\n $overlay.addClass('-active');\n $('body').css('overflow','hidden');\n // load the modal content\n $.get('business/includes/request-demo.html?cache=bust', function(data) {\n $overlay.html(data);\n doFormStuff($overlay);\n });\n }","function addModalToDom() {\n // create an instance of the overlay\n var $overlay = $('
                    ');\n $('body').prepend($overlay);\n $overlay.addClass('-active');\n $('body').css('overflow','hidden');\n // load the modal content\n $.get('includes/request-demo.html?cache=bust1', function(data) {\n $overlay.html(data);\n setTimeout(function() {\n $('.modal-contents', $overlay).addClass('-active');\n },50)\n doFormStuff($overlay);\n });\n }","function modal(){\n\t\t//creating necessary elements to structure modal\n\t\tvar iDiv = document.createElement('div');\n\t\tvar i2Div = document.createElement('div');\n\t\tvar h4 = document.createElement('h4');\n\t\tvar p = document.createElement('p');\n\t\tvar a = document.createElement('a');\n\n\t\t//modalItems array's element are being added to specific tags \n\t\th4.innerHTML = modalItems[1];\n\t\tp.innerHTML = modalItems[2];\n\t\ta.innerHTML = modalItems[0];\n\n\t\t//adding link and classes(materialize) to tags\n\t\tiDiv.setAttribute(\"class\", \"modal-content\");\n\t\ti2Div.setAttribute(\"class\", \"modal-footer\");\n\t\ta.setAttribute(\"class\", \"modal-action modal-close waves-effect waves-green btn-flat\");\n\t\ta.setAttribute(\"href\", \"sign_in.html\");\n\n\t\t//adding elements to tags as a child element\n\t\tiDiv.appendChild(h4);\n\t\tiDiv.appendChild(p);\n\n\t\ti2Div.appendChild(a);\n\n\t\tmodal1.appendChild(iDiv);\n\t\tmodal1.appendChild(i2Div);\n\t}","function appendModal(){\n\t\tvar panelSeklly = '
                    \\n' + \n '\t
                    \\n' + \n '\t\t
                    \\n' +\n '\t\t\t
                    \\n' + \n '\t\t\t\t\\n' + \n '\t\t\t\t

                    Modal title

                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t\t

                    One fine body&hellip;

                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t\t\\n' + \n '\t\t\t\t\\n' + \n '\t\t\t
                    \\n' + \n '\t\t
                    \\n' + \n '\t
                    \\n' + \n'
                    ';\n\t\t//\t\t\twindow.alert(\"Hello\");\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(panelSeklly, insertionPos);\n\t\t}\t\n\t}","function addModal() {\n modal = document.createElement( 'div' );\n modalClose = document.createElement( 'span' );\n modalImg = document.createElement( 'img' );\n modalAlt = document.createElement( 'div' );\n modal.id = 'modal';\n modalClose.id = 'close';\n modalClose.onclick = function() {\n modal.style.display = 'none';\n };\n modalClose.innerHTML = '&times;';\n modalImg.id = 'modalImg';\n modalAlt.id = 'alt';\n modal.appendChild( modalClose );\n modal.appendChild( modalImg );\n modal.appendChild( modalAlt );\n document.body.appendChild( modal );\n}","function addModalWindow(){\n gallery.insertAdjacentHTML('afterend', `\n
                    \n
                    \n \n
                    \n
                    \n
                    \n
                    `);\n let modalWindow = document.querySelector('.modal-container');\n modalWindow.style.display = 'none';\n}","function showModal () {\n $modal = $('

                    Your result:

                    ');\n $overlay = $('
                    ');\n $body.append($overlay);\n $body.append($modal);\n $modal.animate({ top: \"50%\" }, 800);\n }","function appendWindow(header, body, action, targetDiv, mainButtonClass, mainButtonIconStyle, mainButtonText, closeButtonText) {\n var window = getHtmlWindow(header, body, mainButtonClass, mainButtonIconStyle, mainButtonText, closeButtonText);\n window.css({\n \"display\": \"block\",\n });\n\n $(targetDiv).html(window);\n \n $(\"#deleteModalButton\").click(action);\n\n toggleWindow();\n \n }","function addModal(){\n body.insertAdjacentHTML('beforeend', `\n
                    \n
                    \n \n
                    \n
                    \n
                    \n
                    \n `)\n const modal = document.querySelector('.modal-container').style.display = 'none';\n const close = document.getElementById('modal-close-btn');\n close.addEventListener('click', (e) => {\n const modal = document.querySelector('.modal-container');\n modal.style.display = 'none';\n })\n}","onAdd() {\n this.createPopupHtml();\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }","function addBaseModal() {\n\tvar modal = $(\"#vulcano-modal\");\n\n\tif (!modal.exists()) {\n\t\tvar htmlModal = getModalHtml();\n\t\t$(\"body\").append(htmlModal);\n\t}\n}","function showInformationModal(message) {\n $('.container').append('
                    ' + message + '
                    ');\n $('.confirm-modal .close').on('click', function() {\n $('.confirm-modal').remove();\n });\n }","function addModal(containerID,modalID,bodyOnly){\n\tif(bodyOnly === null || bodyOnly === undefined){bodyOnly = false};\n\tif(containerID === null || containerID === undefined){containerID = 'main-container'};\n\tif(modalID === null || modalID === undefined){modalID = 'modal-id'};\n\t$('#'+modalID).remove();\n\tif(bodyOnly){\n\t$('#'+ containerID).append(`
                    \n \t
                    \n \t\t
                    \n \t\t\t\n\t \t\t
                    \n\t \t\t\t\n\t \t\t
                    \n\t \t\t\t\t
                    \n\t\t\t \t\n \t\t\t
                    \n \t\t
                    \n \t
                    `\n \t)\n\t}else{\n\t$('#'+ containerID).append(`\n
                    \n \t
                    \n \t\t
                    \n \t\t\n\t \t\t
                    \n\t \t\t\t\t
                    \n\t\t\t \t
                    \n \t\t\t
                    \n \t\t
                    \n \t
                    `\n \t)\n\t}\n}","function create_modal_fac_staff(elem,json_data) {\n\n var put_in = $('#modal_div');\n\n $div_people_modal = $(\"
                    \");\n\n $div_people_modal.append(\"

                    \"+json_data.name+ \"

                    \"+json_data.title+\"


                    \");\n\n $div_people_modal_im = $(\"
                    \");\n $('').load(function() {\n $(this).width(130).height(150).appendTo($div_people_modal_im);\n });\n\n $div_people_modal.append($div_people_modal_im);\n\n $div_people_modal_cont = $(\"
                    \");\n\n // adding contact info\n if(json_data.office != \"\" && json_data.office != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.office+\"

                    \");\n }\n if(json_data.phone != \"\" && json_data.phone != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.phone+\"

                    \");\n }\n if(json_data.email != \"\" && json_data.email != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.email+\"

                    \");\n }\n if(json_data.website != \"\" && json_data.website != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.website+\"

                    \");\n }\n if(json_data.twitter != \"\" && json_data.twitter != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.twitter+\"

                    \");\n }\n if(json_data.facebook != \"\" && json_data.facebook != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.facebook+\"

                    \");\n }\n\n $div_people_modal.append($div_people_modal_cont);\n\n\n put_in.append($div_people_modal);\n\n\n put_in.dialog({\n modal: true,\n beforeClose: function () {put_in.empty();},\n minHeight:300,\n minWidth:500,\n closeOnEscape: true\n });\n}","function wgm_show() {\n\t$('body').append(modal_html);\n\tdiv = '.wg_modal';\n\t$(div).modal('show');\n\t$(div).on('hidden', function () {\n\t\t$(div).remove();\n });\n\treturn $(div);\n}","function getModal(modalid) {\n return '
                    ' +\n '
                    ' +\n '' +\n '

                    Select Environmental Data for This Subset

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    '\n }","function insertProfiles(results) { //passes results and appends them to the page\r\n $.each(results, function(index, user) {\r\n $('#gallery').append(\r\n `
                    \r\n
                    \r\n \"profile\r\n
                    \r\n
                    \r\n

                    ${user.name.first} ${user.name.last}

                    \r\n

                    ${user.email}

                    \r\n

                    ${user.location.city}, ${user.location.state}

                    \r\n
                    \r\n
                    `);\r\n });\r\n\r\n//The modal div is being appended to the html\r\n function modalWindow() {\r\n $('#gallery').append(\r\n `
                    \r\n
                    \r\n \r\n
                    \r\n
                    \r\n
                    \r\n
                    `);\r\n $('.modal-container').hide();\r\n }\r\n// I am formating the information I want the modal window to portray\r\n function modalAddon(user) {\r\n\r\n $(\".modal-info-container\").html( `\r\n \"profile\r\n

                    ${user.name.first} ${user.name.last}

                    \r\n

                    ${user.email}

                    \r\n

                    ${user.location.city}

                    \r\n
                    _________________________________
                    \r\n

                    ${user.cell}

                    \r\n

                    Postcode: ${user.location.postcode}

                    \r\n

                    Birthday: ${user.dob.date}

                    \r\n
                    \r\n`);\r\n$(\".modal-container\").show();\r\n\r\n //This hide's the modal window when the \"X\" button is clicked\r\n $('#modal-close-btn').on(\"click\", function() {\r\n $(\".modal-container\").hide();\r\n });\r\n}\r\n\r\n\r\nmodalWindow(); //This opens the modal window when the card is clicked\r\n $('.card').on(\"click\", function() {\r\n let user = $('.card').index(this);\r\n modalAddon(results[user]);\r\n\r\n });\r\n\r\n}","function kmModalWindow($message){\n jQuery('
                    ', {\"class\": \"g-dialog-container d-block justify-content-center align-items-center visible\"})\n .append(jQuery('
                    ', {\"class\": \"g-dialog p-0\"})\n .append(jQuery('
                    ', {\"class\": \"g-dialog-header p-27\"}))\n .append(jQuery('
                    ', {\"class\": \"g-dialog-content gray-border-top-bottom\"})\n .append(jQuery('
                    ', {\"class\": \"d-grid\"})\n .append(jQuery('', {\"class\": \"d-block p-15\", \"html\": $message}))\n )\n )\n .append(jQuery('
                    ', {\"class\": \"g-dialog-footer text-right p-2\"})\n .append(jQuery('', {'class': 'close-modal btn btn-cancel mr-2', 'href': 'javascript:void(0);', text: 'Cancel'}))\n .append(jQuery('', {'class': 'close-modal btn btn-primary font-fjalla', 'href': 'javascript:void(0);', text: 'Ok'}))\n )\n ).appendTo('#page');\n}","function create_modal_research(elem,json_data,interest_or_fac) {\n\n var put_in = $('#modal_div');\n\n $div_research_modal = $(\"
                    \");\n\n if(interest_or_fac == 0){\n $div_research_modal.append(\"

                    \"+json_data.areaName+\"

                    \");\n\n\n }\n else{\n $div_research_modal.append(\"

                    \"+json_data.facultyName+\"

                    \");\n }\n\n $div_research_modal.append(\"
                      \");\n for(var i = 0; i < json_data.citations.length;i++){\n $div_research_modal.append(\"
                    • \"+json_data.citations[i]+\"
                    • \");\n }\n $div_research_modal.append(\"
                    \");\n\n put_in.append($div_research_modal);\n\n\n put_in.dialog({\n modal: true,\n beforeClose: function () {put_in.empty();},\n maxHeight:500,\n minWidth:700,\n closeOnEscape: true\n });\n}","modal() {\n const modal = new Modal({\n style: this.options.style,\n title: 'Test',\n });\n this.container = modal.body;\n document.body.appendChild(modal.modal);\n this.insertForm();\n modal.onHide(this.builder.clearForm.bind(this.builder));\n return modal;\n }","function appendFeedbackModal(activity) {\n $('.' + feedbackAreaDiv).append('
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //modal title only visible to screenreaders for accessibility\n '

                    Feedback

                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '

                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ');\n //because the combined static image and text answers takes up lots more space in these activities, drop the feedback modals lower\n if (activity.questionType === \"c2\" || activity.questionType === \"c4\") {\n //this has to be appended to the head of the document as a rule\n //instead of using the .css() function, because the classes are dynamic\n $(\"\").appendTo(\"head\");\n }\n}","function myPopupFunction(data,idtodelete) {\n // var popupid=\"myPopup\"+idtodelete;\n // var popup = document.getElementById(popupid);\n //popup.innerHTML = data;\n // $(document.getElementById(\"myModal2text\")).= \"fAILURE sORRY\";\n\n // $(\"myModal2text\").append$(\"Very Bad\");\n\n //$(document.getElementById(\"myModal2\")).click(function () { });\n //$(document.getElementById(\"myModal2text\")).html=\n var x = document.getElementById(\"myModal2text\");\n var displaytext = data.Status + \"!
                    \" + data.ExceptionDetails+\"\";\n x.innerHTML =displaytext;\n $('#myModal2').modal();\n}","function modal_display(data) {\n console.log(data);\n var apDiv = document.getElementById('apartmentModalBody');\n apDiv.innerHTML=\"\";\n apDiv.classList.add('mx-0');\n if(data != \"\")\n apDiv.appendChild(createModal(data));\n var modalDiv = document.getElementById('apartmentDetailsModal');\n modalDiv.style.display = 'block';\n modalDiv.style.overflowY =\"scroll\";\n modalDiv.style.maxHeight = '90%';\n var body = document.getElementById('mainBody');\n body.style.overflow = \"hidden\";\n}","function abrirModal(html, obj) {\n $(\"#newOrderModal\").modal();\n console.log(html);\n console.log(obj);\n //carga los datos \n $(\"#div_producto\").html(html);\n Item = obj;\n $('#btn_modal_prod').html(\n '' +\n '');\n\n\n }","function fnMostrarRequisicionModal(){\n //console.log(\"fnAgregarCatalogoModal\");\n\n var titulo = '

                    Anéxo Técnico

                    ';\n $('#ModalCR_Titulo').empty();\n $('#ModalCR_Titulo').append(titulo);\n $('#ModalCR').modal('show');\n}","function createModal() {\n RequestNewCardModal().then((json) => {\n const modal = document.querySelector('body').prepend(getChild(json));\n document.querySelector('.modal-container #close').addEventListener('click', closeModal);\n document.querySelector('.modal-container').addEventListener('click', closeModal);\n document.querySelector('.modal-container .button').addEventListener('click', requestNewCard);\n });\n}","_addModalHTML() {\n let modalEl = document.createElement(\"div\");\n modalEl.setAttribute(\"id\", \"enlightenModal\");\n modalEl.setAttribute(\"class\", \"modal\");\n modalEl.innerHTML = `\n
                    \n &times;\n

                    Title

                    \n

                    Content

                    \n
                    f`;\n\n let bodyEl = document.getElementsByTagName('body')[0];\n bodyEl.appendChild(modalEl);\n let span = document.getElementsByClassName(\"close\")[0];\n\n // When the user clicks on (x), close the modal\n span.onclick = function () {\n modalEl.style.display = \"none\";\n };\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function (event) {\n if (event.target.id === \"enlightenModal\") {\n modalEl.style.display = \"none\";\n }\n };\n return modalEl;\n }","function buildModalSimple() {\n let id = makeid();\n let html = ``;\n $('body').append(html);\n //let modal = $(`#${id}`);\n /*modal.modal({\n backdrop: 'static',\n keyboard: false,\n //show: true\n });*/\n\n //NEW MODAL FORMAT\n let modal = new bootstrap.Modal(document.getElementById(id), {\n keyboard: false,\n backdrop: 'static'\n });\n\n modal.show();\n\n $(document).on('click', `#${id} .modal-close`, function() {\n forceCloseModal(id);\n });\n\n return id;\n}","function AddElectionPOP(result){\n // ELEMENTS TO POPULATE THE MODAL\n let h3 = document.createElement('h3');\n let p = document.createElement('p');\n let a = document.createElement('a');\n\n if(result['status'] === '1'){\n h3.innerHTML = result['message'];\n p.innerHTML = 'Your Election Has Been Added Successfully';\n a.innerHTML = 'Continue';\n a.setAttribute('id', 'continue');\n a.setAttribute('href', '');\n inner.appendChild(h3);\n inner.appendChild(p);\n inner.appendChild(a);\n a.addEventListener('click', () => {\n removeModal();\n });\n }else{\n h3.innerHTML = result['message'];\n p.innerHTML = 'Something went wrong';\n a.innerHTML = 'Retry';\n a.setAttribute('id', 'retry');\n a.setAttribute('href', '');\n inner.appendChild(h3);\n inner.appendChild(p);\n inner.appendChild(a);\n a.addEventListener('click', () => {\n removeModal();\n });\n }\n\n}","function creaSubDialogos() {\n content = '
                    ' + //seleccion de productos\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //preferencias\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //confirmaciones\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + // seleccion de pizzas\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //seleccion de ingredientes\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ';\n $('#menucontent').append(content);\n}","function showNewInfo(data) {\n modalBody.html('')\n modalBody.append(`\n \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n \n `)\n\n modalFooter.html(`\n \n `)\n}","function add_extra_option_modal() {\n\tvar data = '
                    ';\n\tdata += '
                    ';\n\tdata += '';\n\tdata += '
                    ';\n\tdata += '
                    ';\n\tdata += '';\n\tdata += '
                    ';\n\tdata += '
                    ';\n\tdata += '';\n\tdata += '
                    ';\n\tdata += '
                    ';\n\t$('.js-extra-add-options_modal').append(data);\n}","appendDivToOverlay() {\n const panes = this.getPanes();\n panes.overlayLayer.appendChild(this.div);\n panes.overlayMouseTarget.appendChild(this.div);\n }","createModal() {\n this.overlayRef = this.overlay.create();\n this.modalRef = this.overlayRef.attach(new ComponentPortal(McModalComponent));\n }","function modals(titulo,mensaje){\n\n\tvar modal='';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='';\n\t\t\tmodal+='

                    '+titulo+'

                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='

                    '+mensaje+'

                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='
                    ';\n\t\t\t\n\t$(\"#main\").append(modal);\n\t\n\t$('#myModal2').modal({\n\t\tkeyboard: false,\n\t\tbackdrop: \"static\" \n\t});\n\t\n\t$('#myModal2').on('hidden', function () {\n\t\t$(this).remove();\n\t});\n\t\n}","function newPopup(options) {\n var html = [];\n html.push('
                    ');\n html.push('
                    ');\n html.push('');\n html.push('

                    Modal header

                    ');\n html.push('
                    ');\n html.push('
                    ');\n html.push('

                    One fine body…

                    ');\n html.push('
                    ');\n html.push('
                    ');\n var popup = $(html.join(\"\"));\n var title = options.title;\n var content = options.content;\n if (!title || \"\" == title) {\n title = $(content).find(\"h1\").remove();\n }\n if (options.noFade) {\n popup.removeClass(\"fade\");\n }\n popup.find(\".modal-body\").html(\"\").append(content);\n popup.find(\".title\").html(\"\").append(title);\n return popup.modal(options)\n }","function openNewModal(items){\n var count = 0;\n for(var obj of items){\n var tag = obj.type || \"div\";\n var classes = \"\";for(var c of obj.classes){classes+=c+\" \"};\n var inner = obj.content || \"\";\n var html = \"<\"+tag+\" class='\"+classes+\"'\";\n if(tag == 'textarea')\n html+=\"placeholder='\"+inner+\"'>\";\n else if(tag != \"input\")\n html+=\">\"+inner+\"\";\n else\n html+=\"placeholder='\"+inner+\"'>\";\n $(\"#mmc-wrapper\").append(html);\n count++;\n }\n if(count > 4){\n $('#main-modal-content').css({'margin': '2% auto'});\n }\n else\n $('#main-modal-content').css({'margin': '15% auto'});\n $('#main-modal').fadeIn(500);\n}","generateOverlay() {\n for (let i = 0; i < this.results.length; i++) {\n let modalContainer = `